From 02eb1cf6443157cf3e9e5d73c81211457c62f867 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Wed, 9 Oct 2024 15:36:31 +0800 Subject: [PATCH] update --- app/hdl/hdl_comm.go | 24 ++++++++++++++++++++++++ app/router/router.go | 3 ++- docs/docs.go | 38 ++++++++++++++++++++++++++++++++++++++ docs/swagger.json | 38 ++++++++++++++++++++++++++++++++++++++ docs/swagger.yaml | 25 +++++++++++++++++++++++++ 5 files changed, 127 insertions(+), 1 deletion(-) diff --git a/app/hdl/hdl_comm.go b/app/hdl/hdl_comm.go index bddf6b1..a66141d 100644 --- a/app/hdl/hdl_comm.go +++ b/app/hdl/hdl_comm.go @@ -1,6 +1,7 @@ package hdl import ( + implement2 "applet/app/db/implement" "applet/app/e" "applet/app/enum" "applet/app/md" @@ -106,3 +107,26 @@ func MenuList(c *gin.Context) { }, nil) return } + +// GetBaseInfo +// @Summary 获取系统信息 +// @Tags 公共模块-获取系统信息 +// @Description 获取系统信息 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Success 200 {string} "success" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/comm/basicGet [GET] +func GetBaseInfo(c *gin.Context) { + masterId := svc.GetMasterId(c) + engine := db.DBs[masterId] + sysCfgDb := implement2.NewSysCfgDb(engine, masterId) + res := sysCfgDb.SysCfgFindWithDb(enum.AppLogo, enum.AppName) + + e.OutSuc(c, md.BasicSetResp{ + AppName: res[enum.AppName], + AppLogo: res[enum.AppLogo], + }, nil) + return +} diff --git a/app/router/router.go b/app/router/router.go index 65ec3e7..917407e 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -80,7 +80,8 @@ func route(r *gin.RouterGroup) { } func rComm(r *gin.RouterGroup) { - r.POST("/getMenuList", hdl.MenuList) // 获取菜单栏列表 + r.GET("/getBaseInfo", hdl.GetBaseInfo) // 获取系统信息 + r.POST("/getMenuList", hdl.MenuList) // 获取菜单栏列表 } func rSetCenter(r *gin.RouterGroup) { diff --git a/docs/docs.go b/docs/docs.go index c4d2ffb..ce2af95 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -25,6 +25,44 @@ const docTemplate = `{ "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { + "/api/comm/basicGet": { + "get": { + "description": "获取系统信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "公共模块-获取系统信息" + ], + "summary": "获取系统信息", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, "/api/dataCenter/generate/data/detail": { "post": { "description": "数据中心-分成数据-详情", diff --git a/docs/swagger.json b/docs/swagger.json index b57506d..223905b 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -17,6 +17,44 @@ }, "host": "localhost:1001 or advertisement.dengbiao.top", "paths": { + "/api/comm/basicGet": { + "get": { + "description": "获取系统信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "公共模块-获取系统信息" + ], + "summary": "获取系统信息", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, "/api/dataCenter/generate/data/detail": { "post": { "description": "数据中心-分成数据-详情", diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 62daa06..81956fc 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -493,6 +493,31 @@ info: title: 广告联盟-总站长平台 version: "1.0" paths: + /api/comm/basicGet: + get: + consumes: + - application/json + description: 获取系统信息 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + produces: + - application/json + responses: + "200": + description: success + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 获取系统信息 + tags: + - 公共模块-获取系统信息 /api/dataCenter/generate/data/detail: post: consumes: