From 4ef4df8681fc841e6ec14897e1358fa2159b93ef Mon Sep 17 00:00:00 2001 From: dengbiao Date: Fri, 25 Oct 2024 22:50:44 +0800 Subject: [PATCH] update --- app/lib/youlianghui/api.go | 72 +- app/lib/youlianghui/curl.go | 84 + app/lib/youlianghui/md/api_md.go | 4 +- app/mw/mw_swag_auth.go | 38 + app/router/router.go | 13 + app/svc/svc_auth.go | 14 + docs/open.json | 4816 ++++++++++++++++++++++++++++++ generate_swagger.sh | 127 + 8 files changed, 5136 insertions(+), 32 deletions(-) create mode 100644 app/lib/youlianghui/curl.go create mode 100644 app/mw/mw_swag_auth.go create mode 100644 docs/open.json create mode 100644 generate_swagger.sh diff --git a/app/lib/youlianghui/api.go b/app/lib/youlianghui/api.go index 3779047..bffe339 100644 --- a/app/lib/youlianghui/api.go +++ b/app/lib/youlianghui/api.go @@ -2,12 +2,14 @@ package youlianghui import ( "applet/app/cfg" + "applet/app/lib/youlianghui/md" ) type ApiService struct { - MemberId string `json:"member_id"` - Secret string `json:"secret"` - Host string `json:"host"` + MemberId string `json:"member_id"` + Secret string `json:"secret"` + Host string `json:"host"` + Header map[string]string `json:"header"` } func NewApiService(memberId, secret string) (apiService ApiService, err error) { // set方法 @@ -17,34 +19,44 @@ func NewApiService(memberId, secret string) (apiService ApiService, err error) { if cfg.Prd { apiService.Host = "http://api.adnet.qq.com/open/v1.1" } - + apiService.Header = make(map[string]string) + apiService.Header["Content-Type"] = "multipart/form-data" + apiService.Header["token"] = GetToken(apiService.MemberId, apiService.Secret) return } // MediumAdd 创建媒体 -// func (apiService *ApiService) MediumAdd() (appId string, err error) { // set方法 -// token := GetToken(apiService.MemberId, apiService.Secret) -// url := apiService.Host + "/medium/add" -// params := map[string]interface{}{ -// "name": name, -// "type": string(adunitType), -// } -// if adunitType == enum.AdunitTypeForVideoFeeds { -// params["video_duration_min"] = 6 -// params["video_duration_max"] = 60 -// } -// postBody, err := utils.CurlPost(url, utils.SerializeStr(params), nil) -// if err != nil { -// return -// } -// var resp md.AgencyCreateAdunit -// err = json.Unmarshal(postBody, &resp) -// if err != nil { -// return -// } -// if resp.Ret != 0 { -// err = errors.New(resp.ErrMsg) -// } -// adUnitId = resp.AdUnitId -// return -// } +func (apiService *ApiService) MediumAdd(req md.MediumAdd) (appId string, err error) { // set方法 + url := apiService.Host + "/medium/add" + if req.Affiliation == "" { + req.Affiliation = "Agency" // Own:应用开发者、Agency:应用发行/代理方 + } + params := map[string]string{ + "member_id": apiService.MemberId, + "medium_name": req.MediumName, + "industry_id_v2": req.IndustryIdV2, + "os": req.Os, + "affiliation": req.Affiliation, + "package_name": req.PackageName, + "full_package_name": req.FullPackageName, + "wechat_app_id": req.WechatAppId, + "package_name_wx_appid_rel": req.PackageNameWxAppidRel, + "wechat_universal_link": req.WechatUniversalLink, + } + + postBody, err := MultipartFormDataRequest(url, params, nil, apiService.Header) + if err != nil { + return "", err + } + + var resp md.AgencyCreateAdunit + err = json.Unmarshal(postBody, &resp) + if err != nil { + return + } + if resp.Ret != 0 { + err = errors.New(resp.ErrMsg) + } + adUnitId = resp.AdUnitId + return +} diff --git a/app/lib/youlianghui/curl.go b/app/lib/youlianghui/curl.go new file mode 100644 index 0000000..c24cdfe --- /dev/null +++ b/app/lib/youlianghui/curl.go @@ -0,0 +1,84 @@ +package youlianghui + +import ( + "bytes" + "fmt" + "io" + "io/ioutil" + "mime/multipart" + "net/http" + "os" +) + +// MultipartFormDataRequest 封装 multipart/form-data 请求 +func MultipartFormDataRequest(url string, fields map[string]string, files map[string]string, headers map[string]string) ([]byte, error) { + // 创建一个缓冲区来存储表单数据 + var b bytes.Buffer + w := multipart.NewWriter(&b) + + // 添加文本字段 + for key, value := range fields { + if err := addFormValue(w, key, value); err != nil { + return nil, err + } + } + + // 添加文件字段 + for fieldName, filePath := range files { + file, err := os.Open(filePath) + if err != nil { + return nil, fmt.Errorf("error opening file %s: %v", filePath, err) + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filePath) + if err != nil { + return nil, fmt.Errorf("error creating form file %s: %v", fieldName, err) + } + + if _, err := io.Copy(part, file); err != nil { + return nil, fmt.Errorf("error copying file %s to part: %v", filePath, err) + } + } + + // 完成多部分表单 + if err := w.Close(); err != nil { + return nil, fmt.Errorf("error closing multipart writer: %v", err) + } + + // 创建请求 + req, err := http.NewRequest("POST", url, &b) + if err != nil { + return nil, fmt.Errorf("error creating request: %v", err) + } + + // 设置头部 + req.Header.Set("Content-Type", w.FormDataContentType()) + for key, value := range headers { + req.Header.Set(key, value) + } + + // 发送请求 + client := &http.Client{} + resp, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %v", err) + } + defer resp.Body.Close() + body, err := ioutil.ReadAll(resp.Body) // 读取响应 + if err != nil { + return nil, err + } + + return body, nil +} + +// addFormValue 辅助函数:添加表单值 +func addFormValue(w *multipart.Writer, key, value string) error { + fw, err := w.CreateFormField(key) + if err != nil { + return fmt.Errorf("error creating form field %s: %v", key, err) + } + _, err = fw.Write([]byte(value)) + return err +} diff --git a/app/lib/youlianghui/md/api_md.go b/app/lib/youlianghui/md/api_md.go index 964a2b6..60934cd 100644 --- a/app/lib/youlianghui/md/api_md.go +++ b/app/lib/youlianghui/md/api_md.go @@ -2,8 +2,8 @@ package md type MediumAdd struct { MediumName string `json:"medium_name" example:"媒体名字"` - IndustryIdV2 int `json:"industry_id_v2" example:"媒体所属新3级行业id"` - Os int `json:"os" example:"操作系统,数字含义1-Android, 2-iOS"` + IndustryIdV2 string `json:"industry_id_v2" example:"媒体所属新3级行业id"` + Os string `json:"os" example:"操作系统,数字含义1-Android, 2-iOS"` DetailUrl string `json:"detail_url" example:"详情页url(支持的各个商店域名约束)"` Affiliation string `json:"affiliation" example:"媒体隶属关系"` PackageName string `json:"package_name" example:"主程序包名"` diff --git a/app/mw/mw_swag_auth.go b/app/mw/mw_swag_auth.go new file mode 100644 index 0000000..e163981 --- /dev/null +++ b/app/mw/mw_swag_auth.go @@ -0,0 +1,38 @@ +package mw + +import "github.com/gin-gonic/gin" + +//func SwagAuth(c *gin.Context) { +// // 这里的 "user" 和 "password" 是示例,需要替换为实际的用户名和密码 +// username := c.Query("user") +// password := c.Query("password") +// +// // 验证用户名和密码 +// if username != "micro_group" || password != "123456" { +// //e.OutErr(c, e.ERR_UNAUTHORIZED, "Unauthorized!") +// //return +// c.AbortWithStatusJSON(401, gin.H{"error": "Unauthorized"}) +// return +// } +// +// // 如果密码正确,则继续执行后续的处理函数 +// c.Next() +//} + +// @summary 用于密码验证的中间件 +func SwagAuth() gin.HandlerFunc { + return func(c *gin.Context) { + // 这里的 "user" 和 "password" 是示例,需要替换为实际的用户名和密码 + username := c.Query("user") + password := c.Query("password") + + // 验证用户名和密码 + if username != "admin" || password != "secret" { + c.AbortWithStatusJSON(401, gin.H{"error": "Unauthorized"}) + return + } + + // 如果密码正确,则继续执行后续的处理函数 + c.Next() + } +} diff --git a/app/router/router.go b/app/router/router.go index c53fb75..08d1216 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -25,6 +25,19 @@ func Init() *gin.Engine { ginSwagger.DisablingWrapHandler(swaggerFiles.Handler, "SWAGGER")(c) }) + // TODO::指定open的文档的位置 + // 设置静态文件服务,提供 group2.json 文件 + r.Static("/api-docs", "./docs") + r.GET("/open/swagger/*any", gin.BasicAuth(gin.Accounts{ + "zhiYin": "123456", + }), func(c *gin.Context) { + requestTls := "http://" + if c.Request.TLS != nil { + requestTls = "https://" + } + r.Use(mw.SwagAuth()) + ginSwagger.WrapHandler(swaggerFiles.Handler, ginSwagger.URL(requestTls+c.Request.Host+"/api-docs/open.json"))(c) + }) r.Use(mw.ChangeHeader) // 是否打印访问日志, 在非正式环境都打印 diff --git a/app/svc/svc_auth.go b/app/svc/svc_auth.go index fe862ec..5ddd19d 100644 --- a/app/svc/svc_auth.go +++ b/app/svc/svc_auth.go @@ -30,6 +30,20 @@ func GetUser(c *gin.Context) *model.Admin { func CheckUser(c *gin.Context) (*model.Admin, string, error) { token := c.GetHeader("Authorization") if token == "" { + //TODO::兼容open + appSecret := c.GetHeader("AppSecret") + if appSecret != "" { + //TODO::暂时给激活鸟写死 + if appSecret == "2F125D59EE826535D7E84E407A13C107" { + // 获取admin + adminDb := implement.NewAdminDb(db.DBs[GetMasterId(c)]) + admin, err := adminDb.GetAdmin(1001) + if err != nil { + return nil, "", err + } + return admin, "", nil + } + } return nil, "", errors.New("token not exist") } // 按空格分割 diff --git a/docs/open.json b/docs/open.json new file mode 100644 index 0000000..c37b014 --- /dev/null +++ b/docs/open.json @@ -0,0 +1,4816 @@ +{ + "swagger": "2.0", + "info": { + "description": "广告联盟接口", + "title": "广告联盟", + "termsOfService": "http://swagger.io/terms/", + "contact": { + "name": "zhiying", + "url": "http://www.swagger.io/support", + "email": "zhiyongos@163.com" + }, + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + }, + "version": "1.0" + }, + "host": "xxxxx.adcms.zhiyingos.cn", + "paths": { + "/api/dataCenter/generate/data/del": { + "post": { + "description": "数据中心-分成数据-删除", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "数据中心------嘉俊" + ], + "summary": "分成数据-删除", + "parameters": [ + { + "type": "string", + "description": "秘钥内容", + "name": "AppSecret", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.DataCenterGenerateDataCommReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 ", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/generate/data/detail": { + "post": { + "description": "数据中心-分成数据-详情", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "数据中心------嘉俊" + ], + "summary": "分成数据-详情", + "parameters": [ + { + "type": "string", + "description": "秘钥内容", + "name": "AppSecret", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.DataCenterGenerateDataCommReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 ", + "schema": { + "$ref": "#/definitions/md.DataCenterGenerateDataDetailData" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/generate/data/doing": { + "post": { + "description": "数据中心-分成数据-应用操作", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "数据中心------嘉俊" + ], + "summary": "分成数据-应用操作", + "parameters": [ + { + "type": "string", + "description": "秘钥内容", + "name": "AppSecret", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.DataCenterGenerateDataCommReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 ", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/generate/data/list": { + "post": { + "description": "数据中心-分成数据-列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "数据中心------嘉俊" + ], + "summary": "分成数据-列表", + "parameters": [ + { + "type": "string", + "description": "秘钥内容", + "name": "AppSecret", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.DataCenterGenerateDataReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.DataCenterGenerateDataRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/income/data/detail": { + "post": { + "description": "数据中心-收益报表-详情", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "数据中心------嘉俊" + ], + "summary": "收益报表-详情", + "parameters": [ + { + "type": "string", + "description": "秘钥内容", + "name": "AppSecret", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.DataCenterGenerateDataCommReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.DataCenterIncomeDataDetail" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/income/data/list": { + "post": { + "description": "数据中心-收益报表-列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "数据中心------嘉俊" + ], + "summary": "收益报表-列表", + "parameters": [ + { + "type": "string", + "description": "秘钥内容", + "name": "AppSecret", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.DataCenterGenerateDataReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.DataCenterIncomeDataRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/original/data/del": { + "post": { + "description": "数据中心-原始数据-删除", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "数据中心------嘉俊" + ], + "summary": "原始数据-删除", + "parameters": [ + { + "type": "string", + "description": "秘钥内容", + "name": "AppSecret", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.DataCenterOriginalDataCommReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 ", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/original/data/doing": { + "post": { + "description": "数据中心-原始数据-应用操作", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "数据中心------嘉俊" + ], + "summary": "原始数据-应用操作", + "parameters": [ + { + "type": "string", + "description": "秘钥内容", + "name": "AppSecret", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.DataCenterDataCenterOriginalDataDoingReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 ", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/original/data/list": { + "post": { + "description": "数据中心-原始数据-列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "数据中心------嘉俊" + ], + "summary": "原始数据-列表", + "parameters": [ + { + "type": "string", + "description": "秘钥内容", + "name": "AppSecret", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.DataCenterOriginalDataReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.DataCenterOriginalDataRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/original/data/more/application": { + "post": { + "description": "数据中心-原始数据-一键导入应用列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "数据中心------嘉俊" + ], + "summary": "原始数据-一键导入应用列表", + "parameters": [ + { + "type": "string", + "description": "秘钥内容", + "name": "AppSecret", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.DataCenterOriginalDataMoreApplicationReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.DataCenterOriginalDataMoreApplicationRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/original/data/more/application/doing": { + "post": { + "description": "数据中心-原始数据-一键导入操作", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "数据中心------嘉俊" + ], + "summary": "原始数据-一键导入操作", + "parameters": [ + { + "type": "string", + "description": "秘钥内容", + "name": "AppSecret", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.DataCenterOriginalDataMoreApplicationDoingReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 ", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/original/data/more/application/state": { + "get": { + "description": "数据中心-原始数据-一键导入操作状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "数据中心------嘉俊" + ], + "summary": "原始数据-一键导入操作状态", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "AppSecret", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "具体看返回内容 state=1 进行中", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/original/data/one/application": { + "get": { + "description": "数据中心-原始数据-单个导入应用列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "数据中心------嘉俊" + ], + "summary": "原始数据-单个导入应用列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "AppSecret", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.DataCenterOriginalDataOneApplicationRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/original/data/one/application/ad/list": { + "post": { + "description": "数据中心-原始数据-单个导入应用-广告位列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "数据中心------嘉俊" + ], + "summary": "原始数据-单个导入应用-广告位列表", + "parameters": [ + { + "type": "string", + "description": "秘钥内容", + "name": "AppSecret", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.DataCenterOriginalDataOneApplicationAdListReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.DataCenterOriginalDataOneApplicationAdListRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/original/data/one/application/doing": { + "post": { + "description": "数据中心-原始数据-单个应用数据操作", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "数据中心------嘉俊" + ], + "summary": "原始数据-单个应用数据操作", + "parameters": [ + { + "type": "string", + "description": "秘钥内容", + "name": "AppSecret", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.DataCenterOriginalDataOneApplicationDoingReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 ", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/original/data/one/application/state": { + "get": { + "description": "数据中心-原始数据-单个应用数据操作后的完成状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "数据中心------嘉俊" + ], + "summary": "原始数据-单个应用数据操作后的完成状态", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "AppSecret", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "具体看返回内容 state=1 进行中", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/original/data/one/application/total": { + "post": { + "description": "数据中心-原始数据-单个应用数据统计", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "数据中心------嘉俊" + ], + "summary": "原始数据-单个应用数据统计", + "parameters": [ + { + "type": "string", + "description": "秘钥内容", + "name": "AppSecret", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.DataCenterOriginalDataOneApplicationDoingReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 ", + "schema": { + "$ref": "#/definitions/md.DataCenterOriginalDataOneApplicationDoingRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/original/data/total": { + "post": { + "description": "数据中心-原始数据-记录应用时统计", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "数据中心------嘉俊" + ], + "summary": "原始数据-记录应用时统计", + "parameters": [ + { + "type": "string", + "description": "秘钥内容", + "name": "AppSecret", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.DataCenterOriginalDataCommReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 ", + "schema": { + "$ref": "#/definitions/md.MediumDivisionStrategy" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + } + }, + "definitions": { + "hdl.WxOpenThirdPartyAppList": { + "type": "object", + "properties": { + "aes_key": { + "type": "string" + }, + "app_secret": { + "type": "string" + }, + "appid": { + "type": "string" + }, + "component_access_token": { + "type": "string" + }, + "component_verify_ticket": { + "type": "string" + }, + "create_at": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "token": { + "type": "string" + }, + "update_at": { + "type": "string" + }, + "uuid": { + "type": "integer" + } + } + }, + "md.AddAdminReq": { + "type": "object", + "required": [ + "password", + "username" + ], + "properties": { + "memo": { + "type": "string" + }, + "password": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "md.AddRoleReq": { + "type": "object", + "required": [ + "memo", + "name" + ], + "properties": { + "label": { + "type": "string" + }, + "logo": { + "type": "string" + }, + "memo": { + "type": "string" + }, + "name": { + "type": "string" + }, + "seo_logo": { + "type": "string" + }, + "seo_title": { + "type": "string" + } + } + }, + "md.AdminListReq": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "page": { + "type": "integer" + }, + "state": { + "type": "integer" + }, + "username": { + "type": "string" + } + } + }, + "md.AgencyGetBlackListResp": { + "type": "object", + "properties": { + "blacklist_android": { + "description": "屏蔽安卓应用列表", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "屏蔽安卓应用的应用宝包名" + }, + "name": { + "type": "string", + "example": "屏蔽安卓应用的名称" + }, + "url": { + "type": "string", + "example": "屏蔽安卓应用标识图片" + } + } + } + }, + "blacklist_biz": { + "description": "屏蔽公众号列表", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "屏蔽公众号微信号" + }, + "name": { + "type": "string", + "example": "屏蔽公众号名称" + }, + "url": { + "type": "string", + "example": "屏蔽公众号头像URL" + } + } + } + }, + "blacklist_ios": { + "description": "屏蔽IOS应用列表", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "屏蔽IOS应用的APPID" + }, + "name": { + "type": "string", + "example": "屏蔽IOS应用名称" + }, + "url": { + "type": "string", + "example": "屏蔽IOS应用标识图片" + } + } + } + }, + "blacklist_weapp": { + "description": "屏蔽小程序/小游戏列表", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "屏蔽小程序/小游戏原始ID" + }, + "name": { + "type": "string", + "example": "屏蔽小程序/小游戏名称" + }, + "url": { + "type": "string", + "example": "屏蔽小程序/小游戏头像URL" + } + } + } + }, + "err_msg": { + "type": "string", + "example": "错误信息" + }, + "ret": { + "description": "错误码", + "type": "integer" + } + } + }, + "md.AgentQualificationBankData": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "账号" + }, + "agent_id": { + "type": "string", + "example": "代理id" + }, + "bank": { + "type": "string", + "example": "开户银行" + }, + "bank_branch": { + "type": "string", + "example": "开户银行分行" + }, + "bank_no": { + "type": "string", + "example": "银行卡号" + }, + "company_name": { + "type": "string", + "example": "公司名称" + }, + "currency_conf": { + "type": "string", + "example": "结算币种 0人民币" + }, + "id": { + "type": "string", + "example": "id" + }, + "kind": { + "type": "string", + "example": "类型(1:企业 2:个人)" + }, + "licence": { + "type": "string", + "example": "开户许可证" + }, + "memo": { + "type": "string", + "example": "备注 审核时填写的" + }, + "state": { + "type": "string", + "example": "状态(0:待提交 1:待审核 2:审核通过 3:审核拒绝)" + }, + "unified_social_credit_code": { + "type": "string", + "example": "统一社会信用代码" + } + } + }, + "md.AgentQualificationBankRes": { + "type": "object", + "properties": { + "currency_conf": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.AgentQualificationBankData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + }, + "type": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + } + } + }, + "md.AgentQualificationContactData": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "账号" + }, + "address": { + "type": "string", + "example": "联系地址" + }, + "agent_id": { + "type": "string", + "example": "代理id" + }, + "company_name": { + "type": "string", + "example": "公司名称" + }, + "email": { + "type": "string", + "example": "邮箱地址" + }, + "id": { + "type": "string", + "example": "id" + }, + "kind": { + "type": "string", + "example": "类型(1:企业 2:个人)" + }, + "memo": { + "type": "string", + "example": "备注 审核时填写的" + }, + "name": { + "type": "string", + "example": "联系人" + }, + "phone": { + "type": "string", + "example": "联系电话" + }, + "state": { + "type": "string", + "example": "状态(0:待提交 1:待审核 2:审核通过 3:审核拒绝)" + } + } + }, + "md.AgentQualificationContactRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.AgentQualificationContactData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.AgentQualificationEnterpriseAuditReq": { + "type": "object", + "properties": { + "agent_id": { + "type": "string" + }, + "memo": { + "type": "string" + }, + "state": { + "type": "string" + } + } + }, + "md.AgentQualificationEnterpriseData": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "账号" + }, + "agent_id": { + "type": "string", + "example": "代理id" + }, + "business_license_address": { + "type": "string", + "example": "营业执照地址" + }, + "business_license_img_url": { + "type": "string", + "example": "营业执照照片" + }, + "certificate_first_type": { + "type": "string", + "example": "证件类型 1级类目id" + }, + "certificate_type": { + "type": "string", + "example": "证件类型 2级类目id" + }, + "certificate_validity": { + "type": "string", + "example": "证件有效期" + }, + "company_abbreviation": { + "type": "string", + "example": "公司简称" + }, + "company_name": { + "type": "string", + "example": "公司名称" + }, + "country_region": { + "type": "string", + "example": "国家地区" + }, + "country_region_id": { + "type": "string", + "example": "国家地区id" + }, + "id": { + "type": "string", + "example": "状态选择" + }, + "kind": { + "type": "string", + "example": "类型(1:企业 2:个人)" + }, + "legal_representative": { + "type": "string", + "example": "法定代表人" + }, + "memo": { + "type": "string", + "example": "备注 审核时填写的" + }, + "registered_address": { + "type": "string", + "example": "注册地址" + }, + "registered_address_city_id": { + "type": "string", + "example": "注册地址-市id" + }, + "registered_address_country_id": { + "type": "string", + "example": "注册地址-国家id" + }, + "registered_address_county_id": { + "type": "string", + "example": "注册地址-县/区id" + }, + "registered_address_province_id": { + "type": "string", + "example": "册地址-省份id" + }, + "state": { + "type": "string", + "example": "状态(0:待提交 1:待审核 2:审核通过 3:审核拒绝)" + }, + "unified_social_credit_code": { + "type": "string", + "example": "统一社会信用代码" + }, + "uuid": { + "type": "string", + "example": "站长id" + } + } + }, + "md.AgentQualificationEnterpriseReq": { + "type": "object", + "properties": { + "limit": { + "type": "string" + }, + "name": { + "type": "string" + }, + "page": { + "type": "string" + }, + "state": { + "type": "string" + } + } + }, + "md.AgentQualificationEnterpriseRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.AgentQualificationEnterpriseData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + }, + "type": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + } + } + }, + "md.AppletAddBlackListReq": { + "type": "object", + "required": [ + "Kind", + "appid", + "id" + ], + "properties": { + "Kind": { + "description": "类型(1:公众号 2:IOS应用 3:安卓应用 4:小程序/小游戏)", + "type": "integer" + }, + "appid": { + "type": "string", + "example": "授权小程序appid" + }, + "id": { + "type": "string", + "example": "微信公众号id | IOS应用APPID | 安卓应用的应用宝包名 | 小程序/小游戏原始ID" + } + } + }, + "md.AppletAddReq": { + "type": "object", + "required": [ + "appid", + "logo", + "name", + "original_id" + ], + "properties": { + "appid": { + "type": "string", + "example": "授权小程序appid" + }, + "logo": { + "type": "string", + "example": "小程序logo" + }, + "name": { + "type": "string", + "example": "小程序名称" + }, + "original_id": { + "type": "string", + "example": "授权小程序原始id" + } + } + }, + "md.AppletApplicationAdSpaceListData": { + "type": "object", + "properties": { + "ad_id": { + "type": "string", + "example": "广告位id" + }, + "app_id": { + "type": "string", + "example": "小程序appid" + }, + "cooperate_state": { + "type": "string", + "example": "合作状态" + }, + "id": { + "type": "string", + "example": "id" + }, + "kind": { + "type": "string", + "example": "广告位类型" + }, + "logo": { + "type": "string", + "example": "logo" + }, + "memo": { + "type": "string", + "example": "备注" + }, + "name": { + "type": "string", + "example": "应用名称" + }, + "platform": { + "type": "string", + "example": "平台" + }, + "state": { + "type": "string", + "example": "应用状态 state=2 才能再次编辑" + } + } + }, + "md.AppletApplicationAdSpaceListReq": { + "type": "object", + "properties": { + "ad_type": { + "type": "string", + "example": "" + }, + "cooperate_state": { + "type": "string", + "example": "合作状态" + }, + "limit": { + "type": "string" + }, + "medium_id": { + "type": "string", + "example": "媒体id" + }, + "name": { + "type": "string" + }, + "page": { + "type": "string" + }, + "platform": { + "type": "string" + } + } + }, + "md.AppletApplicationAdSpaceListRes": { + "type": "object", + "properties": { + "ad_type": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "cooperate_state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.AppletApplicationAdSpaceListData" + } + }, + "platform": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.AppletApplicationAdSpaceMediumListData": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "账号" + }, + "contact_name": { + "type": "string", + "example": "联系人" + }, + "count": { + "type": "string", + "example": "广告位数量" + }, + "id": { + "type": "string", + "example": "id" + }, + "medium_id": { + "type": "string", + "example": "媒体id" + }, + "name": { + "type": "string", + "example": "名称" + }, + "phone": { + "type": "string", + "example": "联系电话" + } + } + }, + "md.AppletApplicationAdSpaceMediumListReq": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "媒体账号" + }, + "limit": { + "type": "string" + }, + "name": { + "type": "string", + "example": "媒体名称" + }, + "page": { + "type": "string" + } + } + }, + "md.AppletApplicationAdSpaceMediumListRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.AppletApplicationAdSpaceMediumListData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.AppletApplicationAdSpaceSaveReq": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "id 多个逗号隔开" + }, + "memo": { + "type": "string", + "example": "备注" + }, + "state": { + "type": "string", + "example": "审核状态" + } + } + }, + "md.AppletApplicationListData": { + "type": "object", + "properties": { + "app_id": { + "type": "string", + "example": "小程序appid" + }, + "cooperate_state": { + "type": "string", + "example": "合作状态" + }, + "id": { + "type": "string", + "example": "id" + }, + "logo": { + "type": "string", + "example": "logo" + }, + "memo": { + "type": "string", + "example": "备注" + }, + "name": { + "type": "string", + "example": "应用名称" + }, + "original_id": { + "type": "string", + "example": "小程序id" + }, + "platform": { + "type": "string", + "example": "平台" + }, + "state": { + "type": "string", + "example": "应用状态 state=3 才能再次编辑" + } + } + }, + "md.AppletApplicationListReq": { + "type": "object", + "properties": { + "cooperate_state": { + "type": "string", + "example": "合作状态" + }, + "limit": { + "type": "string" + }, + "medium_id": { + "type": "string", + "example": "媒体id" + }, + "name": { + "type": "string" + }, + "page": { + "type": "string" + }, + "platform": { + "type": "string" + } + } + }, + "md.AppletApplicationListRes": { + "type": "object", + "properties": { + "cooperate_state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.AppletApplicationListData" + } + }, + "platform": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.AppletApplicationMediumListData": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "账号" + }, + "contact_name": { + "type": "string", + "example": "联系人" + }, + "count": { + "type": "string", + "example": "应用数量" + }, + "id": { + "type": "string", + "example": "id" + }, + "medium_id": { + "type": "string", + "example": "媒体id" + }, + "name": { + "type": "string", + "example": "名称" + }, + "phone": { + "type": "string", + "example": "联系电话" + } + } + }, + "md.AppletApplicationMediumListReq": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "媒体账号" + }, + "limit": { + "type": "string" + }, + "name": { + "type": "string", + "example": "媒体名称" + }, + "page": { + "type": "string" + } + } + }, + "md.AppletApplicationMediumListRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.AppletApplicationMediumListData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.AppletApplicationSaveReq": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "id 多个逗号隔开" + }, + "memo": { + "type": "string", + "example": "备注" + }, + "state": { + "type": "string", + "example": "审核状态" + } + } + }, + "md.AppletDelBlackListReq": { + "type": "object", + "required": [ + "Kind", + "appid", + "id" + ], + "properties": { + "Kind": { + "description": "类型(1:公众号 2:IOS应用 3:安卓应用 4:小程序/小游戏)", + "type": "integer" + }, + "appid": { + "type": "string", + "example": "授权小程序appid" + }, + "id": { + "type": "string", + "example": "微信公众号id | IOS应用APPID | 安卓应用的应用宝包名 | 小程序/小游戏原始ID" + } + } + }, + "md.AppletGetAmsCategoryBlackListReq": { + "type": "object", + "required": [ + "appid" + ], + "properties": { + "appid": { + "type": "string", + "example": "授权小程序appid" + } + } + }, + "md.AppletGetAmsCategoryBlackListResp": { + "type": "object", + "properties": { + "ams_category": { + "description": "行业列表", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "行业名称" + }, + "value": { + "type": "string", + "example": "行业标识符" + } + } + } + }, + "checked_ams_category": { + "description": "选中的行业列表", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "行业名称" + }, + "value": { + "type": "string", + "example": "行业标识符" + } + } + } + } + } + }, + "md.AppletGetBlackListReq": { + "type": "object", + "required": [ + "appid" + ], + "properties": { + "appid": { + "type": "string", + "example": "授权小程序appid" + } + } + }, + "md.AppletSetAmsCategoryBlackListReq": { + "type": "object", + "required": [ + "appid" + ], + "properties": { + "appid": { + "type": "string", + "example": "授权小程序appid" + }, + "checked_ams_category": { + "description": "选中的行业列表", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "md.AppletUpdateReq": { + "type": "object", + "required": [ + "id", + "logo", + "name" + ], + "properties": { + "id": { + "type": "integer" + }, + "logo": { + "type": "string", + "example": "小程序logo" + }, + "name": { + "type": "string", + "example": "小程序名称" + } + } + }, + "md.BindAdminRoleReq": { + "type": "object", + "required": [ + "adm_id" + ], + "properties": { + "adm_id": { + "type": "integer" + }, + "role_ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "md.CommDetailReq": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "列表id" + } + } + }, + "md.DataCenterDataCenterOriginalDataDoingReq": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "列表id" + }, + "now_ecpm": { + "type": "string", + "example": "现-广告千次曝光收益(元)" + }, + "now_exposure_count": { + "type": "string", + "example": "现-曝光量" + } + } + }, + "md.DataCenterGenerateDataCommReq": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "列表id" + } + } + }, + "md.DataCenterGenerateDataData": { + "type": "object", + "properties": { + "adv_name": { + "type": "string", + "example": "广告位" + }, + "agent_revenue": { + "type": "string", + "example": "代理收益(元)" + }, + "agreement_sharing": { + "type": "string", + "example": "协议分成(元)" + }, + "agreement_sharing_total": { + "type": "string", + "example": "协议总分成(元)" + }, + "click_count": { + "type": "string", + "example": "现-点击量" + }, + "click_rate": { + "type": "string", + "example": "现-点击率" + }, + "commission_retention": { + "type": "string", + "example": "佣金留存(元)" + }, + "date": { + "type": "string", + "example": "日期" + }, + "ecpm": { + "type": "string", + "example": "'现-ecpm(元)" + }, + "exposure_count": { + "type": "string", + "example": "现-曝光量" + }, + "extra_revenue": { + "type": "string", + "example": "额外收益(元)" + }, + "id": { + "type": "string", + "example": "id" + }, + "is_generate_report": { + "type": "string", + "example": "是否已生成报表(0:未 1:已)" + }, + "media_revenue": { + "type": "string", + "example": "媒体收益(元)" + }, + "name": { + "type": "string", + "example": "名称" + }, + "old_click_count": { + "type": "string", + "example": "原-点击量" + }, + "old_click_rate": { + "type": "string", + "example": "原-点击率" + }, + "old_ecpm": { + "type": "string", + "example": "'原-ecpm(元)" + }, + "old_exposure_count": { + "type": "string", + "example": "原-曝光量" + }, + "platform": { + "type": "string", + "example": "平台名称" + }, + "platform_retention": { + "type": "string", + "example": "平台留存(元)" + }, + "price_adjustment_retention": { + "type": "string", + "example": "调价留存(元)" + }, + "state": { + "type": "string", + "example": "状态id" + } + } + }, + "md.DataCenterGenerateDataDetailAgentReward": { + "type": "object", + "properties": { + "account": { + "type": "string" + }, + "agent_revenue": { + "type": "string", + "example": "代理收益(元)" + }, + "agent_revenue_rate": { + "type": "string", + "example": "代理收益百分比" + }, + "extra_revenue": { + "type": "string", + "example": "额外收益(元)" + }, + "extra_revenue_rate": { + "type": "string", + "example": "'额外收益百分比" + }, + "name": { + "type": "string" + } + } + }, + "md.DataCenterGenerateDataDetailAgentRewardSecond": { + "type": "object", + "properties": { + "account": { + "type": "string" + }, + "agent_revenue": { + "type": "string", + "example": "代理收益(元)" + }, + "agent_revenue_rate": { + "type": "string", + "example": "代理收益百分比" + }, + "name": { + "type": "string" + } + } + }, + "md.DataCenterGenerateDataDetailData": { + "type": "object", + "properties": { + "agent_revenue_rate": { + "type": "string", + "example": "代理收益百分比" + }, + "agent_reward": { + "type": "array", + "items": { + "$ref": "#/definitions/md.DataCenterGenerateDataDetailAgentReward" + } + }, + "agreement_sharing_rate": { + "type": "string", + "example": "协议分成百分比" + }, + "commission_retention_rate": { + "type": "string", + "example": "佣金留存百分比" + }, + "create_at": { + "type": "string" + }, + "extra_revenue_rate": { + "type": "string", + "example": "额外收益百分比" + }, + "media_revenue_rate": { + "type": "string", + "example": "媒体收益百分比" + }, + "platform_retention_rate": { + "type": "string", + "example": "平台留存百分比" + }, + "update_at": { + "type": "string" + } + } + }, + "md.DataCenterGenerateDataReq": { + "type": "object", + "properties": { + "end_time": { + "type": "string" + }, + "limit": { + "type": "string" + }, + "name": { + "type": "string" + }, + "page": { + "type": "string" + }, + "platform": { + "type": "string" + }, + "start_time": { + "type": "string" + }, + "state": { + "type": "string" + } + } + }, + "md.DataCenterGenerateDataRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.DataCenterGenerateDataData" + } + }, + "platform": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.DataCenterIncomeDataData": { + "type": "object", + "properties": { + "adv_name": { + "type": "string", + "example": "广告位" + }, + "agent_revenue": { + "type": "string", + "example": "代理收益(元)" + }, + "agreement_sharing": { + "type": "string", + "example": "平台收益(元)" + }, + "click_count": { + "type": "string", + "example": "现-点击量" + }, + "click_rate": { + "type": "string", + "example": "现-点击率" + }, + "date": { + "type": "string", + "example": "日期" + }, + "ecpm": { + "type": "string", + "example": "'现-ecpm(元)" + }, + "exposure_count": { + "type": "string", + "example": "现-曝光量" + }, + "id": { + "type": "string", + "example": "id" + }, + "media_revenue": { + "type": "string", + "example": "媒体收益(元)" + }, + "name": { + "type": "string", + "example": "名称" + }, + "platform": { + "type": "string", + "example": "平台名称" + }, + "settle_amount": { + "type": "string", + "example": "结算收益(元)" + }, + "state": { + "type": "string", + "example": "状态id" + } + } + }, + "md.DataCenterIncomeDataDetail": { + "type": "object", + "properties": { + "agent_revenue": { + "type": "string", + "example": "代理收益(元)" + }, + "agent_revenue_rate": { + "type": "string", + "example": "代理收益百分比" + }, + "agent_reward": { + "type": "array", + "items": { + "$ref": "#/definitions/md.DataCenterGenerateDataDetailAgentRewardSecond" + } + }, + "agreement_sharing": { + "type": "string", + "example": "平台收益(元)" + }, + "agreement_sharing_rate": { + "type": "string", + "example": "平台收益百分比" + }, + "create_at": { + "type": "string" + }, + "data_source": { + "type": "string", + "example": "数据来源" + }, + "media_revenue": { + "type": "string", + "example": "媒体收益(元)" + }, + "media_revenue_rate": { + "type": "string", + "example": "媒体收益百分比" + }, + "medium_name": { + "type": "string", + "example": "媒体名称" + }, + "platform": { + "type": "string", + "example": "填充来源" + }, + "update_at": { + "type": "string" + } + } + }, + "md.DataCenterIncomeDataRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.DataCenterIncomeDataData" + } + }, + "platform": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.DataCenterOriginalDataCommReq": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "列表id" + }, + "now_ecpm": { + "type": "string", + "example": "现-广告千次曝光收益(元)" + }, + "now_exposure_count": { + "type": "string", + "example": "现-曝光量" + } + } + }, + "md.DataCenterOriginalDataData": { + "type": "object", + "properties": { + "adv_name": { + "type": "string", + "example": "广告位" + }, + "click_count": { + "type": "string", + "example": "点击量" + }, + "click_rate": { + "type": "string", + "example": "点击率" + }, + "date": { + "type": "string", + "example": "日期" + }, + "ecpm": { + "type": "string", + "example": "'ecpm(元)" + }, + "exposure_count": { + "type": "string", + "example": "曝光量" + }, + "exposure_rate": { + "type": "string", + "example": "曝光率" + }, + "id": { + "type": "string", + "example": "id" + }, + "is_apply": { + "type": "string", + "example": "是否已应用" + }, + "name": { + "type": "string", + "example": "名称" + }, + "platform": { + "type": "string", + "example": "平台名称" + }, + "publisher_income": { + "type": "string", + "example": "总收益(元)" + }, + "req_succ_count": { + "type": "string", + "example": "拉取量" + }, + "state": { + "type": "string", + "example": "状态id" + } + } + }, + "md.DataCenterOriginalDataMoreApplicationData": { + "type": "object", + "properties": { + "ad_id": { + "type": "string", + "example": "广告位id" + }, + "adv_name": { + "type": "string", + "example": "广告位" + }, + "app_id": { + "type": "string", + "example": "小程序id" + }, + "id": { + "type": "string", + "example": "id" + }, + "logo": { + "type": "string" + }, + "name": { + "type": "string", + "example": "名称" + }, + "state": { + "type": "string", + "example": "状态id" + } + } + }, + "md.DataCenterOriginalDataMoreApplicationDoingReq": { + "type": "object", + "properties": { + "date": { + "type": "string", + "example": "2024-08-28" + }, + "ids": { + "type": "array", + "items": { + "$ref": "#/definitions/md.DataCenterOriginalDataOneApplicationDoingReqData" + } + } + } + }, + "md.DataCenterOriginalDataMoreApplicationReq": { + "type": "object", + "properties": { + "limit": { + "type": "string" + }, + "name": { + "type": "string" + }, + "page": { + "type": "string" + } + } + }, + "md.DataCenterOriginalDataMoreApplicationRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.DataCenterOriginalDataMoreApplicationData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.DataCenterOriginalDataOneApplicationAdListData": { + "type": "object", + "properties": { + "ad_id": { + "type": "string", + "example": "广告位id" + }, + "id": { + "type": "string", + "example": "id" + }, + "name": { + "type": "string", + "example": "名称" + }, + "state": { + "type": "string", + "example": "状态id" + } + } + }, + "md.DataCenterOriginalDataOneApplicationAdListReq": { + "type": "object", + "properties": { + "app_id": { + "type": "string" + } + } + }, + "md.DataCenterOriginalDataOneApplicationAdListRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.DataCenterOriginalDataOneApplicationAdListData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + } + } + }, + "md.DataCenterOriginalDataOneApplicationData": { + "type": "object", + "properties": { + "app_id": { + "type": "string", + "example": "小程序id" + }, + "id": { + "type": "string", + "example": "id" + }, + "logo": { + "type": "string" + }, + "name": { + "type": "string", + "example": "名称" + } + } + }, + "md.DataCenterOriginalDataOneApplicationDoingReq": { + "type": "object", + "properties": { + "ad_id": { + "type": "string" + }, + "app_id": { + "type": "string" + }, + "date": { + "type": "string", + "example": "2024-08-28" + } + } + }, + "md.DataCenterOriginalDataOneApplicationDoingReqData": { + "type": "object", + "properties": { + "ad_id": { + "type": "string" + }, + "app_id": { + "type": "string" + } + } + }, + "md.DataCenterOriginalDataOneApplicationDoingRes": { + "type": "object", + "properties": { + "ad_id": { + "type": "string" + }, + "ad_slot": { + "type": "string", + "example": "广告位类型名称" + }, + "click_count": { + "type": "string", + "example": "点击量" + }, + "click_rate": { + "type": "string", + "example": "点击率" + }, + "ecpm": { + "type": "string", + "example": "ecpm(元)" + }, + "exposure_count": { + "type": "string", + "example": "曝光量" + }, + "exposure_rate": { + "type": "string", + "example": "曝光率" + }, + "publisher_income": { + "type": "string", + "example": "总收益(元)" + }, + "req_succ_count": { + "type": "string", + "example": "拉取量" + } + } + }, + "md.DataCenterOriginalDataOneApplicationRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.DataCenterOriginalDataOneApplicationData" + } + } + } + }, + "md.DataCenterOriginalDataReq": { + "type": "object", + "properties": { + "end_time": { + "type": "string" + }, + "limit": { + "type": "string" + }, + "name": { + "type": "string" + }, + "page": { + "type": "string" + }, + "platform": { + "type": "string" + }, + "start_time": { + "type": "string" + }, + "state": { + "type": "string" + } + } + }, + "md.DataCenterOriginalDataRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.DataCenterOriginalDataData" + } + }, + "platform": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.DivisionStrategyData": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "账号" + }, + "agent_revenue_rate": { + "type": "string", + "example": "代理收益百分比" + }, + "agreement_sharing_rate": { + "type": "string", + "example": "协议分成百分比" + }, + "commission_retention_rate": { + "type": "string", + "example": "佣金留存百分比" + }, + "extra_revenue_rate": { + "type": "string", + "example": "额外收益百分比" + }, + "id": { + "type": "string", + "example": "id" + }, + "media_revenue_rate": { + "type": "string", + "example": "媒体收益百分比" + }, + "medium_id": { + "type": "string", + "example": "媒体id" + }, + "name": { + "type": "string", + "example": "名称" + }, + "platform_retention_rate": { + "type": "string", + "example": "平台留存百分比" + } + } + }, + "md.DivisionStrategyDetailByAgent": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "账号" + }, + "agent_id": { + "type": "string", + "example": "代理id" + }, + "agent_revenue_rate": { + "type": "string", + "example": "佣金比例" + }, + "extra_revenue_rate": { + "type": "string", + "example": "额外奖励" + }, + "name": { + "type": "string", + "example": "名称" + } + } + }, + "md.DivisionStrategyDetailReq": { + "type": "object", + "properties": { + "medium_id": { + "type": "string" + } + } + }, + "md.DivisionStrategyDetailRes": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "账号" + }, + "agent_list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.DivisionStrategyDetailByAgent" + } + }, + "agent_revenue_rate": { + "type": "string", + "example": "代理收益百分比" + }, + "agreement_sharing_rate": { + "type": "string", + "example": "协议分成百分比" + }, + "commission_retention_rate": { + "type": "string", + "example": "佣金留存百分比" + }, + "extra_revenue_rate": { + "type": "string", + "example": "额外收益百分比" + }, + "media_revenue_rate": { + "type": "string", + "example": "媒体收益百分比" + }, + "medium_id": { + "type": "string", + "example": "媒体id" + }, + "name": { + "type": "string", + "example": "名称" + }, + "platform_retention_rate": { + "type": "string", + "example": "平台留存百分比" + } + } + }, + "md.DivisionStrategyReq": { + "type": "object", + "properties": { + "limit": { + "type": "string" + }, + "name": { + "type": "string" + }, + "page": { + "type": "string" + } + } + }, + "md.DivisionStrategyRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.DivisionStrategyData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.FinanceCenterDataAgentDetail": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "媒体账号" + }, + "all_income": { + "type": "string", + "example": "合计收益" + }, + "income": { + "type": "string", + "example": "渠道结算" + }, + "invoice": { + "$ref": "#/definitions/md.Invoice" + }, + "name": { + "type": "string", + "example": "媒体名称" + }, + "other_income": { + "type": "string", + "example": "其他调整" + }, + "pay_state": { + "type": "string", + "example": "结算单支付状态(0:未开始 1:待审核发票 2:发票审核中 3:发票审核拒绝 4:付款中 5:已付款)" + }, + "settle_file": { + "type": "string", + "example": "结算单" + }, + "source": { + "type": "string", + "example": "结算标示" + }, + "state": { + "type": "string", + "example": "结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订)" + }, + "time_str": { + "type": "string", + "example": "业务时间" + } + } + }, + "md.FinanceCenterDataAgentDetailRes": { + "type": "object", + "properties": { + "business_kind": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "data": { + "$ref": "#/definitions/md.FinanceCenterDataAgentDetail" + }, + "invoice_cate": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "invoice_state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "settle_pay_state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "settle_state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "settle_type": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + } + } + }, + "md.FinanceCenterDataData": { + "type": "object", + "properties": { + "all_income": { + "type": "string", + "example": "合计收益" + }, + "change_income": { + "type": "string", + "example": "调价留存" + }, + "commission_income": { + "type": "string", + "example": "佣金留存" + }, + "id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "medium_income": { + "type": "string", + "example": "媒体结算" + }, + "name": { + "type": "string", + "example": "媒体名称" + }, + "other_income": { + "type": "string", + "example": "其他调整" + }, + "pay_state": { + "type": "string", + "example": "结算单支付状态(0:未开始 1:待审核发票 2:发票审核中 3:发票审核拒绝 4:付款中 5:已付款)" + }, + "platform_income": { + "type": "string", + "example": "平台留存" + }, + "settle_type": { + "type": "string", + "example": "结算单类型(1:日结 2:周结 3:月结 4:预付)" + }, + "state": { + "type": "string", + "example": "结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订)" + }, + "time_str": { + "type": "string", + "example": "业务时间" + }, + "top_income": { + "type": "string", + "example": "上游结算" + } + } + }, + "md.FinanceCenterDataDetail": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "媒体账号" + }, + "all_income": { + "type": "string", + "example": "合计收益" + }, + "change_income": { + "type": "string", + "example": "调价留存" + }, + "commission_income": { + "type": "string", + "example": "佣金留存" + }, + "invoice": { + "$ref": "#/definitions/md.Invoice" + }, + "medium_income": { + "type": "string", + "example": "媒体结算" + }, + "name": { + "type": "string", + "example": "媒体名称" + }, + "other_income": { + "type": "string", + "example": "其他调整" + }, + "pay_state": { + "type": "string", + "example": "结算单支付状态(0:未开始 1:待审核发票 2:发票审核中 3:发票审核拒绝 4:付款中 5:已付款)" + }, + "platform_income": { + "type": "string", + "example": "平台留存" + }, + "settle_file": { + "type": "string", + "example": "结算单" + }, + "source": { + "type": "string", + "example": "结算标示" + }, + "state": { + "type": "string", + "example": "结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订)" + }, + "time_str": { + "type": "string", + "example": "业务时间" + }, + "top_income": { + "type": "string", + "example": "上游结算" + } + } + }, + "md.FinanceCenterDataDetailRes": { + "type": "object", + "properties": { + "business_kind": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "data": { + "$ref": "#/definitions/md.FinanceCenterDataDetail" + }, + "invoice_cate": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "invoice_state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "settle_pay_state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "settle_state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "settle_type": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + } + } + }, + "md.FinanceCenterDataReq": { + "type": "object", + "properties": { + "end_time": { + "type": "string" + }, + "limit": { + "type": "string" + }, + "page": { + "type": "string" + }, + "pay_state": { + "type": "string", + "example": "读 settle_pay_state返回的" + }, + "start_time": { + "type": "string", + "example": "2024-08-29" + } + } + }, + "md.FinanceCenterDataRes": { + "type": "object", + "properties": { + "business_kind": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.FinanceCenterDataData" + } + }, + "settle_pay_state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "settle_state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "settle_type": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.FinanceCenterPlatformDataData": { + "type": "object", + "properties": { + "agent_income": { + "type": "string", + "example": "代理结算" + }, + "change_income": { + "type": "string", + "example": "调价留存" + }, + "commission_income": { + "type": "string", + "example": "佣金留存" + }, + "id": { + "type": "string" + }, + "medium_income": { + "type": "string", + "example": "媒体结算" + }, + "platform_income": { + "type": "string", + "example": "平台留存" + }, + "time_str": { + "type": "string", + "example": "业务时间" + }, + "top_income": { + "type": "string", + "example": "上游结算" + }, + "update_at": { + "type": "string", + "example": "更新时间" + } + } + }, + "md.FinanceCenterPlatformDataReq": { + "type": "object", + "properties": { + "date": { + "type": "string", + "example": "2024-08-29" + }, + "end_time": { + "type": "string" + }, + "limit": { + "type": "string" + }, + "page": { + "type": "string" + }, + "start_time": { + "type": "string", + "example": "2024-08-29" + } + } + }, + "md.FinanceCenterPlatformDataRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.FinanceCenterPlatformDataData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.FinancialDynamicsAgentListData": { + "type": "object", + "properties": { + "amount": { + "type": "string", + "example": "支付金额" + }, + "business_kind": { + "type": "string", + "example": "支付类型(1:广告合作)" + }, + "certificate": { + "type": "string", + "example": "支付凭证" + }, + "id": { + "type": "string" + }, + "memo": { + "type": "string", + "example": "备注" + }, + "name": { + "type": "string" + }, + "pay_method": { + "type": "string", + "example": "支付方式 0对私 1对公" + }, + "pay_time": { + "type": "string", + "example": "支付时间" + } + } + }, + "md.FinancialDynamicsAgentListReq": { + "type": "object", + "properties": { + "end_time": { + "type": "string" + }, + "limit": { + "type": "string" + }, + "page": { + "type": "string" + }, + "start_time": { + "type": "string", + "example": "2024-08-29 00:00:00" + }, + "uid": { + "type": "string", + "example": "" + } + } + }, + "md.FinancialDynamicsAgentListRes": { + "type": "object", + "properties": { + "business_kind": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.FinancialDynamicsAgentListData" + } + }, + "pay_method": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + }, + "user": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + } + } + }, + "md.FinancialDynamicsAgentSaveReq": { + "type": "object", + "properties": { + "amount": { + "type": "string", + "example": "支付金额" + }, + "business_kind": { + "type": "string", + "example": "支付类型(1:广告合作)" + }, + "certificate": { + "type": "string", + "example": "支付凭证" + }, + "memo": { + "type": "string", + "example": "备注" + }, + "pay_method": { + "type": "string", + "example": "支付方式 0对私 1对公" + }, + "uid": { + "type": "string" + } + } + }, + "md.FinancialDynamicsAgentTotalReq": { + "type": "object", + "properties": { + "end_time": { + "type": "string" + }, + "start_time": { + "type": "string", + "example": "2024-08-29 00:00:00" + }, + "uid": { + "type": "string", + "example": "" + } + } + }, + "md.FinancialDynamicsAgentTotalRes": { + "type": "object", + "properties": { + "all_amount": { + "type": "string", + "example": "预付总金额" + }, + "balance_amount": { + "type": "string", + "example": "账户余额" + }, + "pay_count": { + "type": "string", + "example": "预付次数" + }, + "use_amount": { + "type": "string", + "example": "已消耗金额" + } + } + }, + "md.FinancialDynamicsMediumListData": { + "type": "object", + "properties": { + "amount": { + "type": "string", + "example": "支付金额" + }, + "business_kind": { + "type": "string", + "example": "支付类型(1:广告合作)" + }, + "certificate": { + "type": "string", + "example": "支付凭证" + }, + "id": { + "type": "string" + }, + "memo": { + "type": "string", + "example": "备注" + }, + "name": { + "type": "string" + }, + "pay_method": { + "type": "string", + "example": "支付方式 0对私 1对公" + }, + "pay_time": { + "type": "string", + "example": "支付时间" + } + } + }, + "md.FinancialDynamicsMediumListReq": { + "type": "object", + "properties": { + "end_time": { + "type": "string" + }, + "limit": { + "type": "string" + }, + "page": { + "type": "string" + }, + "start_time": { + "type": "string", + "example": "2024-08-29 00:00:00" + }, + "uid": { + "type": "string", + "example": "" + } + } + }, + "md.FinancialDynamicsMediumListRes": { + "type": "object", + "properties": { + "business_kind": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.FinancialDynamicsMediumListData" + } + }, + "pay_method": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + }, + "user": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + } + } + }, + "md.FinancialDynamicsMediumSaveReq": { + "type": "object", + "properties": { + "amount": { + "type": "string", + "example": "支付金额" + }, + "business_kind": { + "type": "string", + "example": "支付类型(1:广告合作)" + }, + "certificate": { + "type": "string", + "example": "支付凭证" + }, + "memo": { + "type": "string", + "example": "备注" + }, + "pay_method": { + "type": "string", + "example": "支付方式 0对私 1对公" + }, + "uid": { + "type": "string" + } + } + }, + "md.FinancialDynamicsMediumTotalReq": { + "type": "object", + "properties": { + "end_time": { + "type": "string" + }, + "start_time": { + "type": "string", + "example": "2024-08-29 00:00:00" + }, + "uid": { + "type": "string", + "example": "" + } + } + }, + "md.FinancialDynamicsMediumTotalRes": { + "type": "object", + "properties": { + "all_amount": { + "type": "string", + "example": "预付总金额" + }, + "balance_amount": { + "type": "string", + "example": "账户余额" + }, + "pay_count": { + "type": "string", + "example": "预付次数" + }, + "use_amount": { + "type": "string", + "example": "已消耗金额" + } + } + }, + "md.ImgReqUpload": { + "type": "object", + "properties": { + "dir": { + "type": "string" + }, + "file_name": { + "type": "string" + }, + "file_size": { + "description": "文件大小, 单位byte", + "type": "integer" + } + } + }, + "md.IndexAppListData": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.IndexAppListDataList" + } + }, + "logo": { + "type": "string" + }, + "name": { + "type": "string" + }, + "table_list": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "md.IndexAppListDataList": { + "type": "object", + "properties": { + "bili": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "md.IndexAppListReq": { + "type": "object", + "properties": { + "end_date": { + "type": "string", + "example": "2024-08-30" + }, + "name": { + "type": "string" + }, + "sort": { + "type": "string", + "example": "排序" + }, + "start_date": { + "type": "string", + "example": "2024-08-30" + } + } + }, + "md.IndexAppListRes": { + "type": "object", + "properties": { + "app_id": { + "type": "array", + "items": { + "type": "string" + } + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.IndexAppListData" + } + }, + "sort": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + } + } + }, + "md.IndexAppListTableReq": { + "type": "object", + "properties": { + "app_id": { + "type": "array", + "items": { + "type": "string" + } + }, + "end_date": { + "type": "string", + "example": "2024-08-30" + }, + "start_date": { + "type": "string", + "example": "2024-08-30" + } + } + }, + "md.Invoice": { + "type": "object", + "properties": { + "count": { + "type": "string" + }, + "file": { + "type": "array", + "items": { + "$ref": "#/definitions/md.InvoiceFile" + } + }, + "time": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "md.InvoiceFile": { + "type": "object", + "properties": { + "state": { + "type": "string", + "example": "0待确认 1审核通过 2审核失败" + }, + "url": { + "type": "string" + } + } + }, + "md.InvoiceReq": { + "type": "object", + "properties": { + "file": { + "type": "array", + "items": { + "$ref": "#/definitions/md.InvoiceFile" + } + }, + "id": { + "type": "string", + "example": "列表id" + }, + "state": { + "type": "string", + "example": "1审核通过 2审核失败" + } + } + }, + "md.LoginReq": { + "type": "object", + "required": [ + "password", + "username" + ], + "properties": { + "code": { + "type": "string", + "example": "验证码" + }, + "password": { + "type": "string", + "example": "登录密码" + }, + "username": { + "type": "string", + "example": "登录账号" + } + } + }, + "md.LoginResponse": { + "type": "object", + "properties": { + "token": { + "type": "string" + } + } + }, + "md.MediumDivisionStrategy": { + "type": "object", + "properties": { + "agent_revenue": { + "type": "string", + "example": "代理收益" + }, + "agent_revenue_rate": { + "type": "string", + "example": "代理收益百分比" + }, + "agreement_sharing": { + "type": "string", + "example": "协议分成" + }, + "agreement_sharing_rate": { + "type": "string", + "example": "协议分成百分比" + }, + "commission_retention": { + "type": "string", + "example": "佣金留存" + }, + "commission_retention_rate": { + "type": "string", + "example": "佣金留存百分比" + }, + "ecpm": { + "type": "string", + "example": "现-ecpm(元)" + }, + "exposure_count": { + "type": "string", + "example": "曝光量" + }, + "extra_revenue": { + "type": "string", + "example": "额外收益" + }, + "extra_revenue_rate": { + "type": "string", + "example": "额外收益百分比" + }, + "media_revenue": { + "type": "string", + "example": "媒体收益" + }, + "media_revenue_rate": { + "type": "string", + "example": "媒体收益百分比" + }, + "old_ecpm": { + "type": "string", + "example": "原-ecpm(元)" + }, + "platform_retention": { + "type": "string", + "example": "平台留存" + }, + "platform_retention_rate": { + "type": "string", + "example": "平台留存百分比" + } + } + }, + "md.MediumListData": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "媒体账号" + }, + "business_license_address": { + "type": "string", + "example": "营业执照地址" + }, + "business_license_img": { + "type": "string", + "example": "营业执照图片" + }, + "company_name": { + "type": "string", + "example": "公司名称" + }, + "id": { + "type": "string", + "example": "id" + }, + "legal_representative": { + "type": "string", + "example": "法定代表人" + }, + "medium_id": { + "type": "string", + "example": "媒体id" + }, + "memo": { + "type": "string", + "example": "备注 审核时填写的" + }, + "state": { + "type": "string", + "example": "状态(0:待提交 1:待审核 2:审核通过 3:审核拒绝)" + }, + "unified_social_credit_code": { + "type": "string", + "example": "统一社会信用代码" + } + } + }, + "md.MediumListDelReq": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "列表id" + } + } + }, + "md.MediumListReq": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "limit": { + "type": "string" + }, + "name": { + "type": "string" + }, + "page": { + "type": "string" + }, + "state": { + "type": "string" + } + } + }, + "md.MediumListRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.MediumListData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.MediumListSaveReq": { + "type": "object", + "properties": { + "medium_id": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "md.MediumQualificationBankData": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "账号" + }, + "bank": { + "type": "string", + "example": "开户银行" + }, + "bank_branch": { + "type": "string", + "example": "开户银行分行" + }, + "bank_no": { + "type": "string", + "example": "银行卡号" + }, + "company_name": { + "type": "string", + "example": "公司名称" + }, + "currency_conf": { + "type": "string", + "example": "结算币种 0人民币" + }, + "id": { + "type": "string", + "example": "id" + }, + "kind": { + "type": "string", + "example": "类型(1:企业 2:个人)" + }, + "licence": { + "type": "string", + "example": "开户许可证" + }, + "medium_id": { + "type": "string", + "example": "代理id" + }, + "memo": { + "type": "string", + "example": "备注 审核时填写的" + }, + "state": { + "type": "string", + "example": "状态(0:待提交 1:待审核 2:审核通过 3:审核拒绝)" + }, + "unified_social_credit_code": { + "type": "string", + "example": "统一社会信用代码" + } + } + }, + "md.MediumQualificationBankRes": { + "type": "object", + "properties": { + "currency_conf": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.MediumQualificationBankData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + }, + "type": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + } + } + }, + "md.MediumQualificationContactData": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "账号" + }, + "address": { + "type": "string", + "example": "联系地址" + }, + "company_name": { + "type": "string", + "example": "公司名称" + }, + "email": { + "type": "string", + "example": "邮箱地址" + }, + "id": { + "type": "string", + "example": "id" + }, + "kind": { + "type": "string", + "example": "类型(1:企业 2:个人)" + }, + "medium_id": { + "type": "string", + "example": "代理id" + }, + "memo": { + "type": "string", + "example": "备注 审核时填写的" + }, + "name": { + "type": "string", + "example": "联系人" + }, + "phone": { + "type": "string", + "example": "联系电话" + }, + "state": { + "type": "string", + "example": "状态(0:待提交 1:待审核 2:审核通过 3:审核拒绝)" + } + } + }, + "md.MediumQualificationContactRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.MediumQualificationContactData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.MediumQualificationEnterpriseAuditReq": { + "type": "object", + "properties": { + "medium_id": { + "type": "string" + }, + "memo": { + "type": "string" + }, + "state": { + "type": "string" + } + } + }, + "md.MediumQualificationEnterpriseData": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "账号" + }, + "business_license_address": { + "type": "string", + "example": "营业执照地址" + }, + "business_license_img_url": { + "type": "string", + "example": "营业执照照片" + }, + "certificate_first_type": { + "type": "string", + "example": "证件类型 1级类目id" + }, + "certificate_type": { + "type": "string", + "example": "证件类型 2级类目id" + }, + "certificate_validity": { + "type": "string", + "example": "证件有效期" + }, + "company_abbreviation": { + "type": "string", + "example": "公司简称" + }, + "company_name": { + "type": "string", + "example": "公司名称" + }, + "country_region": { + "type": "string", + "example": "国家地区" + }, + "country_region_id": { + "type": "string", + "example": "国家地区id" + }, + "id": { + "type": "string", + "example": "状态选择" + }, + "kind": { + "type": "string", + "example": "类型(1:企业 2:个人)" + }, + "legal_representative": { + "type": "string", + "example": "法定代表人" + }, + "medium_id": { + "type": "string", + "example": "代理id" + }, + "memo": { + "type": "string", + "example": "备注 审核时填写的" + }, + "registered_address": { + "type": "string", + "example": "注册地址" + }, + "registered_address_city_id": { + "type": "string", + "example": "注册地址-市id" + }, + "registered_address_country_id": { + "type": "string", + "example": "注册地址-国家id" + }, + "registered_address_county_id": { + "type": "string", + "example": "注册地址-县/区id" + }, + "registered_address_province_id": { + "type": "string", + "example": "册地址-省份id" + }, + "state": { + "type": "string", + "example": "状态(0:待提交 1:待审核 2:审核通过 3:审核拒绝)" + }, + "unified_social_credit_code": { + "type": "string", + "example": "统一社会信用代码" + }, + "uuid": { + "type": "string", + "example": "站长id" + } + } + }, + "md.MediumQualificationEnterpriseReq": { + "type": "object", + "properties": { + "limit": { + "type": "string" + }, + "name": { + "type": "string" + }, + "page": { + "type": "string" + }, + "state": { + "type": "string" + } + } + }, + "md.MediumQualificationEnterpriseRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.MediumQualificationEnterpriseData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + }, + "type": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + } + } + }, + "md.OtherIncomeReq": { + "type": "object", + "properties": { + "amount": { + "type": "string", + "example": "其他收益" + }, + "id": { + "type": "string", + "example": "列表id" + } + } + }, + "md.QiNiuBucketRegion": { + "type": "object", + "properties": { + "region_domain": { + "type": "string", + "example": "区域域名" + }, + "region_id": { + "type": "string", + "example": "区域id" + }, + "region_name": { + "type": "string", + "example": "区域名称" + } + } + }, + "md.RegisterForAgentReq": { + "type": "object", + "required": [ + "password", + "phone" + ], + "properties": { + "code": { + "type": "string", + "example": "验证码" + }, + "password": { + "type": "string", + "example": "登录密码" + }, + "phone": { + "type": "string", + "example": "登录账号" + } + } + }, + "md.RegisterForMediumReq": { + "type": "object", + "required": [ + "password", + "phone" + ], + "properties": { + "code": { + "type": "string", + "example": "验证码" + }, + "password": { + "type": "string", + "example": "登录密码" + }, + "phone": { + "type": "string", + "example": "登录账号" + } + } + }, + "md.Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "响应码" + }, + "data": { + "description": "内容" + }, + "msg": { + "type": "string", + "example": "具体错误原因" + } + } + }, + "md.RoleBindPermissionGroupReq": { + "type": "object", + "required": [ + "role_id" + ], + "properties": { + "permission_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "role_id": { + "type": "integer" + } + } + }, + "md.SelectData": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "名称" + }, + "value": { + "type": "string", + "example": "值" + } + } + }, + "md.SetLogoReq": { + "type": "object", + "properties": { + "agent_login_logo": { + "type": "string" + }, + "agent_logo": { + "type": "string" + }, + "medium_login_logo": { + "type": "string" + }, + "medium_logo": { + "type": "string" + } + } + }, + "md.SetLogoResp": { + "type": "object", + "properties": { + "data": { + "description": "数据内容", + "allOf": [ + { + "$ref": "#/definitions/md.SetLogoReq" + } + ] + } + } + }, + "md.SetMobReq": { + "type": "object", + "properties": { + "mob_app_key": { + "type": "string" + }, + "mob_app_secret": { + "type": "string" + } + } + }, + "md.SetOssReq": { + "type": "object", + "required": [ + "file_access_key", + "file_bucket", + "file_bucket_host", + "file_bucket_region", + "file_secret_key" + ], + "properties": { + "file_access_key": { + "type": "string", + "example": "对象存储AccessToken" + }, + "file_bucket": { + "type": "string", + "example": "对象存储bucket(空间)" + }, + "file_bucket_host": { + "type": "string", + "example": "对象存储域名" + }, + "file_bucket_region": { + "type": "string", + "example": "文件所属区域" + }, + "file_secret_key": { + "type": "string", + "example": "对象存储SecretToken" + } + } + }, + "md.SetOssResp": { + "type": "object", + "properties": { + "data": { + "description": "数据内容", + "allOf": [ + { + "$ref": "#/definitions/md.SetOssReq" + } + ] + }, + "qi_niu_bucket_region_list": { + "description": "七牛云存储区域列表", + "type": "array", + "items": { + "$ref": "#/definitions/md.QiNiuBucketRegion" + } + } + } + }, + "md.SetSeoReq": { + "type": "object", + "properties": { + "seo_agent_logo": { + "type": "string" + }, + "seo_agent_title": { + "type": "string" + }, + "seo_medium_logo": { + "type": "string" + }, + "seo_medium_title": { + "type": "string" + }, + "seo_platform_logo": { + "type": "string" + }, + "seo_platform_title": { + "type": "string" + } + } + }, + "md.SetSeoResp": { + "type": "object", + "properties": { + "data": { + "description": "数据内容", + "allOf": [ + { + "$ref": "#/definitions/md.SetSeoReq" + } + ] + } + } + }, + "md.SettleCenterDataData": { + "type": "object", + "properties": { + "account": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "settle_type": { + "type": "string" + }, + "update_at": { + "type": "string" + } + } + }, + "md.SettleCenterDataDetailData": { + "type": "object", + "properties": { + "all_income": { + "type": "string", + "example": "总计" + }, + "basic_income": { + "type": "string", + "example": "基础收益" + }, + "business_kind": { + "type": "string", + "example": "业务类型(1:广告合作)" + }, + "other_income": { + "type": "string", + "example": "其他收益" + }, + "pay_state": { + "type": "string", + "example": "结算单支付状态(0:未开始 1:待审核发票 2:发票审核中 3:发票审核拒绝 4:付款中 5:已付款)" + }, + "settle_type": { + "type": "string", + "example": "结算单类型(1:日结 2:周结 3:月结 4:预付)" + }, + "state": { + "type": "string", + "example": "结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订)" + }, + "time_str": { + "type": "string", + "example": "业务时间" + } + } + }, + "md.SettleCenterDataDetailReq": { + "type": "object", + "properties": { + "end_time": { + "type": "string" + }, + "id": { + "type": "string" + }, + "limit": { + "type": "string" + }, + "page": { + "type": "string" + }, + "start_time": { + "type": "string", + "example": "2024-08-29" + } + } + }, + "md.SettleCenterDataDetailRes": { + "type": "object", + "properties": { + "business_kind": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SettleCenterDataDetailData" + } + }, + "settle_pay_state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "settle_state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "settle_type": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.SettleCenterDataReq": { + "type": "object", + "properties": { + "account": { + "type": "string" + }, + "limit": { + "type": "string" + }, + "name": { + "type": "string" + }, + "page": { + "type": "string" + }, + "state": { + "type": "string" + } + } + }, + "md.SettleCenterDataRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SettleCenterDataData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.SettleCenterDataSaveReq": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "settle_type": { + "type": "string" + } + } + }, + "md.SettleFileReq": { + "type": "object", + "properties": { + "file": { + "type": "string", + "example": "七牛云链接 带http" + }, + "id": { + "type": "string", + "example": "列表id" + } + } + }, + "md.ShareIndexResp": { + "type": "object", + "properties": { + "agent_domain": { + "type": "string", + "example": "代理分享地址" + }, + "master_id": { + "type": "string" + }, + "medium_domain": { + "type": "string", + "example": "媒体分享地址" + } + } + }, + "md.UpdateAdminReq": { + "type": "object", + "required": [ + "adm_id", + "password", + "username" + ], + "properties": { + "adm_id": { + "type": "integer" + }, + "memo": { + "type": "string" + }, + "password": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "md.UpdateAdminStateReq": { + "type": "object", + "required": [ + "adm_id", + "state" + ], + "properties": { + "adm_id": { + "type": "integer" + }, + "state": { + "type": "integer" + } + } + }, + "md.UpdateRoleReq": { + "type": "object", + "required": [ + "memo", + "name", + "role_id" + ], + "properties": { + "label": { + "type": "string" + }, + "logo": { + "type": "string" + }, + "memo": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role_id": { + "type": "integer" + }, + "seo_logo": { + "type": "string" + }, + "seo_title": { + "type": "string" + } + } + }, + "md.UpdateRoleStateReq": { + "type": "object", + "required": [ + "role_id", + "state" + ], + "properties": { + "role_id": { + "type": "integer" + }, + "state": { + "type": "integer" + } + } + }, + "md.WxOpenGetResp": { + "type": "object", + "properties": { + "aes_key": { + "type": "string", + "example": "消息加解密Key" + }, + "app_secret": { + "type": "string", + "example": "appSecret" + }, + "appid": { + "type": "string", + "example": "appid" + }, + "token": { + "type": "string", + "example": "消息校验Token" + }, + "wx_open_applet_server_domain": { + "type": "string", + "example": "微信开放平台-小程序服务器域名" + }, + "wx_open_authorization_event_receiving_configuration": { + "type": "string", + "example": "微信开放平台-授权事件接收配置" + }, + "wx_open_domain_of_the_initiating_page_for_login_authorization": { + "type": "string", + "example": "微信开放平台-登录授权的发起页域名" + }, + "wx_open_message_and_event_reception_configuration": { + "type": "string", + "example": "微信开放平台-消息与事件接收配置" + }, + "wx_open_white_list_ip": { + "type": "string", + "example": "微信开放平台-白名单ip" + } + } + }, + "md.WxOpenSetReq": { + "type": "object", + "required": [ + "aes_key", + "app_secret", + "appid", + "token" + ], + "properties": { + "aes_key": { + "type": "string", + "example": "消息加解密Key" + }, + "app_secret": { + "type": "string", + "example": "appSecret" + }, + "appid": { + "type": "string", + "example": "appid" + }, + "token": { + "type": "string", + "example": "消息校验Token" + } + } + } + }, + "securityDefinitions": { + "MasterID": { + "type": "apiKey", + "name": "MasterID", + "in": "header" + } + } +} diff --git a/generate_swagger.sh b/generate_swagger.sh new file mode 100644 index 0000000..38e9ca5 --- /dev/null +++ b/generate_swagger.sh @@ -0,0 +1,127 @@ +#!/bin/bash + +# 生成基础Swagger JSON文件 +swag init --parseDependency --parseInternal --output ./docs + +# 提取带有 "open" 标签的路径 +jq '.paths | with_entries( + select( + (.value.post?.tags? | type == "array" and any(. == "数据中心------嘉俊")) or + (.value.get?.tags? | type == "array" and any(. == "数据中心------嘉俊")) or + (.value.put?.tags? | type == "array" and any(. == "数据中心------嘉俊")) or + (.value.delete?.tags? | type == "array" and any(. == "数据中心------嘉俊")) + ) +) // {} as $filtered_paths | . * { paths: $filtered_paths }' docs/swagger.json > open_paths.json + +# 提取 definitions 和 securityDefinitions +jq '.definitions' docs/swagger.json > definitions.json +jq '.securityDefinitions' docs/swagger.json > securityDefinitions.json + +# 替换 description 中的内容 +jq 'with_entries( + .value |= ( + if .post then + .post.parameters |= map( + if .description == "验证参数Bearer和token空格拼接" then + .description = "秘钥内容" + else + . + end + ) + else + . + end, + if .get then + .get.parameters |= map( + if .description == "验证参数Bearer和token空格拼接" then + .description = "秘钥内容" + else + . + end + ) + else + . + end, + if .put then + .put.parameters |= map( + if .description == "验证参数Bearer和token空格拼接" then + .description = "秘钥内容" + else + . + end + ) + else + . + end, + if .delete then + .delete.parameters |= map( + if .description == "验证参数Bearer和token空格拼接" then + .description = "秘钥内容" + else + . + end + ) + else + . + end + ) +)' open_paths.json > updated_tmp_open_paths.json + +# 将 "name": "Authorization" 替换成 "name": "AppSecret" +jq 'walk(if type == "object" and has("name") and .name == "Authorization" then .name = "AppSecret" else . end)' updated_tmp_open_paths.json > updated_open_paths.json + +# 创建新的 Swagger 配置文件 +cat < temp.json +{ + "swagger": "2.0", + "info": { + "description": "广告联盟接口", + "title": "广告联盟", + "termsOfService": "http://swagger.io/terms/", + "contact": { + "name": "zhiying", + "url": "http://www.swagger.io/support", + "email": "zhiyongos@163.com" + }, + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + }, + "version": "1.0" + }, + "host": "xxxxx.adcms.zhiyingos.cn", + "paths": { + + }, + "definitions": { + + }, + "securityDefinitions": { + + } +} +EOF + +# 合并路径信息到open.json +jq -n ' + input as $paths | + input as $config | + $config | .paths = $paths +' updated_open_paths.json temp.json > temp_1.json +jq -n ' + input as $paths | + input as $config | + $config | .definitions = $paths +' definitions.json temp_1.json > temp_2.json +jq -n ' + input as $paths | + input as $config | + $config | .securityDefinitions = $paths +' securityDefinitions.json temp_2.json > open.json + +# 删除中间生成的文件 +rm -f open_paths.json temp_1.json temp_2.json updated_open_paths.json temp.json definitions.json securityDefinitions.json updated_tmp_open_paths.json + +# 将最终生成的文件移动到docs目录下 +mv open.json docs/open.json +echo "Generated open.json successfully."