Browse Source

多域名

master
huangjiajun 14 hours ago
parent
commit
84122c34a6
6 changed files with 299 additions and 45 deletions
  1. +50
    -8
      app/hdl/setCenter/web/hdl_basic.go
  2. +1
    -1
      app/md/setCenter/md_web.go
  3. +4
    -2
      app/router/router.go
  4. +91
    -12
      docs/docs.go
  5. +91
    -12
      docs/swagger.json
  6. +62
    -10
      docs/swagger.yaml

+ 50
- 8
app/hdl/setCenter/web/hdl_basic.go View File

@@ -73,7 +73,7 @@ func SetBasic(c *gin.Context) {
return return
} }


// GetDomainBasic
// GetDownDomainBasic
// @Summary 基础设置-网站信息-下载页多域名设置(获取) // @Summary 基础设置-网站信息-下载页多域名设置(获取)
// @Tags 基础设置 // @Tags 基础设置
// @Description 网站信息-下载页多域名设置(获取) // @Description 网站信息-下载页多域名设置(获取)
@@ -82,18 +82,18 @@ func SetBasic(c *gin.Context) {
// @param Authorization header string true "验证参数Bearer和token空格拼接" // @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Success 200 {object} setCenter.WebDomainBasicReq "设置列表" // @Success 200 {object} setCenter.WebDomainBasicReq "设置列表"
// @Failure 400 {object} md.Response "具体错误" // @Failure 400 {object} md.Response "具体错误"
// @Router /api/settCenter/web/getDomainBasic [get]
func GetDomainBasic(c *gin.Context) {
// @Router /api/settCenter/web/getDownDomainBasic [get]
func GetDownDomainBasic(c *gin.Context) {
domain := svc.GetSysCfgStr("down_web_domain") domain := svc.GetSysCfgStr("down_web_domain")
var tmp = make([]string, 0) var tmp = make([]string, 0)
json.Unmarshal([]byte(domain), &tmp) json.Unmarshal([]byte(domain), &tmp)
resp := setCenter.WebDomainBasicReq{ resp := setCenter.WebDomainBasicReq{
DownWebDomain: tmp,
WebDomain: tmp,
} }
e.OutSuc(c, resp, nil) e.OutSuc(c, resp, nil)
} }


// SetDomainBasic
// SetDownDomainBasic
// @Summary 基础设置-网站信息-下载页多域名设置(更新) // @Summary 基础设置-网站信息-下载页多域名设置(更新)
// @Tags 基础设置 // @Tags 基础设置
// @Description 下载页多域名设置(更新) // @Description 下载页多域名设置(更新)
@@ -103,14 +103,56 @@ func GetDomainBasic(c *gin.Context) {
// @param req body setCenter.WebDomainBasicReq true "上传需要修改的信息" // @param req body setCenter.WebDomainBasicReq true "上传需要修改的信息"
// @Success 200 {string} "success" // @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误" // @Failure 400 {object} md.Response "具体错误"
// @Router /api/settCenter/web/setDomainBasic [post]
func SetDomainBasic(c *gin.Context) {
// @Router /api/settCenter/web/setDownDomainBasic [post]
func SetDownDomainBasic(c *gin.Context) {
var req *setCenter.WebDomainBasicReq var req *setCenter.WebDomainBasicReq
if err1 := c.ShouldBindJSON(&req); err1 != nil { if err1 := c.ShouldBindJSON(&req); err1 != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error()) e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
return return
} }
svc.SetSysCfgStr("down_web_domain", utils.SerializeStr(req.DownWebDomain))
svc.SetSysCfgStr("down_web_domain", utils.SerializeStr(req.WebDomain))
e.OutSuc(c, "success", nil)
return
}

// GetRegisterDomainBasic
// @Summary 基础设置-网站信息-下载页多域名设置(获取)
// @Tags 基础设置
// @Description 网站信息-下载页多域名设置(获取)
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Success 200 {object} setCenter.WebDomainBasicReq "设置列表"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/settCenter/web/getRegisterDomainBasic [get]
func GetRegisterDomainBasic(c *gin.Context) {
domain := svc.GetSysCfgStr("down_register_domain")
var tmp = make([]string, 0)
json.Unmarshal([]byte(domain), &tmp)
resp := setCenter.WebDomainBasicReq{
WebDomain: tmp,
}
e.OutSuc(c, resp, nil)
}

// SetRegisterDomainBasic
// @Summary 基础设置-网站信息-下载页多域名设置(更新)
// @Tags 基础设置
// @Description 下载页多域名设置(更新)
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @param req body setCenter.WebDomainBasicReq true "上传需要修改的信息"
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/settCenter/web/setRegisterDomainBasic [post]
func SetRegisterDomainBasic(c *gin.Context) {
var req *setCenter.WebDomainBasicReq
if err1 := c.ShouldBindJSON(&req); err1 != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
return
}
svc.SetSysCfgStr("down_register_domain", utils.SerializeStr(req.WebDomain))
e.OutSuc(c, "success", nil) e.OutSuc(c, "success", nil)
return return
} }

+ 1
- 1
app/md/setCenter/md_web.go View File

@@ -25,5 +25,5 @@ type KuaizhanBasicReq struct {
KuaizhanUrl string `json:"kuaizhan_url"` KuaizhanUrl string `json:"kuaizhan_url"`
} }
type WebDomainBasicReq struct { type WebDomainBasicReq struct {
DownWebDomain []string `json:"down_web_domain"`
WebDomain []string `json:"web_domain"`
} }

+ 4
- 2
app/router/router.go View File

@@ -121,8 +121,10 @@ func rSettCenter(r *gin.RouterGroup) { //设置中心
{ {
rWeb.GET("/getBasic", web.GetBasic) rWeb.GET("/getBasic", web.GetBasic)
rWeb.POST("/setBasic", web.SetBasic) rWeb.POST("/setBasic", web.SetBasic)
rWeb.GET("/getDomainBasic", web.GetDomainBasic)
rWeb.POST("/setDomainBasic", web.SetDomainBasic)
rWeb.GET("/getDownDomainBasic", web.GetDownDomainBasic)
rWeb.POST("/setDownDomainBasic", web.SetDownDomainBasic)
rWeb.GET("/getRegisterDomainBasic", web.GetRegisterDomainBasic)
rWeb.POST("/setRegisterDomainBasic", web.SetRegisterDomainBasic)
} }
rKuaizhan := r.Group("/kuaizhan") //快站信息 rKuaizhan := r.Group("/kuaizhan") //快站信息
{ {


+ 91
- 12
docs/docs.go View File

@@ -2186,7 +2186,7 @@ const docTemplate = `{
], ],
"responses": { "responses": {
"200": { "200": {
"description": "生成的黑名单id",
"description": "具体数据",
"schema": { "schema": {
"$ref": "#/definitions/md.GetDynamicResp" "$ref": "#/definitions/md.GetDynamicResp"
} }
@@ -8778,7 +8778,45 @@ const docTemplate = `{
} }
} }
}, },
"/api/settCenter/web/getDomainBasic": {
"/api/settCenter/web/getDownDomainBasic": {
"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": "设置列表",
"schema": {
"$ref": "#/definitions/setCenter.WebDomainBasicReq"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/settCenter/web/getRegisterDomainBasic": {
"get": { "get": {
"description": "网站信息-下载页多域名设置(获取)", "description": "网站信息-下载页多域名设置(获取)",
"consumes": [ "consumes": [
@@ -8863,7 +8901,54 @@ const docTemplate = `{
} }
} }
}, },
"/api/settCenter/web/setDomainBasic": {
"/api/settCenter/web/setDownDomainBasic": {
"post": {
"description": "下载页多域名设置(更新)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"基础设置"
],
"summary": "基础设置-网站信息-下载页多域名设置(更新)",
"parameters": [
{
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "上传需要修改的信息",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/setCenter.WebDomainBasicReq"
}
}
],
"responses": {
"200": {
"description": "success",
"schema": {
"type": "string"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/settCenter/web/setRegisterDomainBasic": {
"post": { "post": {
"description": "下载页多域名设置(更新)", "description": "下载页多域名设置(更新)",
"consumes": [ "consumes": [
@@ -11972,10 +12057,7 @@ const docTemplate = `{
}, },
"video": { "video": {
"description": "视频", "description": "视频",
"type": "array",
"items": {
"type": "string"
}
"type": "string"
} }
} }
}, },
@@ -14938,10 +15020,7 @@ const docTemplate = `{
}, },
"video": { "video": {
"description": "视频", "description": "视频",
"type": "array",
"items": {
"type": "string"
}
"type": "string"
} }
} }
}, },
@@ -17495,7 +17574,7 @@ const docTemplate = `{
"setCenter.WebDomainBasicReq": { "setCenter.WebDomainBasicReq": {
"type": "object", "type": "object",
"properties": { "properties": {
"down_web_domain": {
"web_domain": {
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"


+ 91
- 12
docs/swagger.json View File

@@ -2178,7 +2178,7 @@
], ],
"responses": { "responses": {
"200": { "200": {
"description": "生成的黑名单id",
"description": "具体数据",
"schema": { "schema": {
"$ref": "#/definitions/md.GetDynamicResp" "$ref": "#/definitions/md.GetDynamicResp"
} }
@@ -8770,7 +8770,45 @@
} }
} }
}, },
"/api/settCenter/web/getDomainBasic": {
"/api/settCenter/web/getDownDomainBasic": {
"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": "设置列表",
"schema": {
"$ref": "#/definitions/setCenter.WebDomainBasicReq"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/settCenter/web/getRegisterDomainBasic": {
"get": { "get": {
"description": "网站信息-下载页多域名设置(获取)", "description": "网站信息-下载页多域名设置(获取)",
"consumes": [ "consumes": [
@@ -8855,7 +8893,54 @@
} }
} }
}, },
"/api/settCenter/web/setDomainBasic": {
"/api/settCenter/web/setDownDomainBasic": {
"post": {
"description": "下载页多域名设置(更新)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"基础设置"
],
"summary": "基础设置-网站信息-下载页多域名设置(更新)",
"parameters": [
{
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "上传需要修改的信息",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/setCenter.WebDomainBasicReq"
}
}
],
"responses": {
"200": {
"description": "success",
"schema": {
"type": "string"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/settCenter/web/setRegisterDomainBasic": {
"post": { "post": {
"description": "下载页多域名设置(更新)", "description": "下载页多域名设置(更新)",
"consumes": [ "consumes": [
@@ -11964,10 +12049,7 @@
}, },
"video": { "video": {
"description": "视频", "description": "视频",
"type": "array",
"items": {
"type": "string"
}
"type": "string"
} }
} }
}, },
@@ -14930,10 +15012,7 @@
}, },
"video": { "video": {
"description": "视频", "description": "视频",
"type": "array",
"items": {
"type": "string"
}
"type": "string"
} }
} }
}, },
@@ -17487,7 +17566,7 @@
"setCenter.WebDomainBasicReq": { "setCenter.WebDomainBasicReq": {
"type": "object", "type": "object",
"properties": { "properties": {
"down_web_domain": {
"web_domain": {
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"


+ 62
- 10
docs/swagger.yaml View File

@@ -1643,9 +1643,7 @@ definitions:
type: string type: string
video: video:
description: 视频 description: 视频
items:
type: string
type: array
type: string
type: object type: object
md.EggEnergyAvailableEnergyFlow: md.EggEnergyAvailableEnergyFlow:
properties: properties:
@@ -3716,9 +3714,7 @@ definitions:
type: integer type: integer
video: video:
description: 视频 description: 视频
items:
type: string
type: array
type: string
type: object type: object
md.Response: md.Response:
properties: properties:
@@ -5477,7 +5473,7 @@ definitions:
type: object type: object
setCenter.WebDomainBasicReq: setCenter.WebDomainBasicReq:
properties: properties:
down_web_domain:
web_domain:
items: items:
type: string type: string
type: array type: array
@@ -6921,7 +6917,7 @@ paths:
- application/json - application/json
responses: responses:
"200": "200":
description: 生成的黑名单id
description: 具体数据
schema: schema:
$ref: '#/definitions/md.GetDynamicResp' $ref: '#/definitions/md.GetDynamicResp'
"400": "400":
@@ -11280,7 +11276,32 @@ paths:
summary: 基础设置-网站信息-基本设置(获取) summary: 基础设置-网站信息-基本设置(获取)
tags: tags:
- 基础设置 - 基础设置
/api/settCenter/web/getDomainBasic:
/api/settCenter/web/getDownDomainBasic:
get:
consumes:
- application/json
description: 网站信息-下载页多域名设置(获取)
parameters:
- description: 验证参数Bearer和token空格拼接
in: header
name: Authorization
required: true
type: string
produces:
- application/json
responses:
"200":
description: 设置列表
schema:
$ref: '#/definitions/setCenter.WebDomainBasicReq'
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 基础设置-网站信息-下载页多域名设置(获取)
tags:
- 基础设置
/api/settCenter/web/getRegisterDomainBasic:
get: get:
consumes: consumes:
- application/json - application/json
@@ -11336,7 +11357,38 @@ paths:
summary: 基础设置-网站信息-基本设置(更新) summary: 基础设置-网站信息-基本设置(更新)
tags: tags:
- 基础设置 - 基础设置
/api/settCenter/web/setDomainBasic:
/api/settCenter/web/setDownDomainBasic:
post:
consumes:
- application/json
description: 下载页多域名设置(更新)
parameters:
- description: 验证参数Bearer和token空格拼接
in: header
name: Authorization
required: true
type: string
- description: 上传需要修改的信息
in: body
name: req
required: true
schema:
$ref: '#/definitions/setCenter.WebDomainBasicReq'
produces:
- application/json
responses:
"200":
description: success
schema:
type: string
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 基础设置-网站信息-下载页多域名设置(更新)
tags:
- 基础设置
/api/settCenter/web/setRegisterDomainBasic:
post: post:
consumes: consumes:
- application/json - application/json


Loading…
Cancel
Save