From 1e854cb5e9285c9917eb072a2f6537d7aa28db9d Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Mon, 2 Sep 2024 16:01:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/enum/adunit_enum.go | 73 ++ app/hdl/hdl_data_center.go | 248 ++++ app/hdl/hdl_index.go | 84 ++ app/hdl/hdl_settle_center.go | 130 ++ app/md/comm.go | 11 + app/md/md_data_center.go | 102 ++ app/md/md_index.go | 24 + app/md/md_settle_center.go | 124 ++ app/router/router.go | 37 +- app/svc/svc_comm.go | 31 + app/svc/svc_data_center.go | 640 ++++++++++ app/svc/svc_index.go | 183 +++ app/svc/svc_qualification.go | 8 +- app/svc/svc_settle_center.go | 191 +++ app/utils/convert.go | 52 + app/utils/rand.go | 27 +- app/utils/xls.go | 36 + docs/docs.go | 2179 ++++++++++++++++++++++++++++------ docs/swagger.json | 2179 ++++++++++++++++++++++++++++------ docs/swagger.yaml | 1093 ++++++++++++++++- go.mod | 7 +- 21 files changed, 6708 insertions(+), 751 deletions(-) create mode 100644 app/enum/adunit_enum.go create mode 100644 app/hdl/hdl_data_center.go create mode 100644 app/hdl/hdl_index.go create mode 100644 app/hdl/hdl_settle_center.go create mode 100644 app/md/md_data_center.go create mode 100644 app/md/md_index.go create mode 100644 app/md/md_settle_center.go create mode 100644 app/svc/svc_comm.go create mode 100644 app/svc/svc_data_center.go create mode 100644 app/svc/svc_index.go create mode 100644 app/svc/svc_settle_center.go create mode 100644 app/utils/xls.go diff --git a/app/enum/adunit_enum.go b/app/enum/adunit_enum.go new file mode 100644 index 0000000..1e173d9 --- /dev/null +++ b/app/enum/adunit_enum.go @@ -0,0 +1,73 @@ +package enum + +import "applet/app/md" + +type AdunitType string //广告单元类型 +var AdTypeList = []md.SelectData{ + {Name: "banner", Value: AdunitTypeForBanner}, + {Name: "激励视频", Value: AdunitTypeForRewardVideo}, + {Name: "插屏广告", Value: AdunitTypeForInterstitial}, + {Name: "视频广告", Value: AdunitTypeForVideoFeeds}, + //{Name: "视频贴片广告", Value: "5"}, +} + +const ( + AdunitTypeForBanner = "SLOT_ID_WEAPP_BANNER" + AdunitTypeForRewardVideo = "SLOT_ID_WEAPP_REWARD_VIDEO" + AdunitTypeForInterstitial = "SLOT_ID_WEAPP_INTERSTITIAL" + AdunitTypeForVideoFeeds = "SLOT_ID_WEAPP_VIDEO_FEEDS" + AdunitTypeForVideoBegin = "SLOT_ID_WEAPP_VIDEO_BEGIN" +) + +func (gt AdunitType) String() string { + switch gt { + case AdunitTypeForBanner: + return "小程序banner" + case AdunitTypeForRewardVideo: + return "小程序激励视频" + case AdunitTypeForInterstitial: + return "小程序插屏广告" + case AdunitTypeForVideoFeeds: + return "小程序视频广告" + case AdunitTypeForVideoBegin: + return "小程序视频贴片广告" + default: + return "未知" + } +} + +type AdunitStatus string //广告单元开关状态 + +const ( + AdunitStatusForOn = "AD_UNIT_STATUS_ON" + AdunitStatusForOff = "AD_UNIT_STATUS_OFF" +) + +func (gt AdunitStatus) String() string { + switch gt { + case AdunitStatusForOn: + return "开通" + case AdunitStatusForOff: + return "关闭" + default: + return "未知" + } +} + +type SetCoverAdposStatus int32 //广告单元开关状态 + +const ( + SetCoverAdposStatusForOn = 1 + SetCoverAdposStatusForOff = 4 +) + +func (gt SetCoverAdposStatus) String() string { + switch gt { + case SetCoverAdposStatusForOn: + return "开通" + case SetCoverAdposStatusForOff: + return "关闭" + default: + return "未知" + } +} diff --git a/app/hdl/hdl_data_center.go b/app/hdl/hdl_data_center.go new file mode 100644 index 0000000..e54d0c2 --- /dev/null +++ b/app/hdl/hdl_data_center.go @@ -0,0 +1,248 @@ +package hdl + +import ( + "applet/app/e" + "applet/app/lib/validate" + "applet/app/md" + "applet/app/svc" + "github.com/gin-gonic/gin" +) + +// DataCenterRecordTotal +// @Summary 数据明细合计 +// @Tags 数据中心------嘉俊 +// @Description 数据中心-数据明细合计 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.DataCenterTableReq true "请求参数" +// @Success 200 {object} md.DataCenterTotalData "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/dataCenter/record/total [POST] +func DataCenterRecordTotal(c *gin.Context) { + var req md.DataCenterTableReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + if req.StartDate == "" || req.EndDate == "" { + e.OutErr(c, 400, e.NewErr(400, "筛选时间不能为空")) + return + } + res := svc.DataCenterRecordTotal(c, req) + e.OutSuc(c, res, nil) + return +} + +// DataCenterRecordList +// @Summary 数据明细 +// @Tags 数据中心------嘉俊 +// @Description 数据中心-数据明细 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.DataCenterRecordReq true "请求参数" +// @Success 200 {object} md.DataCenterRecordRes "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/dataCenter/record/list [POST] +func DataCenterRecordList(c *gin.Context) { + var req md.DataCenterRecordReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + if req.StartDate == "" || req.EndDate == "" { + e.OutErr(c, 400, e.NewErr(400, "筛选时间不能为空")) + return + } + res := svc.DataCenterRecordList(c, req) + e.OutSuc(c, res, nil) + return +} + +// DataCenterRecordOutPut +// @Summary 数据明细-导出 +// @Tags 数据中心------嘉俊 +// @Description 数据中心-数据明细-导出 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.DataCenterRecordOutPutReq true "请求参数" +// @Success 200 {string} "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/dataCenter/record/output [POST] +func DataCenterRecordOutPut(c *gin.Context) { + var req md.DataCenterRecordOutPutReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + if req.StartDate == "" || req.EndDate == "" { + e.OutErr(c, 400, e.NewErr(400, "筛选时间不能为空")) + return + } + svc.DataCenterRecordOutPut(c, req) + return +} + +// DataCenterCommissionRecordTotal +// @Summary 佣金收益-明细合计 +// @Tags 数据中心------嘉俊 +// @Description 数据中心-佣金收益-明细合计 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.DataCenterTableReq true "请求参数" +// @Success 200 {object} md.DataCenterCommissionTotalData "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/dataCenter/commission/record/total [POST] +func DataCenterCommissionRecordTotal(c *gin.Context) { + var req md.DataCenterTableReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + if req.StartDate == "" || req.EndDate == "" { + e.OutErr(c, 400, e.NewErr(400, "筛选时间不能为空")) + return + } + res := svc.DataCenterCommissionRecordTotal(c, req) + e.OutSuc(c, res, nil) + return +} + +// DataCenterCommissionRecordList +// @Summary 佣金收益-数据明细 +// @Tags 数据中心------嘉俊 +// @Description 数据中心-佣金收益-数据明细 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.DataCenterRecordReq true "请求参数" +// @Success 200 {object} md.DataCenterCommissionRecordRes "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/dataCenter/commission/record/list [POST] +func DataCenterCommissionRecordList(c *gin.Context) { + var req md.DataCenterRecordReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + if req.StartDate == "" || req.EndDate == "" { + e.OutErr(c, 400, e.NewErr(400, "筛选时间不能为空")) + return + } + res := svc.DataCenterCommissionRecordList(c, req) + e.OutSuc(c, res, nil) + return +} + +// DataCenterCommissionRecordOutPut +// @Summary 佣金收益-数据明细-导出 +// @Tags 数据中心------嘉俊 +// @Description 数据中心-佣金收益-数据明细-导出 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.DataCenterRecordOutPutReq true "请求参数" +// @Success 200 {string} "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/dataCenter/commission/record/output [POST] +func DataCenterCommissionRecordOutPut(c *gin.Context) { + var req md.DataCenterRecordOutPutReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + if req.StartDate == "" || req.EndDate == "" { + e.OutErr(c, 400, e.NewErr(400, "筛选时间不能为空")) + return + } + svc.DataCenterCommissionRecordOutPut(c, req) + return +} + +// DataCenterSelectData +// @Summary 筛选条件 +// @Tags 数据中心------嘉俊 +// @Description 数据中心-筛选条件 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Success 200 {string} "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/dataCenter/select/data [GET] +func DataCenterSelectData(c *gin.Context) { + svc.DataCenterSelectData(c) +} + +// DataCenterProfitRecordList +// @Summary 分润收益-数据明细 +// @Tags 数据中心------嘉俊 +// @Description 数据中心-分润收益-数据明细 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.DataCenterProfitRecordReq true "请求参数" +// @Success 200 {object} md.DataCenterProfitRecordRes "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/dataCenter/profit/record/list [POST] +func DataCenterProfitRecordList(c *gin.Context) { + var req md.DataCenterProfitRecordReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + res := svc.DataCenterProfitRecordList(c, req) + e.OutSuc(c, res, nil) + return +} + +// DataCenterProfitRecordOutPut +// @Summary 分润收益-数据明细-导出 +// @Tags 数据中心------嘉俊 +// @Description 数据中心-分润收益-数据明细-导出 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.DataCenterProfitRecordOutPutReq true "请求参数" +// @Success 200 {string} "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/dataCenter/profit/record/output [POST] +func DataCenterProfitRecordOutPut(c *gin.Context) { + var req md.DataCenterProfitRecordOutPutReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + if req.StartDate == "" || req.EndDate == "" { + e.OutErr(c, 400, e.NewErr(400, "筛选时间不能为空")) + return + } + svc.DataCenterProfitRecordOutPut(c, req) + return +} diff --git a/app/hdl/hdl_index.go b/app/hdl/hdl_index.go new file mode 100644 index 0000000..351118a --- /dev/null +++ b/app/hdl/hdl_index.go @@ -0,0 +1,84 @@ +package hdl + +import ( + "applet/app/e" + "applet/app/lib/validate" + "applet/app/md" + "applet/app/svc" + "applet/app/utils" + db "code.fnuoos.com/zhimeng/model.git/src" + "code.fnuoos.com/zhimeng/model.git/src/super/implement" + "github.com/gin-gonic/gin" +) + +// Base +// @Summary 右上角基本数据 +// @Tags 首页------嘉俊 +// @Description 首页-右上角基本数据 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Success 200 {string} "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/index/base [GET] +func Base(c *gin.Context) { + user := svc.GetUser(c) + NewAgentListDb := implement.NewAgentListDb(db.Db) + data, _ := NewAgentListDb.GetAgentList(user.AgentId) + settleType := []string{"", "日结", "周结", "月结", "预付"} + name := user.Username + if data.CompanyName != "" { + name = data.CompanyName + } + if data.CompanyAbbreviation != "" { + name = data.CompanyAbbreviation + } + res := map[string]string{ + "account_id": utils.IntToStr(user.AgentId), + "name": name, + "account": user.Username, + "settle_type": utils.IntToStr(data.SettlementType), + "settle_type_str": settleType[data.SettlementType], + } + e.OutSuc(c, res, nil) + return +} + +// IndexTotal +// @Summary 统计数据 +// @Tags 首页------嘉俊 +// @Description 首页-统计数据 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Success 200 {string} "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/index/total [GET] +func IndexTotal(c *gin.Context) { + svc.IndexTotal(c) +} + +// IndexAppList +// @Summary 数据明细 +// @Tags 数据中心------嘉俊 +// @Description 数据中心-数据明细 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.IndexAppListReq true "请求参数" +// @Success 200 {object} md.IndexAppListRes "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/index/app/list [POST] +func IndexAppList(c *gin.Context) { + var req md.IndexAppListReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + res := svc.IndexAppList(c, req) + e.OutSuc(c, res, nil) + return +} diff --git a/app/hdl/hdl_settle_center.go b/app/hdl/hdl_settle_center.go new file mode 100644 index 0000000..46d5559 --- /dev/null +++ b/app/hdl/hdl_settle_center.go @@ -0,0 +1,130 @@ +package hdl + +import ( + "applet/app/e" + "applet/app/lib/validate" + "applet/app/md" + "applet/app/svc" + "github.com/gin-gonic/gin" +) + +// SettleCenterMediumList +// @Summary 媒体结算报表 +// @Tags 结算中心------嘉俊 +// @Description 结算中心-媒体结算报表 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.SettleCenterDataReq true "请求参数" +// @Success 200 {object} md.SettleCenterMediumDataRes "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/settleCenter/medium/list [POST] +func SettleCenterMediumList(c *gin.Context) { + var req md.SettleCenterDataReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + res := svc.SettleCenterMediumList(c, req) + e.OutSuc(c, res, nil) + return +} + +// SettleCenterList +// @Summary 渠道个人结算报表 +// @Tags 结算中心------嘉俊 +// @Description 结算中心-渠道个人结算报表 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.SettleCenterDataReq true "请求参数" +// @Success 200 {object} md.SettleCenterDataRes "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/settleCenter/agent/list [POST] +func SettleCenterList(c *gin.Context) { + var req md.SettleCenterDataReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + res := svc.SettleCenterList(c, req) + e.OutSuc(c, res, nil) + return +} + +// SettleCenterDetail +// @Summary 渠道个人结算报表-详情 +// @Tags 结算中心------嘉俊 +// @Description 结算中心-渠道个人结算报表-详情 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.CommDetailReq true "请求参数" +// @Success 200 {object} md.SettleCenterDataDetailRes "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/settleCenter/agent/detail [POST] +func SettleCenterDetail(c *gin.Context) { + var req md.CommDetailReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + res := svc.SettleCenterDetail(c, req) + e.OutSuc(c, res, nil) + return +} + +// SettleCenterSettleFileSave +// @Summary 渠道个人详情-结算单保存 +// @Tags 财务中心------嘉俊 +// @Description 财务中心-渠道个人详情-结算单保存 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.SettleFileReq true "请求参数" +// @Success 200 {string} "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/settleCenter/agent/settle/file/save [POST] +func SettleCenterSettleFileSave(c *gin.Context) { + var req md.SettleFileReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + svc.SettleCenterSettleFileSave(c, req) +} + +// SettleCenterInvoiceSave +// @Summary 渠道个人详情-发票上传 +// @Tags 财务中心------嘉俊 +// @Description 财务中心-渠道个人详情-发票上传 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.InvoiceReq true "请求参数" +// @Success 200 {string} "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/settleCenter/agent/invoice/save [POST] +func SettleCenterInvoiceSave(c *gin.Context) { + var req md.InvoiceReq + err := c.ShouldBindJSON(&req) + if err != nil { + err = validate.HandleValidateErr(err) + err1 := err.(e.E) + e.OutErr(c, err1.Code, err1.Error()) + return + } + svc.SettleCenterInvoiceSave(c, req) +} diff --git a/app/md/comm.go b/app/md/comm.go index 4fe5185..f74c68d 100644 --- a/app/md/comm.go +++ b/app/md/comm.go @@ -1,6 +1,17 @@ package md +var AppletPlatform = []SelectData{ + {Name: "微信小程序", Value: "wx_applet"}, +} + +var AppletPlatformMap = map[string]string{ + "wx_applet": "微信小程序", +} + type SelectData struct { Name string `json:"name" example:"名称"` Value string `json:"value" example:"值"` } +type CommDetailReq struct { + Id string `json:"id" example:"列表id"` +} diff --git a/app/md/md_data_center.go b/app/md/md_data_center.go new file mode 100644 index 0000000..3e90a10 --- /dev/null +++ b/app/md/md_data_center.go @@ -0,0 +1,102 @@ +package md + +type DataCenterTableReq struct { + StartDate string `json:"start_date" example:"2024-08-30 默认查昨天的 最近7天"` + EndDate string `json:"end_date" example:"2024-08-30"` + Platform string `json:"platform" example:"平台"` + AppId string `json:"app_id" example:"应用"` + AdType string `json:"ad_type" example:"广告位类型"` +} + +type DataCenterRecordReq struct { + StartDate string `json:"start_date" example:"2024-08-30 默认查昨天的 最近7天"` + EndDate string `json:"end_date" example:"2024-08-30"` + Platform string `json:"platform" example:"平台"` + AppId string `json:"app_id" example:"应用"` + AdType string `json:"ad_type" example:"广告位类型"` + Limit string `json:"limit"` + Page string `json:"page" ` +} +type DataCenterRecordOutPutReq struct { + StartDate string `json:"start_date" example:"2024-08-30 默认查昨天的 最近7天"` + EndDate string `json:"end_date" example:"2024-08-30"` + Platform string `json:"platform" example:"平台"` + AppId string `json:"app_id" example:"应用"` + AdType string `json:"ad_type" example:"广告位类型"` + Limit string `json:"limit" example:"10000 个一页"` + Page string `json:"page" ` +} + +type DataCenterTableRes struct { + List []DataCenterTableData `json:"list" ` +} + +type DataCenterTableData struct { + Date string `json:"date" example:"日期"` + ExposureCount string `json:"exposure_count" example:"曝光量"` + MediaRevenue string `json:"media_revenue" example:"预估收益"` + Ecpm string `json:"ecpm" example:"ecpm"` +} +type DataCenterRecordRes struct { + List []DataCenterTotalData `json:"list" ` + Total int64 `json:"total" ` +} +type DataCenterCommissionRecordRes struct { + List []DataCenterCommissionTotalData `json:"list" ` + Total int64 `json:"total" ` +} +type DataCenterCommissionTotalData struct { + Date string `json:"date" example:"日期"` + AppName string `json:"app_name"` + PlatformName string `json:"platform_name"` + AdvName string `json:"adv_name"` + ExposureCount string `json:"exposure_count" example:"曝光量"` + Commission string `json:"commission" example:"预估佣金"` + OtherCommission string `json:"other_commission" example:"额外奖励"` + AllCommission string `json:"all_commission" example:"预估总佣金"` + Ecpm string `json:"ecpm" example:"ecpm"` + ClickRate string `json:"click_rate" example:"点击率"` + ClickCount string `json:"click_count" example:"点击量"` +} + +type DataCenterTotalData struct { + Date string `json:"date" example:"日期"` + AppName string `json:"app_name"` + PlatformName string `json:"platform_name"` + AdvName string `json:"adv_name"` + ExposureCount string `json:"exposure_count" example:"曝光量"` + MediaRevenue string `json:"media_revenue" example:"预估收益"` + Ecpm string `json:"ecpm" example:"ecpm"` + ClickRate string `json:"click_rate" example:"点击率"` + ClickCount string `json:"click_count" example:"点击量"` +} +type DataCenterProfitRecordReq struct { + StartDate string `json:"start_date" example:"2024-08-30 默认查昨天的 最近7天"` + EndDate string `json:"end_date" example:"2024-08-30"` + Type string `json:"type" example:"0-日收益 1-月收益 2年收益"` + Platform string `json:"platform" example:"平台"` + AppId string `json:"app_id" example:"应用"` + Limit string `json:"limit"` + Page string `json:"page" ` +} +type DataCenterProfitRecordOutPutReq struct { + StartDate string `json:"start_date" example:"2024-08-30 默认查昨天的 最近7天"` + EndDate string `json:"end_date" example:"2024-08-30"` + Type string `json:"type" example:"0-日收益 1-月收益 2年收益"` + Platform string `json:"platform" example:"平台"` + AppId string `json:"app_id" example:"应用"` + Limit string `json:"limit" example:"10000 个一页"` + Page string `json:"page" ` +} +type DataCenterProfitRecordRes struct { + List []DataCenterProfitRecordData `json:"list" ` + Total int64 `json:"total" ` +} +type DataCenterProfitRecordData struct { + Date string `json:"date" example:"日期"` + AppName string `json:"app_name"` + PlatformName string `json:"platform_name"` + Commission string `json:"commission" example:"预估佣金"` + OtherCommission string `json:"other_commission" example:"额外奖励"` + AllCommission string `json:"all_commission" example:"预估总佣金"` +} diff --git a/app/md/md_index.go b/app/md/md_index.go new file mode 100644 index 0000000..b8570b3 --- /dev/null +++ b/app/md/md_index.go @@ -0,0 +1,24 @@ +package md + +type IndexAppListReq struct { + StartDate string `json:"start_date" example:"2024-08-30"` + EndDate string `json:"end_date" example:"2024-08-30"` + Sort string `json:"sort" example:"排序"` +} +type IndexAppListRes struct { + List []IndexAppListData `json:"list" ` + Sort []SelectData `json:"sort"` +} + +type IndexAppListData struct { + Name string `json:"name"` + Logo string `json:"logo"` + List []IndexAppListDataList `json:"list"` + TableList []string `json:"table_list"` +} +type IndexAppListDataList struct { + Name string `json:"name"` + Value string `json:"value"` + Type string `json:"type"` + Bili string `json:"bili"` +} diff --git a/app/md/md_settle_center.go b/app/md/md_settle_center.go new file mode 100644 index 0000000..8b92a5f --- /dev/null +++ b/app/md/md_settle_center.go @@ -0,0 +1,124 @@ +package md + +var AccountSettleState = []SelectData{ + {Name: "日结", Value: "1"}, + {Name: "周结", Value: "2"}, + {Name: "月结", Value: "3"}, + {Name: "预付", Value: "4"}, +} +var BusinessKind = []SelectData{ + {Name: "广告合作", Value: "1"}, +} +var InvoiceCate = []SelectData{ + {Name: "电子发票", Value: "0"}, + {Name: "纸质发票", Value: "1"}, +} +var SettlePayState = []SelectData{ + {Name: "未开始", Value: "0"}, + {Name: "待审核发票", Value: "1"}, + {Name: "发票审核中", Value: "2"}, + {Name: "发票审核拒绝", Value: "3"}, + {Name: "付款中", Value: "4"}, + {Name: "已付款", Value: "5"}, +} +var SettleState = []SelectData{ + {Name: "未开始", Value: "0"}, + {Name: "核算中", Value: "1"}, + {Name: "待签订", Value: "2"}, + {Name: "完成签订", Value: "3"}, +} +var InvoiceState = []SelectData{ + {Name: "待审核", Value: "0"}, + {Name: "审核通过", Value: "1"}, + {Name: "审核拒绝", Value: "2"}, +} + +type SettleCenterDataReq struct { + Limit string `json:"limit"` + Page string `json:"page" ` + StartTime string `json:"start_time" example:"2024-08-29"` + EndTime string `json:"end_time" ` +} +type SettleCenterDataRes struct { + List []SettleCenterDataData `json:"list" ` + Total int64 `json:"total"` + BusinessKind []SelectData `json:"business_kind"` + SettlePayState []SelectData `json:"settle_pay_state"` + SettleState []SelectData `json:"settle_state"` + SettleType []SelectData `json:"settle_type"` +} + +type SettleCenterDataData struct { + Id string `json:"id"` + TimeStr string `json:"time_str" example:"业务时间"` + BusinessKind string `json:"business_kind" example:"业务类型(1:广告合作)"` + SettleType string `json:"settle_type" example:"结算单类型(1:日结 2:周结 3:月结 4:预付)"` + AllIncome string `json:"all_income" example:"合计收益"` + Income string `json:"income" example:"基础收益"` + OtherIncome string `json:"other_income" example:"其他调整"` + PayState string `json:"pay_state" example:"结算单支付状态(0:未开始 1:待审核发票 2:发票审核中 3:发票审核拒绝 4:付款中 5:已付款)"` + State string `json:"state" example:"结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订)"` + Label string `json:"label"` + SettleFile string `json:"settle_file" example:"结算单"` +} +type SettleCenterMediumDataRes struct { + List []SettleCenterMediumDataData `json:"list" ` + Total int64 `json:"total"` + BusinessKind []SelectData `json:"business_kind"` + SettlePayState []SelectData `json:"settle_pay_state"` + SettleState []SelectData `json:"settle_state"` + SettleType []SelectData `json:"settle_type"` +} +type SettleCenterMediumDataData struct { + Id string `json:"id"` + Name string `json:"name" example:"媒体名称"` + TimeStr string `json:"time_str" example:"业务时间"` + BusinessKind string `json:"business_kind" example:"业务类型(1:广告合作)"` + SettleType string `json:"settle_type" example:"结算单类型(1:日结 2:周结 3:月结 4:预付)"` + AllIncome string `json:"all_income" example:"合计收益"` + Income string `json:"income" example:"基础收益"` + OtherIncome string `json:"other_income" example:"其他调整"` + PayState string `json:"pay_state" example:"结算单支付状态(0:未开始 1:待审核发票 2:发票审核中 3:发票审核拒绝 4:付款中 5:已付款)"` + State string `json:"state" example:"结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订)"` + Label string `json:"label"` +} +type SettleCenterDataDetailRes struct { + Data SettleCenterDataDetail `json:"data" ` + BusinessKind []SelectData `json:"business_kind"` + SettlePayState []SelectData `json:"settle_pay_state"` + InvoiceState []SelectData `json:"invoice_state"` + SettleState []SelectData `json:"settle_state"` + SettleType []SelectData `json:"settle_type"` + InvoiceCate []SelectData `json:"invoice_cate"` +} + +type SettleCenterDataDetail struct { + TimeStr string `json:"time_str" example:"业务时间"` + BusinessKind string `json:"business_kind" example:"业务类型(1:广告合作)"` + SettleFile string `json:"settle_file" example:"结算单"` + Invoice Invoice `json:"invoice"` + AllIncome string `json:"all_income" example:"合计收益"` + MediumIncome string `json:"medium_income" example:"媒体结算"` + OtherIncome string `json:"other_income" example:"其他调整"` + PayState string `json:"pay_state" example:"结算单支付状态(0:未开始 1:待审核发票 2:发票审核中 3:发票审核拒绝 4:付款中 5:已付款)"` + State string `json:"state" example:"结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订)"` +} +type Invoice struct { + Type string `json:"type"` + Time string `json:"time"` + Count string `json:"count"` + File []InvoiceFile `json:"file"` +} +type InvoiceFile struct { + Url string `json:"url"` + State string `json:"state" example:"0待确认 1审核通过 2审核失败"` +} +type SettleFileReq struct { + Id string `json:"id" example:"列表id"` + File string `json:"file" example:"七牛云链接 带http"` +} +type InvoiceReq struct { + Id string `json:"id" example:"列表id"` + Type string `json:"type" example:"0电子发票 1纸质发票"` + File []InvoiceFile `json:"file"` +} diff --git a/app/router/router.go b/app/router/router.go index 7e00b05..ef92aee 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -64,10 +64,13 @@ func route(r *gin.RouterGroup) { r.POST("/qiniuyun/upload", hdl.ImgReqUpload) //七牛云上传 r.POST("/sms", hdl.Sms) //短信发送 } - r.Use(mw.Auth) // 以下接口需要JWT验证 - rRole(r.Group("/role")) //权限管理 - rMedium(r.Group("/medium")) //媒体中心 - rAccount(r.Group("/account")) //账号中心 + r.Use(mw.Auth) // 以下接口需要JWT验证 + rRole(r.Group("/role")) //权限管理 + rMedium(r.Group("/medium")) //媒体中心 + rAccount(r.Group("/account")) //账号中心 + rIndex(r.Group("/index")) //首页 + rDataCenter(r.Group("/dataCenter")) //数据中心 + rSettleCenter(r.Group("/settleCenter")) //结算中心 } @@ -99,3 +102,29 @@ func rAccount(r *gin.RouterGroup) { r.POST("/qualification/bank/save", hdl.QualificationBankSave) //资质认证-银行资质保存 r.POST("/qualification/contact/save", hdl.QualificationContactSave) //资质认证-联系方式保存 } +func rIndex(r *gin.RouterGroup) { + r.GET("/base", hdl.Base) //首页-基本信息 + r.GET("/total", hdl.IndexTotal) //首页-统计数据 + r.POST("/app/list", hdl.IndexAppList) //首页-应用数据 +} +func rDataCenter(r *gin.RouterGroup) { + r.GET("/select/data", hdl.DataCenterSelectData) //数据中心-筛选条件 + r.POST("/record/total", hdl.DataCenterRecordTotal) //数据中心-数据明细合计 + r.POST("/record/list", hdl.DataCenterRecordList) //数据中心-数据明细 + r.POST("/record/output", hdl.DataCenterRecordOutPut) //数据中心-数据明细-导出 + + r.POST("/commission/record/total", hdl.DataCenterCommissionRecordTotal) //数据中心-佣金收益明细合计 + r.POST("/commission/record/list", hdl.DataCenterCommissionRecordList) //数据中心-佣金收益明细 + r.POST("/commission/record/output", hdl.DataCenterCommissionRecordOutPut) //数据中心-佣金收益明细-导出 + + r.POST("/profit/record/list", hdl.DataCenterProfitRecordList) //数据中心-分润收益明细 + r.POST("/profit/record/output", hdl.DataCenterProfitRecordOutPut) //数据中心-分润收益明细-导出 + +} +func rSettleCenter(r *gin.RouterGroup) { + r.POST("/medium/list", hdl.SettleCenterMediumList) //结算中心-媒体结算报表 + r.POST("/agent/list", hdl.SettleCenterList) //结算中心-渠道个人结算报表 + r.POST("/agent/detail", hdl.SettleCenterDetail) //结算中心-渠道个人结算报表-详情 + r.POST("/agent/settle/file/save", hdl.SettleCenterSettleFileSave) //结算中心-渠道个人结算报表-结算单上传 + r.POST("/agent/invoice/save", hdl.SettleCenterInvoiceSave) //结算中心-渠道个人结算报表-发票上传 +} diff --git a/app/svc/svc_comm.go b/app/svc/svc_comm.go new file mode 100644 index 0000000..90c60f6 --- /dev/null +++ b/app/svc/svc_comm.go @@ -0,0 +1,31 @@ +package svc + +import ( + implement2 "code.fnuoos.com/zhimeng/model.git/src/implement" + "code.fnuoos.com/zhimeng/model.git/src/super/implement" + "github.com/gin-gonic/gin" +) + +func GetMediumInfo(c *gin.Context, mediumId int) map[string]string { + var res = map[string]string{ + "account": "", + "name": "", + } + NewMediumDb := implement2.NewMediumDb(MasterDb(c)) + NewMediumListDb := implement.NewMediumListDb(MasterDb(c)) + medium := NewMediumDb.GetSuperAdmin(mediumId) + if medium != nil { + res["account"] = medium.Username + res["name"] = medium.Memo + } + NewMediumList, _ := NewMediumListDb.GetMediumList(mediumId) + if NewMediumList != nil { + if NewMediumList.CompanyName != "" { + res["name"] = NewMediumList.CompanyName + } + if NewMediumList.CompanyAbbreviation != "" { + res["name"] = NewMediumList.CompanyAbbreviation + } + } + return res +} diff --git a/app/svc/svc_data_center.go b/app/svc/svc_data_center.go new file mode 100644 index 0000000..844629f --- /dev/null +++ b/app/svc/svc_data_center.go @@ -0,0 +1,640 @@ +package svc + +import ( + "applet/app/e" + "applet/app/enum" + "applet/app/md" + "applet/app/utils" + md2 "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/md" + db "code.fnuoos.com/zhimeng/model.git/src" + "code.fnuoos.com/zhimeng/model.git/src/implement" + model2 "code.fnuoos.com/zhimeng/model.git/src/model" + "fmt" + "github.com/gin-gonic/gin" + "github.com/jinzhu/copier" + "strings" +) + +func DataCenterRecordTotal(c *gin.Context, req md.DataCenterTableReq) md.DataCenterTotalData { + appId := GetAppletId(c, req.AppId, req.Platform) + sql := ` + SELECT + SUM(exposure_count) as exposure_count, + SUM(click_count) as click_count, + SUM(click_count)/SUM(exposure_count)*100 as click_rate, + SUM(ecpm) as ecpm, + SUM(media_revenue) as media_revenue + FROM generate_wx_ad_data + where %s +` + mediumId := GetAgentMediumId(c) + where := "uuid=" + c.GetString("mid") + " and medium_id in(" + mediumId + ")" + if req.AppId != "" || req.Platform != "" { + where += " and app_id in(" + appId + ")" + } + if req.AdType != "" { + where += " and ad_slot='" + req.AdType + "'" + } + if req.StartDate != "" { + where += " and date>='" + req.StartDate + "'" + } + if req.EndDate != "" { + where += " and date<='" + req.EndDate + "'" + } + sql = fmt.Sprintf(sql, where) + nativeString, _ := db.QueryNativeString(db.Db, sql) + res := md.DataCenterTotalData{} + for _, v := range nativeString { + res = md.DataCenterTotalData{ + Date: "-", + AppName: "-", + PlatformName: "-", + AdvName: "-", + ExposureCount: v["exposure_count"], + MediaRevenue: utils.Float64ToStr(utils.StrToFloat64(v["media_revenue"]) / 100), + Ecpm: utils.Float64ToStr(utils.StrToFloat64(v["ecpm"]) / 100), + ClickRate: utils.GetPrec(v["click_rate"], "2") + "%", + ClickCount: v["click_count"], + } + } + return res +} +func DataCenterRecordList(c *gin.Context, req md.DataCenterRecordReq) md.DataCenterRecordRes { + nativeString, total := comm(c, 1, req) + list := make([]md.DataCenterTotalData, 0) + for _, v := range nativeString { + NewAppletApplicationDb := implement.NewAppletApplicationDb(MasterDb(c)) + app, _ := NewAppletApplicationDb.GetAppletApplicationListByAppid(v["app_id"]) + platform := "" + name := "" + if app != nil { + name = app.Name + platform = app.Platform + } + NewAppletApplicationAdSpaceListDb := implement.NewAppletApplicationAdSpaceListDb(MasterDb(c)) + adData, _ := NewAppletApplicationAdSpaceListDb.GetAppletApplicationAdSpaceListByAdId(v["slot_id"]) + adName := enum.AdunitType(v["ad_slot"]).String() + if adData != nil { + adName = adData.Name + } + tmp := md.DataCenterTotalData{ + Date: v["date"], + AppName: name, + PlatformName: md.AppletPlatformMap[platform], + AdvName: adName, + ExposureCount: v["exposure_count"], + MediaRevenue: utils.Float64ToStr(utils.StrToFloat64(v["media_revenue"]) / 100), + Ecpm: utils.Float64ToStr(utils.StrToFloat64(v["ecpm"]) / 100), + ClickRate: v["click_rate"] + "%", + ClickCount: v["click_count"], + } + list = append(list, tmp) + } + res := md.DataCenterRecordRes{ + List: list, + Total: total, + } + return res +} +func DataCenterRecordOutPut(c *gin.Context, req md.DataCenterRecordOutPutReq) { + var req1 md.DataCenterRecordReq + copier.Copy(&req1, &req) + req.Limit = "10000" + nativeString, _ := comm(c, 0, req1) + appId := make([]string, 0) + adId := make([]string, 0) + for _, v := range nativeString { + appId = append(appId, v["app_id"]) + adId = append(adId, v["slot_id"]) + } + var app []model2.AppletApplication + appMap := make(map[string]model2.AppletApplication) + MasterDb(c).In("app_id=?", appId).Find(&app) + for _, v := range app { + appMap[v.AppId] = v + } + var ad []model2.AppletApplicationAdSpaceList + adMap := make(map[string]model2.AppletApplicationAdSpaceList) + MasterDb(c).In("ad_id=?", adId).Find(&adMap) + for _, v := range ad { + adMap[v.AdId] = v + } + name := req.StartDate + "~" + req.EndDate + "(第" + req.Page + "页 " + utils.IntToStr(len(nativeString)) + "条)" + //写入数据 + data := map[string]string{ + "A1": "日期", + "B1": "应用名称", + "C1": "平台类型", + "D1": "广告位", + "E1": "曝光量", + "F1": "点击量", + "G1": "ECPM", + "H1": "预估收益", + } + for k, v := range nativeString { + i := utils.IntToStr(k + 2) + data["A"+i] = v["date"] + data["B"+i] = appMap[v["app_id"]].Name + data["C"+i] = md.AppletPlatformMap[appMap[v["app_id"]].Platform] + data["D"+i] = adMap[v["slot_id"]].Name + data["E"+i] = v["exposure_count"] + data["F"+i] = v["click_count"] + data["G"+i] = utils.Float64ToStr(utils.StrToFloat64(v["ecpm"]) / 100) + data["H"+i] = utils.Float64ToStr(utils.StrToFloat64(v["media_revenue"]) / 100) + } + + file := utils.Output(c, name, data) + filename := name + ".xlsx" + r := map[string]string{ + "file": file, + "filename": filename, + } + e.OutSuc(c, r, nil) + return +} +func DataCenterCommissionRecordTotal(c *gin.Context, req md.DataCenterTableReq) md.DataCenterCommissionTotalData { + appId := GetAppletId(c, req.AppId, req.Platform) + sql := ` + SELECT + SUM(exposure_count) as exposure_count, + SUM(click_count) as click_count, + SUM(click_count)/SUM(exposure_count)*100 as click_rate, + SUM(ecpm) as ecpm, + SUM(media_revenue) as media_revenue + FROM generate_wx_ad_data + where %s +` + mediumId := GetAgentMediumId(c) + where := "uuid=" + c.GetString("mid") + if req.AppId != "" || req.Platform != "" { + where += " and app_id in(" + appId + ")" + } + if req.AdType != "" { + where += " and ad_slot='" + req.AdType + "'" + } + if req.StartDate != "" { + where += " and date>='" + req.StartDate + "'" + } + if req.EndDate != "" { + where += " and date<='" + req.EndDate + "'" + } + whereMedium := where + " and medium_id in(" + mediumId + ")" + sql = fmt.Sprintf(sql, whereMedium) + nativeString, _ := db.QueryNativeString(db.Db, sql) + res := md.DataCenterCommissionTotalData{} + for _, v := range nativeString { + res = md.DataCenterCommissionTotalData{ + Date: "-", + AppName: "-", + PlatformName: "-", + AdvName: "-", + ExposureCount: v["exposure_count"], + Ecpm: utils.Float64ToStr(utils.StrToFloat64(v["ecpm"]) / 100), + ClickRate: utils.GetPrec(v["click_rate"], "2") + "%", + ClickCount: v["click_count"], + AllCommission: "0", + OtherCommission: "0", + Commission: "0", + } + } + sqlAgent := ` + SELECT + SUM(agent_revenue) as agent_revenue, + SUM(extra_revenue) as extra_revenue + FROM generate_wx_ad_data_with_agent_flow + where %s +` + user := GetUser(c) + whereAgent := where + " and agent_id=" + utils.IntToStr(user.AgentId) + sqlAgent = fmt.Sprintf(sqlAgent, whereAgent) + nativeStringAgent, _ := db.QueryNativeString(db.Db, sqlAgent) + for _, v := range nativeStringAgent { + res.Commission = utils.Float64ToStr(utils.StrToFloat64(v["agent_revenue"]) / 100) + res.OtherCommission = utils.Float64ToStr(utils.StrToFloat64(v["extra_revenue"]) / 100) + res.AllCommission = utils.Float64ToStr(utils.StrToFloat64(res.Commission) + utils.StrToFloat64(res.OtherCommission)) + } + return res +} +func DataCenterCommissionRecordList(c *gin.Context, req md.DataCenterRecordReq) md.DataCenterCommissionRecordRes { + nativeString, total := commAgent(c, 1, req) + list := make([]md.DataCenterCommissionTotalData, 0) + + for _, v := range nativeString { + NewAppletApplicationDb := implement.NewAppletApplicationDb(MasterDb(c)) + app, _ := NewAppletApplicationDb.GetAppletApplicationListByAppid(v["app_id"]) + platform := "" + name := "" + if app != nil { + name = app.Name + platform = app.Platform + } + NewAppletApplicationAdSpaceListDb := implement.NewAppletApplicationAdSpaceListDb(MasterDb(c)) + adData, _ := NewAppletApplicationAdSpaceListDb.GetAppletApplicationAdSpaceListByAdId(v["slot_id"]) + adName := enum.AdunitType(v["ad_slot"]).String() + if adData != nil { + adName = adData.Name + } + tmp := md.DataCenterCommissionTotalData{ + Date: v["date"], + AppName: name, + PlatformName: md.AppletPlatformMap[platform], + AdvName: adName, + ExposureCount: v["exposure_count"], + Ecpm: utils.Float64ToStr(utils.StrToFloat64(v["ecpm"]) / 100), + ClickRate: v["click_rate"] + "%", + ClickCount: v["click_count"], + AllCommission: v["all_commission"], + OtherCommission: v["other_commission"], + Commission: v["commission"], + } + list = append(list, tmp) + } + res := md.DataCenterCommissionRecordRes{ + List: list, + Total: total, + } + return res +} +func DataCenterCommissionRecordOutPut(c *gin.Context, req md.DataCenterRecordOutPutReq) { + var req1 md.DataCenterRecordReq + copier.Copy(&req1, &req) + req.Limit = "10000" + nativeString, _ := commAgent(c, 0, req1) + appId := make([]string, 0) + adId := make([]string, 0) + for _, v := range nativeString { + appId = append(appId, v["app_id"]) + adId = append(adId, v["slot_id"]) + } + var app []model2.AppletApplication + appMap := make(map[string]model2.AppletApplication) + MasterDb(c).In("app_id=?", appId).Find(&app) + for _, v := range app { + appMap[v.AppId] = v + } + var ad []model2.AppletApplicationAdSpaceList + adMap := make(map[string]model2.AppletApplicationAdSpaceList) + MasterDb(c).In("ad_id=?", adId).Find(&adMap) + for _, v := range ad { + adMap[v.AdId] = v + } + name := req.StartDate + "~" + req.EndDate + "(第" + req.Page + "页 " + utils.IntToStr(len(nativeString)) + "条)" + //写入数据 + data := map[string]string{ + "A1": "日期", + "B1": "应用名称", + "C1": "平台类型", + "D1": "广告位", + "E1": "曝光量", + "F1": "点击量", + "G1": "ECPM", + "H1": "预估佣金", + "I1": "额外奖励", + "J1": "预估总收益", + } + for k, v := range nativeString { + i := utils.IntToStr(k + 2) + data["A"+i] = v["date"] + data["B"+i] = appMap[v["app_id"]].Name + data["C"+i] = md.AppletPlatformMap[appMap[v["app_id"]].Platform] + data["D"+i] = adMap[v["slot_id"]].Name + data["E"+i] = v["exposure_count"] + data["F"+i] = v["click_count"] + data["G"+i] = utils.Float64ToStr(utils.StrToFloat64(v["ecpm"]) / 100) + data["H"+i] = v["commission"] + data["I"+i] = v["other_commission"] + data["J"+i] = v["all_commission"] + } + + file := utils.Output(c, name, data) + filename := name + ".xlsx" + r := map[string]string{ + "file": file, + "filename": filename, + } + e.OutSuc(c, r, nil) + return +} +func DataCenterProfitRecordOutPut(c *gin.Context, req md.DataCenterProfitRecordOutPutReq) { + var req1 md.DataCenterProfitRecordReq + copier.Copy(&req1, &req) + req.Limit = "10000" + nativeString, _ := commAgentProfit(c, 0, req1) + appId := make([]string, 0) + for _, v := range nativeString { + appId = append(appId, v["app_id"]) + } + var app []model2.AppletApplication + appMap := make(map[string]model2.AppletApplication) + MasterDb(c).In("app_id=?", appId).Find(&app) + for _, v := range app { + appMap[v.AppId] = v + } + + name := req.StartDate + "~" + req.EndDate + "(第" + req.Page + "页 " + utils.IntToStr(len(nativeString)) + "条)" + //写入数据 + data := map[string]string{ + "A1": "日期", + "B1": "应用名称", + "C1": "平台类型", + "D1": "预估佣金", + "E1": "额外奖励", + "F1": "预估总收益", + } + for k, v := range nativeString { + i := utils.IntToStr(k + 2) + data["A"+i] = v["date"] + data["B"+i] = appMap[v["app_id"]].Name + data["C"+i] = md.AppletPlatformMap[appMap[v["app_id"]].Platform] + data["D"+i] = v["commission"] + data["E"+i] = v["other_commission"] + data["F"+i] = v["all_commission"] + } + + file := utils.Output(c, name, data) + filename := name + ".xlsx" + r := map[string]string{ + "file": file, + "filename": filename, + } + e.OutSuc(c, r, nil) + return +} +func DataCenterProfitRecordList(c *gin.Context, req md.DataCenterProfitRecordReq) md.DataCenterProfitRecordRes { + data, total := commAgentProfit(c, 1, req) + list := make([]md.DataCenterProfitRecordData, 0) + for _, v := range data { + NewAppletApplicationDb := implement.NewAppletApplicationDb(MasterDb(c)) + app, _ := NewAppletApplicationDb.GetAppletApplicationListByAppid(v["app_id"]) + platform := "" + name := "" + if app != nil { + name = app.Name + platform = app.Platform + } + tmp := md.DataCenterProfitRecordData{ + Date: v["date"], + AppName: name, + PlatformName: md2.PlatformMap[platform], + Commission: utils.Float64ToStr(utils.StrToFloat64(v["agent_revenue"]) / 100), + OtherCommission: utils.Float64ToStr(utils.StrToFloat64(v["extra_revenue"]) / 100), + } + tmp.AllCommission = utils.Float64ToStr(utils.StrToFloat64(tmp.Commission) + utils.StrToFloat64(tmp.OtherCommission)) + list = append(list, tmp) + } + res := md.DataCenterProfitRecordRes{ + List: list, + Total: total, + } + return res +} + +func comm(c *gin.Context, isTotal int, req md.DataCenterRecordReq) ([]map[string]string, int64) { + appId := GetAppletId(c, req.AppId, req.Platform) + sql := ` + SELECT + %s + FROM generate_wx_ad_data + where %s %s +` + mediumId := GetAgentMediumId(c) + where := "uuid=" + c.GetString("mid") + " and medium_id in(" + mediumId + ")" + if req.AppId != "" || req.Platform != "" { + where += " and app_id in(" + appId + ")" + } + if req.AdType != "" { + where += " and ad_slot='" + req.AdType + "'" + } + if req.StartDate != "" { + where += " and date>='" + req.StartDate + "'" + } + if req.EndDate != "" { + where += " and date<='" + req.EndDate + "'" + } + field := `*` + start := (utils.StrToInt(req.Page) - 1) * utils.StrToInt(req.Limit) + groupBy := " order by date desc,id desc" + if req.Page != "" { + groupBy += " limit " + utils.IntToStr(start) + "," + req.Limit + } else { + groupBy = " order by date asc,id asc" + } + + sql1 := fmt.Sprintf(sql, field, where, groupBy) + nativeString, _ := db.QueryNativeString(db.Db, sql1) + + var total int64 = 0 + if isTotal == 1 { + sqlTotal := fmt.Sprintf(sql, "COUNT(*) as count ", where, "") + nativeStringTotal, _ := db.QueryNativeString(db.Db, sqlTotal) + for _, v := range nativeStringTotal { + total = utils.StrToInt64(v["count"]) + } + } + return nativeString, total +} +func commAgentProfit(c *gin.Context, isTotal int, req md.DataCenterProfitRecordReq) ([]map[string]string, int64) { + appId := GetAppletId(c, req.AppId, req.Platform) + sql := ` + SELECT + %s + FROM generate_wx_ad_data_with_agent_flow + where %s %s +` + user := GetUser(c) + where := "uuid=" + c.GetString("mid") + " and agent_id =" + utils.IntToStr(user.AgentId) + if req.AppId != "" || req.Platform != "" { + where += " and app_id in(" + appId + ")" + } + if req.StartDate != "" { + where += " and date>='" + req.StartDate + "'" + } + if req.EndDate != "" { + where += " and date<='" + req.EndDate + "'" + } + field := `%s,app_id,SUM(agent_revenue) as agent_revenue,SUM(extra_revenue) as extra_revenue` + start := (utils.StrToInt(req.Page) - 1) * utils.StrToInt(req.Limit) + groupBy := " group by %s,app_id order by date desc,id desc" + if req.Page != "" { + groupBy += " limit " + utils.IntToStr(start) + "," + req.Limit + } else { + groupBy = " group by %s,app_id order by date asc,id asc" + } + timeStr := "date" + if req.Type == "1" { + timeStr = "DATE_FORMAT(date, '%Y-%m')" + } + if req.Type == "2" { + timeStr = "DATE_FORMAT(date, '%Y')" + } + field = fmt.Sprintf(field, timeStr) + groupBy = fmt.Sprintf(groupBy, timeStr+" as date") + + sql1 := fmt.Sprintf(sql, field, where, groupBy) + nativeString, _ := db.QueryNativeString(db.Db, sql1) + var total int64 = 0 + if isTotal == 1 { + sqlTotal := fmt.Sprintf(sql, field, where, "") + sqlTotal1 := `select COUNT(*) as count from (%s) as tmp` + sqlTotal1 = fmt.Sprintf(sqlTotal1, sqlTotal) + nativeStringTotal, _ := db.QueryNativeString(db.Db, sqlTotal1) + for _, v := range nativeStringTotal { + total = utils.StrToInt64(v["count"]) + } + } + return nativeString, total +} + +func commAgent(c *gin.Context, isTotal int, req md.DataCenterRecordReq) ([]map[string]string, int64) { + appId := GetAppletId(c, req.AppId, req.Platform) + sql := ` + SELECT + %s + FROM generate_wx_ad_data + where %s %s +` + mediumId := GetAgentMediumId(c) + where := "uuid=" + c.GetString("mid") + " and medium_id in(" + mediumId + ")" + if req.AppId != "" || req.Platform != "" { + where += " and app_id in(" + appId + ")" + } + if req.AdType != "" { + where += " and ad_slot='" + req.AdType + "'" + } + if req.StartDate != "" { + where += " and date>='" + req.StartDate + "'" + } + if req.EndDate != "" { + where += " and date<='" + req.EndDate + "'" + } + field := `*` + start := (utils.StrToInt(req.Page) - 1) * utils.StrToInt(req.Limit) + groupBy := " order by date desc,id desc" + if req.Page != "" { + groupBy += " limit " + utils.IntToStr(start) + "," + req.Limit + } else { + groupBy = " order by date asc,id asc" + } + + sql1 := fmt.Sprintf(sql, field, where, groupBy) + nativeString, _ := db.QueryNativeString(db.Db, sql1) + + var total int64 = 0 + if isTotal == 1 { + sqlTotal := fmt.Sprintf(sql, "COUNT(*) as count ", where, "") + nativeStringTotal, _ := db.QueryNativeString(db.Db, sqlTotal) + for _, v := range nativeStringTotal { + total = utils.StrToInt64(v["count"]) + } + } + var ids []string + for _, v := range nativeString { + ids = append(ids, v["id"]) + } + if len(ids) > 0 { + sqlAgent := ` + SELECT + SUM(agent_revenue) as agent_revenue, + SUM(extra_revenue) as extra_revenue + FROM generate_wx_ad_data_with_agent_flow + where %s +` + user := GetUser(c) + whereAgent := "original_data_id in(" + strings.Join(ids, ",") + ") and agent_id=" + utils.IntToStr(user.AgentId) + sqlAgent = fmt.Sprintf(sqlAgent, whereAgent) + nativeStringAgent, _ := db.QueryNativeString(db.Db, sqlAgent) + agentMap := make(map[string]map[string]string) + for _, v := range nativeStringAgent { + _, ok := agentMap[v["uid"]] + if ok == false { + agentMap[v["uid"]] = make(map[string]string) + } + agentMap[v["uid"]] = v + } + for k, v := range nativeString { + _, ok := agentMap[v["uid"]] + if ok { + nativeString[k]["commission"] = utils.Float64ToStr(utils.StrToFloat64(v["agent_revenue"]) / 100) + nativeString[k]["other_commission"] = utils.Float64ToStr(utils.StrToFloat64(v["extra_revenue"]) / 100) + nativeString[k]["all_commission"] = utils.Float64ToStr(utils.StrToFloat64(nativeString[k]["commission"]) + utils.StrToFloat64(nativeString[k]["other_commission"])) + } else { + nativeString[k]["commission"] = "0" + nativeString[k]["other_commission"] = "0" + nativeString[k]["all_commission"] = "0" + } + } + } + return nativeString, total +} +func DataCenterSelectData(c *gin.Context) { + NewAppletApplicationDb := implement.NewAppletApplicationDb(MasterDb(c)) + appList, _ := NewAppletApplicationDb.FindAllAppletApplicationList() + appMap := make(map[string][]map[string]interface{}) + mediumId := GetAgentMediumId(c) + for _, v := range appList { + if strings.Contains(","+mediumId+",", ","+utils.IntToStr(v.MediumId)+",") == false { + continue + } + _, ok := appMap[v.Platform] + if ok == false { + appMap[v.Platform] = make([]map[string]interface{}, 0) + } + tmp := map[string]interface{}{ + "name": v.Name, + "app_id": v.AppId, + "ad_type": enum.AdTypeList, + } + appMap[v.Platform] = append(appMap[v.Platform], tmp) + } + platform := []map[string]interface{}{ + { + "name": "微信小程序", + "platform": "wx_applet", + "app_list": appMap["wx_applet"], + }, + } + e.OutSuc(c, platform, nil) + return +} + +// 应用 +func GetAppletId(c *gin.Context, appId, platform string) string { + mediumId := "" + sess := MasterDb(c).Where("1=1") + var ids = make([]string, 0) + if appId != "" || platform != "" { + ids = append(ids, "-1") + } + if platform != "" { + var tmp []model2.AppletApplication + if platform != "" { + sess.And("platform = ? ", platform) + } + sess.Find(&tmp) + for _, v := range tmp { + ids = append(ids, utils.IntToStr(v.MediumId)) + } + } + if appId != "" { + ids = []string{appId} + } + if appId != "" || platform != "" { + mediumId = strings.Join(ids, ",") + } + return mediumId +} +func GetAppletInfo(c *gin.Context, id string) map[string]string { + var res = map[string]string{ + "platform": "", + "name": "", + "logo": "", + } + NewAppletApplicationDb := implement.NewAppletApplicationDb(MasterDb(c)) + data, _ := NewAppletApplicationDb.GetAppletApplicationListByAppid(id) + if data != nil { + res["platform"] = data.Platform + res["name"] = data.Name + res["logo"] = data.Logo + } + return res +} diff --git a/app/svc/svc_index.go b/app/svc/svc_index.go new file mode 100644 index 0000000..e4cbfb6 --- /dev/null +++ b/app/svc/svc_index.go @@ -0,0 +1,183 @@ +package svc + +import ( + "applet/app/e" + "applet/app/md" + "applet/app/utils" + db "code.fnuoos.com/zhimeng/model.git/src" + "code.fnuoos.com/zhimeng/model.git/src/super/implement" + "fmt" + "github.com/gin-gonic/gin" + "strings" + "time" +) + +func IndexTotal(c *gin.Context) { + //昨天 + yesterday := utils.GetTimeRange("yesterday") + yesterdayTotal := commTotal(c, time.Unix(yesterday["start"], 0).Format("2006-01-02"), time.Unix(yesterday["end"]-3600, 0).Format("2006-01-02")) + //前天 + beforeYesterDayTotal := commTotal(c, time.Unix(yesterday["start"]-86400, 0).Format("2006-01-02"), time.Unix(yesterday["start"]-3600, 0).Format("2006-01-02")) + //7天 + withinSevenDays := utils.GetTimeRange("new_within_seven_days") + withinSevenDaysTotal := commTotal(c, time.Unix(withinSevenDays["start"], 0).Format("2006-01-02"), time.Unix(withinSevenDays["end"]-3600, 0).Format("2006-01-02")) + //7天前的 7天 + beforeWithinSevenDaysTotal := commTotal(c, time.Unix(withinSevenDays["start"]-3600-7*86400, 0).Format("2006-01-02"), time.Unix(withinSevenDays["start"]-3600, 0).Format("2006-01-02")) + //本月 + currentMonth := utils.GetTimeRange("current_month") + currentMonthTotal := commTotal(c, time.Unix(currentMonth["start"], 0).Format("2006-01-02"), time.Unix(currentMonth["end"]-3600, 0).Format("2006-01-02")) + //上月 + lastMonth := utils.GetTimeRange("last_month") + lastMonthTotal := commTotal(c, time.Unix(lastMonth["start"], 0).Format("2006-01-02"), time.Unix(lastMonth["end"]-3600, 0).Format("2006-01-02")) + //上上月 + beforeLastMonth := time.Unix(lastMonth["start"]-86400, 0) + beforeLastMonthStr := time.Date(beforeLastMonth.Year(), beforeLastMonth.Month(), 1, 0, 0, 0, 0, beforeLastMonth.Location()) + beforeLastMonthTotal := commTotal(c, beforeLastMonthStr.Format("2006-01-02"), time.Unix(lastMonth["start"]-3600, 0).Format("2006-01-02")) + res := []md.IndexAppListDataList{ + {Name: "昨日收益(媒体)", Type: "yesterday", Bili: commBili(c, beforeYesterDayTotal, yesterdayTotal, "media_revenue"), Value: utils.Float64ToStr(utils.StrToFloat64(yesterdayTotal[0]["media_revenue"]) / 100)}, + {Name: "七日收益(媒体)", Type: "within_seven_days", Bili: commBili(c, beforeWithinSevenDaysTotal, withinSevenDaysTotal, "media_revenue"), Value: utils.Float64ToStr(utils.StrToFloat64(withinSevenDaysTotal[0]["media_revenue"]) / 100)}, + {Name: "本月收益(媒体)", Type: "current_month", Bili: commBili(c, lastMonthTotal, currentMonthTotal, "media_revenue"), Value: utils.Float64ToStr(utils.StrToFloat64(currentMonthTotal[0]["media_revenue"]) / 100)}, + {Name: "上月收益(媒体)", Type: "last_month", Bili: commBili(c, beforeLastMonthTotal, lastMonthTotal, "media_revenue"), Value: utils.Float64ToStr(utils.StrToFloat64(lastMonthTotal[0]["media_revenue"]) / 100)}, + {Name: "昨日收益(曝光量)", Type: "yesterday", Bili: commBili(c, beforeYesterDayTotal, yesterdayTotal, "exposure_count"), Value: yesterdayTotal[0]["exposure_count"]}, + {Name: "七日收益(曝光量)", Type: "within_seven_days", Bili: commBili(c, beforeWithinSevenDaysTotal, withinSevenDaysTotal, "exposure_count"), Value: withinSevenDaysTotal[0]["exposure_count"]}, + {Name: "本月收益(曝光量)", Type: "current_month", Bili: commBili(c, lastMonthTotal, currentMonthTotal, "exposure_count"), Value: currentMonthTotal[0]["exposure_count"]}, + {Name: "上月收益(曝光量)", Type: "last_month", Bili: commBili(c, beforeLastMonthTotal, lastMonthTotal, "exposure_count"), Value: lastMonthTotal[0]["exposure_count"]}, + } + e.OutSuc(c, res, nil) + return +} +func commBili(c *gin.Context, before, after []map[string]string, types string) string { + bili := "-%" + if utils.StrToFloat64(before[0][types]) > 0 { + tmpDiff := utils.StrToFloat64(after[0][types]) - utils.StrToFloat64(before[0][types]) + types1 := "+" + if tmpDiff < 0 { + types1 = "" + } + bili = types1 + utils.Float64ToStr(tmpDiff/utils.StrToFloat64(before[0][types])*100) + "%" + } + return bili +} +func IndexAppList(c *gin.Context, req md.IndexAppListReq) md.IndexAppListRes { + appId := make([]string, 0) + data := commTotalByApp(c, req, appId) + for _, v := range data { + appId = append(appId, v["app_id"]) + } + start := utils.TimeStdParseUnix(req.StartDate + " 00:00:00") + day := (utils.TimeStdParseUnix(req.EndDate+" 00:00:00") - start) / 86400 + req.EndDate = time.Unix(start-1, 0).Format("2006-01-02") + req.StartDate = time.Unix(start-1-day*86400, 0).Format("2006-01-02") + dataLast := commTotalByApp(c, req, appId) + dataLastMap := make(map[string][]map[string]string) + for _, v := range dataLast { + dataLastMap[v["app_id"]] = make([]map[string]string, 0) + dataLastMap[v["app_id"]] = append(dataLastMap[v["app_id"]], v) + } + list := make([]md.IndexAppListData, 0) + for _, v := range data { + _, ok := dataLastMap[v["app_id"]] + if ok == false { + dataLastMap[v["app_id"]] = []map[string]string{ + {"media_revenue": "0", "ecpm": "0", "exposure_count": "0", "click_count": "0", "click_rate": "0"}, + } + } + tmpList := []map[string]string{ + v, + } + dataList := []md.IndexAppListDataList{ + {Name: "广告预估收益", Type: "media_revenue", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "media_revenue"), Value: utils.Float64ToStr(utils.StrToFloat64(v["media_revenue"]) / 100)}, + {Name: "ECPM", Type: "ecpm", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "ecpm"), Value: v["ecpm"]}, + {Name: "曝光量", Type: "exposure_count", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "exposure_count"), Value: v["exposure_count"]}, + {Name: "点击量", Type: "click_count", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "click_count"), Value: v["click_count"]}, + {Name: "点击率", Type: "click_rate", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "click_rate"), Value: utils.GetPrec(v["click_rate"], "2") + "%"}, + } + applet := GetAppletInfo(c, v["app_id"]) + tmp := md.IndexAppListData{ + Name: applet["name"], + Logo: applet["logo"], + List: dataList, + TableList: []string{}, + } + list = append(list, tmp) + } + res := md.IndexAppListRes{ + List: list, + Sort: []md.SelectData{ + {Name: "按收益最高", Value: "media_revenue desc"}, + {Name: "按ECPM最高", Value: "ecpm desc"}, + {Name: "按曝光量最高", Value: "exposure_count desc"}, + }, + } + return res +} +func GetAgentMediumId(c *gin.Context) string { + user := GetUser(c) + NewAgentWithMediumDb := implement.NewAgentWithMediumDb(db.Db) + agent, _ := NewAgentWithMediumDb.FindAgentWithMediumListByAgentIdAll(user.AgentId) + mediumId := []string{"-1"} + for _, v := range agent { + mediumId = append(mediumId, utils.IntToStr(v.MediumId)) + } + return strings.Join(mediumId, ",") +} +func commTotal(c *gin.Context, startDate, endDate string) []map[string]string { + sql := ` + SELECT + SUM(exposure_count) as exposure_count, + SUM(click_count) as click_count, + SUM(click_rate) as click_rate, + SUM(ecpm) as ecpm, + SUM(media_revenue) as media_revenue + FROM generate_wx_ad_data + where %s +` + mediumId := GetAgentMediumId(c) + where := "uuid=" + c.GetString("mid") + " and medium_id in(" + mediumId + ")" + if startDate != "" { + where += " and date>='" + startDate + "'" + } + if endDate != "" { + where += " and date<='" + endDate + "'" + } + sql = fmt.Sprintf(sql, where) + nativeString, _ := db.QueryNativeString(db.Db, sql) + if len(nativeString) == 0 { + nativeString = []map[string]string{ + { + "media_revenue": "0", + }, + } + } + return nativeString +} +func commTotalByApp(c *gin.Context, req md.IndexAppListReq, appId []string) []map[string]string { + sql := ` + SELECT + app_id as app_id, + SUM(exposure_count) as exposure_count, + SUM(click_count) as click_count, + SUM(click_count)/SUM(exposure_count)*100 as click_rate, + SUM(ecpm) as ecpm, + SUM(media_revenue) as media_revenue + FROM generate_wx_ad_data + where %s group by app_id order by %s,id asc limit 20 +` + mediumId := GetAgentMediumId(c) + where := "uuid=" + c.GetString("mid") + " and medium_id in(" + mediumId + ")" + if req.StartDate != "" { + where += " and date>='" + req.StartDate + "'" + } + if req.EndDate != "" { + where += " and date<='" + req.EndDate + "'" + } + if len(appId) > 0 { + where += " and app_id in(" + strings.Join(appId, ",") + ")" + } + if req.Sort == "" { + req.Sort = "media_revenue desc" + } + sql = fmt.Sprintf(sql, where, req.Sort) + nativeString, _ := db.QueryNativeString(db.Db, sql) + return nativeString +} diff --git a/app/svc/svc_qualification.go b/app/svc/svc_qualification.go index 257da1b..7bef28e 100644 --- a/app/svc/svc_qualification.go +++ b/app/svc/svc_qualification.go @@ -154,7 +154,7 @@ func QualificationBankSave(c *gin.Context, req md.AgentBankInfo) error { data.Uuid = utils.StrToInt(req.Uuid) data.AgentId = utils.StrToInt(req.AgentId) data.CurrencyConf = utils.StrToInt(req.CurrencyConf) - data.UpdateAt = time.Now() + data.UpdateAt = time.Now().Format("2006-01-02 15:04:05") if utils.StrToInt(req.Id) > 0 { listDb := implement.NewAgentBankInfoDb(db.Db) @@ -167,7 +167,7 @@ func QualificationBankSave(c *gin.Context, req md.AgentBankInfo) error { } db.Db.Where("id=?", req.Id).Update(&data) } else { - data.CreateAt = time.Now() + data.CreateAt = time.Now().Format("2006-01-02 15:04:05") db.Db.InsertOne(&data) } return nil @@ -181,7 +181,7 @@ func QualificationContactSave(c *gin.Context, req md.AgentContactInfo) error { data.Id = utils.StrToInt(req.Id) data.Uuid = utils.StrToInt(req.Uuid) data.AgentId = utils.StrToInt(req.AgentId) - data.UpdateAt = time.Now() + data.UpdateAt = time.Now().Format("2006-01-02 15:04:05") if utils.StrToInt(req.Id) > 0 { listDb := implement.NewAgentContactInfoDb(db.Db) @@ -194,7 +194,7 @@ func QualificationContactSave(c *gin.Context, req md.AgentContactInfo) error { } db.Db.Where("id=?", req.Id).Update(&data) } else { - data.CreateAt = time.Now() + data.CreateAt = time.Now().Format("2006-01-02 15:04:05") db.Db.InsertOne(&data) } return nil diff --git a/app/svc/svc_settle_center.go b/app/svc/svc_settle_center.go new file mode 100644 index 0000000..b742c5b --- /dev/null +++ b/app/svc/svc_settle_center.go @@ -0,0 +1,191 @@ +package svc + +import ( + "applet/app/e" + "applet/app/md" + "applet/app/utils" + db "code.fnuoos.com/zhimeng/model.git/src" + "code.fnuoos.com/zhimeng/model.git/src/super/implement" + "code.fnuoos.com/zhimeng/model.git/src/super/model" + "encoding/json" + "github.com/gin-gonic/gin" + "time" +) + +func SettleCenterMediumList(c *gin.Context, req md.SettleCenterDataReq) md.SettleCenterMediumDataRes { + engine := db.Db + NewMediumSettlementDb := implement.NewMediumSettlementDb(engine) + mediumId := GetAgentMediumId(c) + MediumList, total, _ := NewMediumSettlementDb.FindMediumSettlementList(c.GetString("mid"), mediumId, "", "", "", req.StartTime, req.EndTime, utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) + data := make([]md.SettleCenterMediumDataData, 0) + if len(MediumList) > 0 { + for _, v := range MediumList { + medium := GetMediumInfo(c, v.MediumId) + name := "" + if medium != nil { + name = medium["name"] + } + var tmp = md.SettleCenterMediumDataData{ + Id: utils.IntToStr(v.Id), + Name: name, + AllIncome: utils.Float64ToStr(float64(v.OtherIncome+v.BasicIncome) / 100), + Income: utils.Float64ToStr(float64(v.BasicIncome) / 100), + OtherIncome: utils.Float64ToStr(float64(v.OtherIncome) / 100), + TimeStr: v.StartDate, + SettleType: utils.IntToStr(v.Kind), + PayState: utils.IntToStr(v.PayState), + State: utils.IntToStr(v.State), + Label: "预估", + } + if v.EndDate != "" && v.EndDate != "0000-00-00" { + if v.EndDate != v.StartDate { + tmp.TimeStr += "~" + v.EndDate + } + tmp.Label = "" + } + data = append(data, tmp) + } + } + res := md.SettleCenterMediumDataRes{ + List: data, + Total: total, + SettleType: md.AccountSettleState, + BusinessKind: md.BusinessKind, + SettlePayState: md.SettlePayState, + SettleState: md.SettleState, + } + return res +} +func SettleCenterList(c *gin.Context, req md.SettleCenterDataReq) md.SettleCenterDataRes { + user := GetUser(c) + engine := db.Db + NewAgentSettlementDb := implement.NewAgentSettlementDb(engine) + list, total, _ := NewAgentSettlementDb.FindAgentSettlementList(c.GetString("mid"), utils.IntToStr(user.AgentId), "", "", "", req.StartTime, req.EndTime, utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) + data := make([]md.SettleCenterDataData, 0) + if len(list) > 0 { + for _, v := range list { + var tmp = md.SettleCenterDataData{ + Id: utils.IntToStr(v.Id), + AllIncome: utils.Float64ToStr(float64(v.OtherIncome+v.BasicIncome) / 100), + Income: utils.Float64ToStr(float64(v.BasicIncome) / 100), + OtherIncome: utils.Float64ToStr(float64(v.OtherIncome) / 100), + TimeStr: v.StartDate, + SettleType: utils.IntToStr(v.Kind), + PayState: utils.IntToStr(v.PayState), + State: utils.IntToStr(v.State), + Label: "预估", + SettleFile: v.SettleFile, + } + if v.EndDate != "" && v.EndDate != "0000-00-00" { + if v.EndDate != v.StartDate { + tmp.TimeStr += "~" + v.EndDate + } + tmp.Label = "" + } + data = append(data, tmp) + } + } + res := md.SettleCenterDataRes{ + List: data, + Total: total, + SettleType: md.AccountSettleState, + BusinessKind: md.BusinessKind, + SettlePayState: md.SettlePayState, + SettleState: md.SettleState, + } + return res +} +func SettleCenterDetail(c *gin.Context, req md.CommDetailReq) md.SettleCenterDataDetailRes { + engine := db.Db + NewAgentSettlementDb := implement.NewAgentSettlementDb(engine) + data, _ := NewAgentSettlementDb.GetAgentSettlementById(utils.StrToInt(req.Id)) + file := make([]md.InvoiceFile, 0) + invoice := md.Invoice{ + Type: "0", + Time: "", + Count: "0", + File: file, + } + //发票 + NewAgentInvoiceDb := implement.NewAgentInvoiceDb(engine) + invoiceData, _ := NewAgentInvoiceDb.GetAgentInvoice(data.Id) + if invoiceData != nil { + invoice.Type = utils.IntToStr(invoiceData.Type) + invoice.Time = invoiceData.UpdateAt + invoice.Count = utils.IntToStr(invoiceData.Count) + json.Unmarshal([]byte(invoiceData.File), &file) + } + tmp := md.SettleCenterDataDetail{ + SettleFile: data.SettleFile, + Invoice: invoice, + AllIncome: utils.Float64ToStr(float64(data.OtherIncome+data.BasicIncome) / 100), + MediumIncome: utils.Float64ToStr(float64(data.BasicIncome) / 100), + OtherIncome: utils.Float64ToStr(float64(data.OtherIncome) / 100), + TimeStr: data.StartDate, + PayState: utils.IntToStr(data.PayState), + State: utils.IntToStr(data.State), + BusinessKind: utils.IntToStr(data.BusinessKind), + } + if data.EndDate != "" && data.EndDate != "0000-00-00" { + if data.EndDate != data.StartDate { + tmp.TimeStr += "~" + data.EndDate + } + } + res := md.SettleCenterDataDetailRes{ + Data: tmp, + InvoiceCate: md.InvoiceCate, + SettleType: md.AccountSettleState, + BusinessKind: md.BusinessKind, + SettlePayState: md.SettlePayState, + SettleState: md.SettleState, + InvoiceState: md.InvoiceState, + } + return res +} +func SettleCenterSettleFileSave(c *gin.Context, req md.SettleFileReq) { + engine := db.Db + NewAgentSettlementDb := implement.NewAgentSettlementDb(engine) + data, _ := NewAgentSettlementDb.GetAgentSettlementById(utils.StrToInt(req.Id)) + if data.State == 3 { + e.OutErr(c, 400, e.NewErr(400, "已完成签订,不能再调整")) + return + } + data.State = 3 + data.PayState = 1 + data.SettleFile = req.File + engine.Where("id=?", data.Id).Cols("state,settle_file,pay_state").Update(data) + e.OutSuc(c, "success", nil) + return +} +func SettleCenterInvoiceSave(c *gin.Context, req md.InvoiceReq) { + engine := db.Db + NewAgentSettlementDb := implement.NewAgentSettlementDb(engine) + data, _ := NewAgentSettlementDb.GetAgentSettlementById(utils.StrToInt(req.Id)) + if data.PayState > 3 { + e.OutErr(c, 400, e.NewErr(400, "已完成审核,不能再调整")) + return + } + data.PayState = 2 + engine.Where("id=?", data.Id).Cols("pay_sate").Update(data) + NewAgentInvoiceDb := implement.NewAgentInvoiceDb(engine) + invoice, _ := NewAgentInvoiceDb.GetAgentInvoice(data.Id) + if invoice == nil { + invoice = &model.AgentInvoice{ + SettlementId: data.Id, + CreateAt: time.Now().Format("2006-01-02 15:04:05"), + UpdateAt: time.Now().Format("2006-01-02 15:04:05"), + } + engine.Insert(invoice) + } + for k := range req.File { + req.File[k].State = "0" + } + invoice.File = utils.SerializeStr(req.File) + invoice.UpdateAt = time.Now().Format("2006-01-02 15:04:05") + invoice.State = 0 + invoice.Type = utils.StrToInt(req.Type) + invoice.Count = len(req.File) + engine.Where("id=?", invoice.Id).AllCols().Update(invoice) + e.OutSuc(c, "success", nil) + return +} diff --git a/app/utils/convert.go b/app/utils/convert.go index a638d37..362571c 100644 --- a/app/utils/convert.go +++ b/app/utils/convert.go @@ -320,3 +320,55 @@ func IntToStr(i int) string { func Int64ToStr(i int64) string { return strconv.FormatInt(i, 10) } +func Float64ToStrByPrec(f float64, prec int) string { + return strconv.FormatFloat(f, 'f', prec, 64) +} +func GetPrec(sum, commPrec string) string { + if sum == "" { + sum = "0" + } + sum = StrToFormat(sum, StrToInt(commPrec)) + ex := strings.Split(sum, ".") + if len(ex) == 2 { + if StrToFloat64(ex[1]) == 0 { + sum = ex[0] + } else { + val := Float64ToStrByPrec(StrToFloat64(ex[1]), 0) + keyMax := 0 + for i := 0; i < len(val); i++ { + ch := string(val[i]) + fmt.Println(StrToInt(ch)) + if StrToInt(ch) > 0 { + keyMax = i + } + } + valNew := val[0 : keyMax+1] + sum = ex[0] + "." + strings.ReplaceAll(ex[1], val, valNew) + } + } + return sum +} +func StrToFormat(s string, prec int) string { + ex := strings.Split(s, ".") + if len(ex) == 2 { + if StrToFloat64(ex[1]) == 0 { //小数点后面为空就是不要小数点了 + return ex[0] + } + //看取多少位 + str := ex[1] + str1 := str + if prec < len(str) { + str1 = str[0:prec] + } else { + for i := 0; i < prec-len(str); i++ { + str1 += "0" + } + } + if prec > 0 { + return ex[0] + "." + str1 + } else { + return ex[0] + } + } + return s +} diff --git a/app/utils/rand.go b/app/utils/rand.go index f3ef76b..e2dcc60 100644 --- a/app/utils/rand.go +++ b/app/utils/rand.go @@ -31,22 +31,16 @@ func RandNum() string { return fmt.Sprintf("%05v", rand.New(rand.NewSource(seed)).Int31n(1000000)) } func GenerateUniqueRandomNumbers(n int) string { - rand.Seed(time.Now().UnixNano()) // 初始化随机种子 - numbers := make([]int, n) // 创建一个切片来保存随机数 - for i := range numbers { - j := 0 - for { - b := rand.Intn(10) // 生成0-9之间的随机数 - numbers[i] = b - for _, num := range numbers[:i] { - if num == b { - j++ - break - } - } - if j == 0 { - break - } + rand.Seed(time.Now().UnixNano() + rand.Int63()) // 初始化随机种子 + + numbers := make([]int, 0, n) // 创建一个切片来保存随机数,初始容量为n + used := make(map[int]bool) // 跟踪已使用的数字 + + for len(numbers) < n { + b := rand.Intn(10) // 生成0-9之间的随机数 + if !used[b] { + numbers = append(numbers, b) + used[b] = true } } @@ -54,5 +48,6 @@ func GenerateUniqueRandomNumbers(n int) string { for _, v := range numbers { numbersStr += strconv.Itoa(v) } + return numbersStr } diff --git a/app/utils/xls.go b/app/utils/xls.go new file mode 100644 index 0000000..4b0318a --- /dev/null +++ b/app/utils/xls.go @@ -0,0 +1,36 @@ +package utils + +import ( + "bytes" + "fmt" + "github.com/360EntSecGroup-Skylar/excelize" + "github.com/gin-gonic/gin" + "io/ioutil" +) + +func Output(c *gin.Context, name string, data map[string]string) string { + //创建excel文件 + xlsx := excelize.NewFile() + //创建新表单 + index := xlsx.NewSheet(name) + for k, v := range data { + //设置单元格的值 + xlsx.SetCellValue(name, k, v) + } + //设置默认打开的表单 + xlsx.SetActiveSheet(index) + ////保存文件到指定路径 + //err := xlsx.SaveAs("./" + name + ".xlsx") + //if err != nil { + // log.Fatal(err) + //} + //_ = file.Save(fileName) + c.Header("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"`, name+".xlsx")) + c.Header("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") + var buffer bytes.Buffer + _ = xlsx.Write(&buffer) + r := bytes.NewReader(buffer.Bytes()) + fSrc, _ := ioutil.ReadAll(r) + str := "data:application/vnd.ms-excel;base64," + Base64RawStdEncode(string(fSrc)) + return str +} diff --git a/docs/docs.go b/docs/docs.go index 3202db2..bbb9ae1 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -327,9 +327,9 @@ const docTemplate = `{ } } }, - "/api/login": { + "/api/dataCenter/commission/record/list": { "post": { - "description": "登入", + "description": "数据中心-佣金收益-数据明细", "consumes": [ "application/json" ], @@ -337,25 +337,32 @@ const docTemplate = `{ "application/json" ], "tags": [ - "ADMIN" + "数据中心------嘉俊" ], - "summary": "登陆", + "summary": "佣金收益-数据明细", "parameters": [ { - "description": "用户名密码", - "name": "req", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.LoginReq" + "$ref": "#/definitions/md.DataCenterRecordReq" } } ], "responses": { "200": { - "description": "token", + "description": "具体看返回内容 这是data里面的数据", "schema": { - "$ref": "#/definitions/md.LoginResponse" + "$ref": "#/definitions/md.DataCenterCommissionRecordRes" } }, "400": { @@ -367,9 +374,9 @@ const docTemplate = `{ } } }, - "/api/login/phone": { + "/api/dataCenter/commission/record/output": { "post": { - "description": "手机号登入", + "description": "数据中心-佣金收益-数据明细-导出", "consumes": [ "application/json" ], @@ -377,25 +384,32 @@ const docTemplate = `{ "application/json" ], "tags": [ - "ADMIN" + "数据中心------嘉俊" ], - "summary": "手机号登陆", + "summary": "佣金收益-数据明细-导出", "parameters": [ { - "description": "用户名、验证码", - "name": "req", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.LoginPhoneReq" + "$ref": "#/definitions/md.DataCenterRecordOutPutReq" } } ], "responses": { "200": { - "description": "token", + "description": "具体看返回内容 这是data里面的数据", "schema": { - "$ref": "#/definitions/md.LoginResponse" + "type": "string" } }, "400": { @@ -407,9 +421,9 @@ const docTemplate = `{ } } }, - "/api/login/register": { + "/api/dataCenter/commission/record/total": { "post": { - "description": "手机号注册", + "description": "数据中心-佣金收益-明细合计", "consumes": [ "application/json" ], @@ -417,25 +431,32 @@ const docTemplate = `{ "application/json" ], "tags": [ - "ADMIN" + "数据中心------嘉俊" ], - "summary": "手机号注册", + "summary": "佣金收益-明细合计", "parameters": [ { - "description": "用户名、验证码", - "name": "req", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.LoginReq" + "$ref": "#/definitions/md.DataCenterTableReq" } } ], "responses": { "200": { - "description": "token", + "description": "具体看返回内容 这是data里面的数据", "schema": { - "$ref": "#/definitions/md.LoginResponse" + "$ref": "#/definitions/md.DataCenterCommissionTotalData" } }, "400": { @@ -447,9 +468,9 @@ const docTemplate = `{ } } }, - "/api/medium/list": { + "/api/dataCenter/profit/record/list": { "post": { - "description": "媒体中心-媒体列表", + "description": "数据中心-分润收益-数据明细", "consumes": [ "application/json" ], @@ -457,9 +478,9 @@ const docTemplate = `{ "application/json" ], "tags": [ - "媒体中心------嘉俊" + "数据中心------嘉俊" ], - "summary": "媒体列表", + "summary": "分润收益-数据明细", "parameters": [ { "type": "string", @@ -467,13 +488,22 @@ const docTemplate = `{ "name": "Authorization", "in": "header", "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.DataCenterProfitRecordReq" + } } ], "responses": { "200": { - "description": "具体看返回内容 data里面的数据", + "description": "具体看返回内容 这是data里面的数据", "schema": { - "$ref": "#/definitions/md.MediumListRes" + "$ref": "#/definitions/md.DataCenterProfitRecordRes" } }, "400": { @@ -485,9 +515,9 @@ const docTemplate = `{ } } }, - "/api/qiniuyun/upload": { + "/api/dataCenter/profit/record/output": { "post": { - "description": "七牛云-七牛云上传", + "description": "数据中心-分润收益-数据明细-导出", "consumes": [ "application/json" ], @@ -495,15 +525,16 @@ const docTemplate = `{ "application/json" ], "tags": [ - "七牛云" + "数据中心------嘉俊" ], - "summary": "七牛云上传", + "summary": "分润收益-数据明细-导出", "parameters": [ { "type": "string", "description": "验证参数Bearer和token空格拼接", "name": "Authorization", - "in": "header" + "in": "header", + "required": true }, { "description": "请求参数", @@ -511,13 +542,13 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.ImgReqUpload" + "$ref": "#/definitions/md.DataCenterProfitRecordOutPutReq" } } ], "responses": { "200": { - "description": "success", + "description": "具体看返回内容 这是data里面的数据", "schema": { "type": "string" } @@ -531,9 +562,9 @@ const docTemplate = `{ } } }, - "/api/role/addAdmin": { + "/api/dataCenter/record/list": { "post": { - "description": "新增管理员", + "description": "数据中心-数据明细", "consumes": [ "application/json" ], @@ -541,9 +572,9 @@ const docTemplate = `{ "application/json" ], "tags": [ - "ADMIN-权限管理" + "数据中心------嘉俊" ], - "summary": "新增管理员", + "summary": "数据明细", "parameters": [ { "type": "string", @@ -558,15 +589,15 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.AddAdminReq" + "$ref": "#/definitions/md.DataCenterRecordReq" } } ], "responses": { "200": { - "description": "success", + "description": "具体看返回内容 这是data里面的数据", "schema": { - "type": "string" + "$ref": "#/definitions/md.DataCenterRecordRes" } }, "400": { @@ -578,9 +609,9 @@ const docTemplate = `{ } } }, - "/api/role/addRole": { + "/api/dataCenter/record/output": { "post": { - "description": "添加角色", + "description": "数据中心-数据明细-导出", "consumes": [ "application/json" ], @@ -588,9 +619,9 @@ const docTemplate = `{ "application/json" ], "tags": [ - "ADMIN-权限管理" + "数据中心------嘉俊" ], - "summary": "添加角色", + "summary": "数据明细-导出", "parameters": [ { "type": "string", @@ -605,13 +636,13 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.AddRoleReq" + "$ref": "#/definitions/md.DataCenterRecordOutPutReq" } } ], "responses": { "200": { - "description": "success", + "description": "具体看返回内容 这是data里面的数据", "schema": { "type": "string" } @@ -625,9 +656,9 @@ const docTemplate = `{ } } }, - "/api/role/adminInfo": { - "get": { - "description": "管理员信息", + "/api/dataCenter/record/total": { + "post": { + "description": "数据中心-数据明细合计", "consumes": [ "application/json" ], @@ -635,9 +666,9 @@ const docTemplate = `{ "application/json" ], "tags": [ - "ADMIN-权限管理" + "数据中心------嘉俊" ], - "summary": "管理员信息", + "summary": "数据明细合计", "parameters": [ { "type": "string", @@ -647,18 +678,20 @@ const docTemplate = `{ "required": true }, { - "type": "string", - "description": "管理员id", - "name": "adm_id", - "in": "query", - "required": true + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.DataCenterTableReq" + } } ], "responses": { "200": { - "description": "具体看返回内容", + "description": "具体看返回内容 这是data里面的数据", "schema": { - "type": "string" + "$ref": "#/definitions/md.DataCenterTotalData" } }, "400": { @@ -670,9 +703,9 @@ const docTemplate = `{ } } }, - "/api/role/adminList": { - "post": { - "description": "管理员列表", + "/api/dataCenter/select/data": { + "get": { + "description": "数据中心-筛选条件", "consumes": [ "application/json" ], @@ -680,9 +713,9 @@ const docTemplate = `{ "application/json" ], "tags": [ - "ADMIN-权限管理" + "数据中心------嘉俊" ], - "summary": "管理员列表", + "summary": "筛选条件", "parameters": [ { "type": "string", @@ -690,20 +723,11 @@ const docTemplate = `{ "name": "Authorization", "in": "header", "required": true - }, - { - "description": "请求参数", - "name": "args", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/md.AdminListReq" - } } ], "responses": { "200": { - "description": "具体看返回内容", + "description": "具体看返回内容 这是data里面的数据", "schema": { "type": "string" } @@ -717,9 +741,9 @@ const docTemplate = `{ } } }, - "/api/role/bindAdminRole/": { + "/api/index/app/list": { "post": { - "description": "管理员绑定角色", + "description": "数据中心-数据明细", "consumes": [ "application/json" ], @@ -727,9 +751,9 @@ const docTemplate = `{ "application/json" ], "tags": [ - "ADMIN-权限管理" + "数据中心------嘉俊" ], - "summary": "管理员绑定角色", + "summary": "数据明细", "parameters": [ { "type": "string", @@ -744,15 +768,15 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.BindAdminRoleReq" + "$ref": "#/definitions/md.IndexAppListReq" } } ], "responses": { "200": { - "description": "success", + "description": "具体看返回内容 这是data里面的数据", "schema": { - "type": "string" + "$ref": "#/definitions/md.IndexAppListRes" } }, "400": { @@ -764,9 +788,9 @@ const docTemplate = `{ } } }, - "/api/role/deleteAdmin/{$adm_id}": { - "delete": { - "description": "删除管理员", + "/api/index/base": { + "get": { + "description": "首页-右上角基本数据", "consumes": [ "application/json" ], @@ -774,9 +798,9 @@ const docTemplate = `{ "application/json" ], "tags": [ - "ADMIN-权限管理" + "首页------嘉俊" ], - "summary": "删除管理员", + "summary": "右上角基本数据", "parameters": [ { "type": "string", @@ -788,7 +812,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "success", + "description": "具体看返回内容 这是data里面的数据", "schema": { "type": "string" } @@ -802,9 +826,9 @@ const docTemplate = `{ } } }, - "/api/role/deleteRole/{$id}": { - "delete": { - "description": "删除角色", + "/api/index/total": { + "get": { + "description": "首页-统计数据", "consumes": [ "application/json" ], @@ -812,9 +836,9 @@ const docTemplate = `{ "application/json" ], "tags": [ - "ADMIN-权限管理" + "首页------嘉俊" ], - "summary": "删除角色", + "summary": "统计数据", "parameters": [ { "type": "string", @@ -822,20 +846,11 @@ const docTemplate = `{ "name": "Authorization", "in": "header", "required": true - }, - { - "description": "请求参数", - "name": "args", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/md.UpdateRoleStateReq" - } } ], "responses": { "200": { - "description": "success", + "description": "具体看返回内容 这是data里面的数据", "schema": { "type": "string" } @@ -849,9 +864,9 @@ const docTemplate = `{ } } }, - "/api/role/permissionGroupList": { - "get": { - "description": "权限组列表", + "/api/login": { + "post": { + "description": "登入", "consumes": [ "application/json" ], @@ -859,30 +874,25 @@ const docTemplate = `{ "application/json" ], "tags": [ - "ADMIN-权限管理" + "ADMIN" ], - "summary": "权限组列表", + "summary": "登陆", "parameters": [ { - "type": "string", - "description": "验证参数Bearer和token空格拼接", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "管理员id", - "name": "adm_id", - "in": "query", - "required": true + "description": "用户名密码", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.LoginReq" + } } ], "responses": { "200": { - "description": "具体看返回内容", + "description": "token", "schema": { - "type": "string" + "$ref": "#/definitions/md.LoginResponse" } }, "400": { @@ -894,9 +904,9 @@ const docTemplate = `{ } } }, - "/api/role/roleBindPermissionGroup": { + "/api/login/phone": { "post": { - "description": "角色绑定权限组", + "description": "手机号登入", "consumes": [ "application/json" ], @@ -904,32 +914,25 @@ const docTemplate = `{ "application/json" ], "tags": [ - "ADMIN-权限管理" + "ADMIN" ], - "summary": "角色绑定权限组", + "summary": "手机号登陆", "parameters": [ { - "type": "string", - "description": "验证参数Bearer和token空格拼接", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "description": "请求参数", - "name": "args", + "description": "用户名、验证码", + "name": "req", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.RoleBindPermissionGroupReq" + "$ref": "#/definitions/md.LoginPhoneReq" } } ], "responses": { "200": { - "description": "success", + "description": "token", "schema": { - "type": "string" + "$ref": "#/definitions/md.LoginResponse" } }, "400": { @@ -941,9 +944,9 @@ const docTemplate = `{ } } }, - "/api/role/roleList": { - "get": { - "description": "角色列表", + "/api/login/register": { + "post": { + "description": "手机号注册", "consumes": [ "application/json" ], @@ -951,23 +954,25 @@ const docTemplate = `{ "application/json" ], "tags": [ - "ADMIN-权限管理" + "ADMIN" ], - "summary": "角色列表", + "summary": "手机号注册", "parameters": [ { - "type": "string", - "description": "验证参数Bearer和token空格拼接", - "name": "Authorization", - "in": "header", - "required": true + "description": "用户名、验证码", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.LoginReq" + } } ], "responses": { "200": { - "description": "具体看返回内容", + "description": "token", "schema": { - "type": "string" + "$ref": "#/definitions/md.LoginResponse" } }, "400": { @@ -979,9 +984,9 @@ const docTemplate = `{ } } }, - "/api/role/updateAdmin": { + "/api/medium/list": { "post": { - "description": "修改管理员信息", + "description": "媒体中心-媒体列表", "consumes": [ "application/json" ], @@ -989,9 +994,9 @@ const docTemplate = `{ "application/json" ], "tags": [ - "ADMIN-权限管理" + "媒体中心------嘉俊" ], - "summary": "修改管理员信息", + "summary": "媒体列表", "parameters": [ { "type": "string", @@ -999,6 +1004,43 @@ const docTemplate = `{ "name": "Authorization", "in": "header", "required": true + } + ], + "responses": { + "200": { + "description": "具体看返回内容 data里面的数据", + "schema": { + "$ref": "#/definitions/md.MediumListRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/qiniuyun/upload": { + "post": { + "description": "七牛云-七牛云上传", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "七牛云" + ], + "summary": "七牛云上传", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header" }, { "description": "请求参数", @@ -1006,7 +1048,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.UpdateAdminReq" + "$ref": "#/definitions/md.ImgReqUpload" } } ], @@ -1026,9 +1068,9 @@ const docTemplate = `{ } } }, - "/api/role/updateAdminState": { + "/api/role/addAdmin": { "post": { - "description": "修改管理员状态", + "description": "新增管理员", "consumes": [ "application/json" ], @@ -1038,7 +1080,7 @@ const docTemplate = `{ "tags": [ "ADMIN-权限管理" ], - "summary": "修改管理员状态", + "summary": "新增管理员", "parameters": [ { "type": "string", @@ -1053,7 +1095,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.UpdateAdminStateReq" + "$ref": "#/definitions/md.AddAdminReq" } } ], @@ -1073,9 +1115,9 @@ const docTemplate = `{ } } }, - "/api/role/updateRole": { + "/api/role/addRole": { "post": { - "description": "修改角色", + "description": "添加角色", "consumes": [ "application/json" ], @@ -1085,7 +1127,7 @@ const docTemplate = `{ "tags": [ "ADMIN-权限管理" ], - "summary": "修改角色", + "summary": "添加角色", "parameters": [ { "type": "string", @@ -1100,7 +1142,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.UpdateRoleReq" + "$ref": "#/definitions/md.AddRoleReq" } } ], @@ -1120,9 +1162,54 @@ const docTemplate = `{ } } }, - "/api/role/updateRoleState": { + "/api/role/adminInfo": { + "get": { + "description": "管理员信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "管理员信息", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "管理员id", + "name": "adm_id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "具体看返回内容", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/role/adminList": { "post": { - "description": "修改角色状态", + "description": "管理员列表", "consumes": [ "application/json" ], @@ -1132,7 +1219,7 @@ const docTemplate = `{ "tags": [ "ADMIN-权限管理" ], - "summary": "修改角色状态", + "summary": "管理员列表", "parameters": [ { "type": "string", @@ -1147,13 +1234,13 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.UpdateRoleStateReq" + "$ref": "#/definitions/md.AdminListReq" } } ], "responses": { "200": { - "description": "success", + "description": "具体看返回内容", "schema": { "type": "string" } @@ -1167,9 +1254,9 @@ const docTemplate = `{ } } }, - "/api/sms": { + "/api/role/bindAdminRole/": { "post": { - "description": "短信-短信发送", + "description": "管理员绑定角色", "consumes": [ "application/json" ], @@ -1177,15 +1264,16 @@ const docTemplate = `{ "application/json" ], "tags": [ - "短信" + "ADMIN-权限管理" ], - "summary": "短信发送", + "summary": "管理员绑定角色", "parameters": [ { "type": "string", "description": "验证参数Bearer和token空格拼接", "name": "Authorization", - "in": "header" + "in": "header", + "required": true }, { "description": "请求参数", @@ -1193,7 +1281,7 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.SmsReq" + "$ref": "#/definitions/md.BindAdminRoleReq" } } ], @@ -1212,288 +1300,1410 @@ const docTemplate = `{ } } } - } - }, - "definitions": { - "md.AccountBase": { - "type": "object", - "properties": { - "admin_phone": { - "type": "string", - "example": "管理员手机号" - }, - "agent_id": { - "type": "string", - "example": "账户ID" - }, - "company_abbreviation": { - "type": "string", - "example": "公司简称" - }, - "company_name": { - "type": "string", - "example": "公司名称" - }, - "contact_address": { - "type": "string", - "example": "联系地址" - }, - "contact_email": { - "type": "string", - "example": "邮箱" - }, - "contact_name": { - "type": "string", - "example": "联系人" - }, - "contact_phone": { - "type": "string", - "example": "联系电话" - }, - "country_region": { - "type": "string", - "example": "国家地区" - }, - "currency_conf": { - "type": "string", - "example": "结算币种" - }, - "nickname": { - "type": "string", - "example": "昵称" + }, + "/api/role/deleteAdmin/{$adm_id}": { + "delete": { + "description": "删除管理员", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "删除管理员", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } } } }, - "md.AccountUpdatePasswordReq": { - "type": "object", - "properties": { - "captcha": { - "type": "string", - "example": "验证码" - }, - "password": { - "type": "string", - "example": "登录密码" + "/api/role/deleteRole/{$id}": { + "delete": { + "description": "删除角色", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "删除角色", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.UpdateRoleStateReq" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } } } }, - "md.AddAdminReq": { - "type": "object", + "/api/role/permissionGroupList": { + "get": { + "description": "权限组列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "权限组列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "管理员id", + "name": "adm_id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "具体看返回内容", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/role/roleBindPermissionGroup": { + "post": { + "description": "角色绑定权限组", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "角色绑定权限组", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.RoleBindPermissionGroupReq" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/role/roleList": { + "get": { + "description": "角色列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "角色列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "具体看返回内容", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/role/updateAdmin": { + "post": { + "description": "修改管理员信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "修改管理员信息", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.UpdateAdminReq" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/role/updateAdminState": { + "post": { + "description": "修改管理员状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "修改管理员状态", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.UpdateAdminStateReq" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/role/updateRole": { + "post": { + "description": "修改角色", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "修改角色", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.UpdateRoleReq" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/role/updateRoleState": { + "post": { + "description": "修改角色状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "修改角色状态", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.UpdateRoleStateReq" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/settleCenter/agent/detail": { + "post": { + "description": "结算中心-渠道个人结算报表-详情", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "结算中心------嘉俊" + ], + "summary": "渠道个人结算报表-详情", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.CommDetailReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.SettleCenterDataDetailRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/settleCenter/agent/invoice/save": { + "post": { + "description": "财务中心-渠道个人详情-发票上传", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "财务中心------嘉俊" + ], + "summary": "渠道个人详情-发票上传", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.InvoiceReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/settleCenter/agent/list": { + "post": { + "description": "结算中心-渠道个人结算报表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "结算中心------嘉俊" + ], + "summary": "渠道个人结算报表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.SettleCenterDataReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.SettleCenterDataRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/settleCenter/agent/settle/file/save": { + "post": { + "description": "财务中心-渠道个人详情-结算单保存", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "财务中心------嘉俊" + ], + "summary": "渠道个人详情-结算单保存", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.SettleFileReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/settleCenter/medium/list": { + "post": { + "description": "结算中心-媒体结算报表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "结算中心------嘉俊" + ], + "summary": "媒体结算报表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.SettleCenterDataReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.SettleCenterMediumDataRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/sms": { + "post": { + "description": "短信-短信发送", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "短信" + ], + "summary": "短信发送", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header" + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.SmsReq" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + } + }, + "definitions": { + "md.AccountBase": { + "type": "object", + "properties": { + "admin_phone": { + "type": "string", + "example": "管理员手机号" + }, + "agent_id": { + "type": "string", + "example": "账户ID" + }, + "company_abbreviation": { + "type": "string", + "example": "公司简称" + }, + "company_name": { + "type": "string", + "example": "公司名称" + }, + "contact_address": { + "type": "string", + "example": "联系地址" + }, + "contact_email": { + "type": "string", + "example": "邮箱" + }, + "contact_name": { + "type": "string", + "example": "联系人" + }, + "contact_phone": { + "type": "string", + "example": "联系电话" + }, + "country_region": { + "type": "string", + "example": "国家地区" + }, + "currency_conf": { + "type": "string", + "example": "结算币种" + }, + "nickname": { + "type": "string", + "example": "昵称" + } + } + }, + "md.AccountUpdatePasswordReq": { + "type": "object", + "properties": { + "captcha": { + "type": "string", + "example": "验证码" + }, + "password": { + "type": "string", + "example": "登录密码" + } + } + }, + "md.AddAdminReq": { + "type": "object", "required": [ "password", "username" ], "properties": { - "memo": { + "memo": { + "type": "string" + }, + "password": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "md.AddRoleReq": { + "type": "object", + "required": [ + "memo", + "name" + ], + "properties": { + "memo": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "md.AdminListReq": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "page": { + "type": "integer" + }, + "state": { + "type": "integer" + }, + "username": { + "type": "string" + } + } + }, + "md.AgentBankInfo": { + "type": "object", + "properties": { + "agent_id": { + "type": "string" + }, + "bank": { + "type": "string" + }, + "bank_branch": { + "type": "string" + }, + "bank_no": { + "type": "string" + }, + "currency_conf": { + "type": "string" + }, + "id": { + "type": "string" + }, + "licence": { + "type": "string" + }, + "memo": { + "type": "string" + }, + "state": { + "type": "string" + }, + "uuid": { + "type": "string" + } + } + }, + "md.AgentContactInfo": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "agent_id": { + "type": "string" + }, + "email": { + "type": "string" + }, + "id": { + "type": "string" + }, + "memo": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "state": { + "type": "string" + }, + "uuid": { + "type": "string" + } + } + }, + "md.AgentList": { + "type": "object", + "properties": { + "agent_id": { + "type": "string" + }, + "business_license_address": { + "type": "string" + }, + "business_license_img_url": { + "type": "string" + }, + "certificate_first_type": { + "type": "string" + }, + "certificate_type": { + "type": "string" + }, + "certificate_validity": { + "type": "string" + }, + "company_abbreviation": { + "type": "string" + }, + "company_name": { + "type": "string" + }, + "country_region": { + "type": "string" + }, + "country_region_id": { + "type": "string" + }, + "id": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "legal_representative": { + "type": "string" + }, + "memo": { + "type": "string" + }, + "registered_address": { + "type": "string" + }, + "registered_address_city_id": { + "type": "string" + }, + "registered_address_country_id": { + "type": "string" + }, + "registered_address_county_id": { + "type": "string" + }, + "registered_address_province_id": { + "type": "string" + }, + "state": { + "type": "string" + }, + "unified_social_credit_code": { + "type": "string" + }, + "uuid": { + "type": "string" + } + } + }, + "md.BindAdminRoleReq": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "integer" + }, + "role_ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "md.CommDetailReq": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "列表id" + } + } + }, + "md.DataCenterCommissionRecordRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.DataCenterCommissionTotalData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.DataCenterCommissionTotalData": { + "type": "object", + "properties": { + "adv_name": { "type": "string" }, - "password": { + "all_commission": { + "type": "string", + "example": "预估总佣金" + }, + "app_name": { "type": "string" }, - "username": { + "click_count": { + "type": "string", + "example": "点击量" + }, + "click_rate": { + "type": "string", + "example": "点击率" + }, + "commission": { + "type": "string", + "example": "预估佣金" + }, + "date": { + "type": "string", + "example": "日期" + }, + "ecpm": { + "type": "string", + "example": "ecpm" + }, + "exposure_count": { + "type": "string", + "example": "曝光量" + }, + "other_commission": { + "type": "string", + "example": "额外奖励" + }, + "platform_name": { "type": "string" } } }, - "md.AddRoleReq": { + "md.DataCenterProfitRecordData": { "type": "object", - "required": [ - "memo", - "name" - ], "properties": { - "memo": { + "all_commission": { + "type": "string", + "example": "预估总佣金" + }, + "app_name": { "type": "string" }, - "name": { + "commission": { + "type": "string", + "example": "预估佣金" + }, + "date": { + "type": "string", + "example": "日期" + }, + "other_commission": { + "type": "string", + "example": "额外奖励" + }, + "platform_name": { "type": "string" } } }, - "md.AdminListReq": { + "md.DataCenterProfitRecordOutPutReq": { "type": "object", "properties": { + "app_id": { + "type": "string", + "example": "应用" + }, + "end_date": { + "type": "string", + "example": "2024-08-30" + }, "limit": { - "type": "integer" + "type": "string", + "example": "10000 个一页" }, "page": { - "type": "integer" + "type": "string" }, - "state": { - "type": "integer" + "platform": { + "type": "string", + "example": "平台" }, - "username": { - "type": "string" + "start_date": { + "type": "string", + "example": "2024-08-30 默认查昨天的 最近7天" + }, + "type": { + "type": "string", + "example": "0-日收益 1-月收益 2年收益" } } }, - "md.AgentBankInfo": { + "md.DataCenterProfitRecordReq": { "type": "object", "properties": { - "agent_id": { - "type": "string" + "app_id": { + "type": "string", + "example": "应用" }, - "bank": { - "type": "string" + "end_date": { + "type": "string", + "example": "2024-08-30" }, - "bank_branch": { + "limit": { "type": "string" }, - "bank_no": { + "page": { "type": "string" }, - "currency_conf": { - "type": "string" + "platform": { + "type": "string", + "example": "平台" }, - "id": { - "type": "string" + "start_date": { + "type": "string", + "example": "2024-08-30 默认查昨天的 最近7天" }, - "licence": { - "type": "string" + "type": { + "type": "string", + "example": "0-日收益 1-月收益 2年收益" + } + } + }, + "md.DataCenterProfitRecordRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.DataCenterProfitRecordData" + } }, - "memo": { - "type": "string" + "total": { + "type": "integer" + } + } + }, + "md.DataCenterRecordOutPutReq": { + "type": "object", + "properties": { + "ad_type": { + "type": "string", + "example": "广告位类型" }, - "state": { - "type": "string" + "app_id": { + "type": "string", + "example": "应用" }, - "uuid": { + "end_date": { + "type": "string", + "example": "2024-08-30" + }, + "limit": { + "type": "string", + "example": "10000 个一页" + }, + "page": { "type": "string" + }, + "platform": { + "type": "string", + "example": "平台" + }, + "start_date": { + "type": "string", + "example": "2024-08-30 默认查昨天的 最近7天" } } }, - "md.AgentContactInfo": { + "md.DataCenterRecordReq": { "type": "object", "properties": { - "address": { - "type": "string" - }, - "agent_id": { - "type": "string" + "ad_type": { + "type": "string", + "example": "广告位类型" }, - "email": { - "type": "string" + "app_id": { + "type": "string", + "example": "应用" }, - "id": { - "type": "string" + "end_date": { + "type": "string", + "example": "2024-08-30" }, - "memo": { + "limit": { "type": "string" }, - "name": { + "page": { "type": "string" }, - "phone": { - "type": "string" + "platform": { + "type": "string", + "example": "平台" }, - "state": { - "type": "string" + "start_date": { + "type": "string", + "example": "2024-08-30 默认查昨天的 最近7天" + } + } + }, + "md.DataCenterRecordRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.DataCenterTotalData" + } }, - "uuid": { - "type": "string" + "total": { + "type": "integer" } } }, - "md.AgentList": { + "md.DataCenterTableReq": { "type": "object", "properties": { - "agent_id": { - "type": "string" + "ad_type": { + "type": "string", + "example": "广告位类型" }, - "business_license_address": { - "type": "string" + "app_id": { + "type": "string", + "example": "应用" }, - "business_license_img_url": { - "type": "string" + "end_date": { + "type": "string", + "example": "2024-08-30" }, - "certificate_first_type": { - "type": "string" + "platform": { + "type": "string", + "example": "平台" }, - "certificate_type": { + "start_date": { + "type": "string", + "example": "2024-08-30 默认查昨天的 最近7天" + } + } + }, + "md.DataCenterTotalData": { + "type": "object", + "properties": { + "adv_name": { "type": "string" }, - "certificate_validity": { + "app_name": { "type": "string" }, - "company_abbreviation": { - "type": "string" + "click_count": { + "type": "string", + "example": "点击量" }, - "company_name": { - "type": "string" + "click_rate": { + "type": "string", + "example": "点击率" }, - "country_region": { - "type": "string" + "date": { + "type": "string", + "example": "日期" }, - "country_region_id": { - "type": "string" + "ecpm": { + "type": "string", + "example": "ecpm" }, - "id": { - "type": "string" + "exposure_count": { + "type": "string", + "example": "曝光量" }, - "kind": { - "type": "string" + "media_revenue": { + "type": "string", + "example": "预估收益" }, - "legal_representative": { + "platform_name": { + "type": "string" + } + } + }, + "md.ImgReqUpload": { + "type": "object", + "properties": { + "dir": { "type": "string" }, - "memo": { + "file_name": { "type": "string" }, - "registered_address": { + "file_size": { + "description": "文件大小, 单位byte", + "type": "integer" + } + } + }, + "md.IndexAppListData": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.IndexAppListDataList" + } + }, + "logo": { "type": "string" }, - "registered_address_city_id": { + "name": { "type": "string" }, - "registered_address_country_id": { + "table_list": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "md.IndexAppListDataList": { + "type": "object", + "properties": { + "bili": { "type": "string" }, - "registered_address_county_id": { + "name": { "type": "string" }, - "registered_address_province_id": { + "type": { "type": "string" }, - "state": { + "value": { "type": "string" + } + } + }, + "md.IndexAppListReq": { + "type": "object", + "properties": { + "end_date": { + "type": "string", + "example": "2024-08-30" }, - "unified_social_credit_code": { - "type": "string" + "sort": { + "type": "string", + "example": "排序" }, - "uuid": { - "type": "string" + "start_date": { + "type": "string", + "example": "2024-08-30" } } }, - "md.BindAdminRoleReq": { + "md.IndexAppListRes": { "type": "object", - "required": [ - "id" - ], "properties": { - "id": { - "type": "integer" + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.IndexAppListData" + } }, - "role_ids": { + "sort": { "type": "array", "items": { - "type": "integer" + "$ref": "#/definitions/md.SelectData" } } } }, - "md.ImgReqUpload": { + "md.Invoice": { "type": "object", "properties": { - "dir": { + "count": { "type": "string" }, - "file_name": { + "file": { + "type": "array", + "items": { + "$ref": "#/definitions/md.InvoiceFile" + } + }, + "time": { "type": "string" }, - "file_size": { - "description": "文件大小, 单位byte", - "type": "integer" + "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" + }, + "type": { + "type": "string", + "example": "0电子发票 1纸质发票" } } }, @@ -1650,6 +2860,291 @@ const docTemplate = `{ } } }, + "md.SettleCenterDataData": { + "type": "object", + "properties": { + "all_income": { + "type": "string", + "example": "合计收益" + }, + "business_kind": { + "type": "string", + "example": "业务类型(1:广告合作)" + }, + "id": { + "type": "string" + }, + "income": { + "type": "string", + "example": "基础收益" + }, + "label": { + "type": "string" + }, + "other_income": { + "type": "string", + "example": "其他调整" + }, + "pay_state": { + "type": "string", + "example": "结算单支付状态(0:未开始 1:待审核发票 2:发票审核中 3:发票审核拒绝 4:付款中 5:已付款)" + }, + "settle_file": { + "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": "业务时间" + } + } + }, + "md.SettleCenterDataDetail": { + "type": "object", + "properties": { + "all_income": { + "type": "string", + "example": "合计收益" + }, + "business_kind": { + "type": "string", + "example": "业务类型(1:广告合作)" + }, + "invoice": { + "$ref": "#/definitions/md.Invoice" + }, + "medium_income": { + "type": "string", + "example": "媒体结算" + }, + "other_income": { + "type": "string", + "example": "其他调整" + }, + "pay_state": { + "type": "string", + "example": "结算单支付状态(0:未开始 1:待审核发票 2:发票审核中 3:发票审核拒绝 4:付款中 5:已付款)" + }, + "settle_file": { + "type": "string", + "example": "结算单" + }, + "state": { + "type": "string", + "example": "结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订)" + }, + "time_str": { + "type": "string", + "example": "业务时间" + } + } + }, + "md.SettleCenterDataDetailRes": { + "type": "object", + "properties": { + "business_kind": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "data": { + "$ref": "#/definitions/md.SettleCenterDataDetail" + }, + "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.SettleCenterDataReq": { + "type": "object", + "properties": { + "end_time": { + "type": "string" + }, + "limit": { + "type": "string" + }, + "page": { + "type": "string" + }, + "start_time": { + "type": "string", + "example": "2024-08-29" + } + } + }, + "md.SettleCenterDataRes": { + "type": "object", + "properties": { + "business_kind": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SettleCenterDataData" + } + }, + "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.SettleCenterMediumDataData": { + "type": "object", + "properties": { + "all_income": { + "type": "string", + "example": "合计收益" + }, + "business_kind": { + "type": "string", + "example": "业务类型(1:广告合作)" + }, + "id": { + "type": "string" + }, + "income": { + "type": "string", + "example": "基础收益" + }, + "label": { + "type": "string" + }, + "name": { + "type": "string", + "example": "媒体名称" + }, + "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.SettleCenterMediumDataRes": { + "type": "object", + "properties": { + "business_kind": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SettleCenterMediumDataData" + } + }, + "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.SettleFileReq": { + "type": "object", + "properties": { + "file": { + "type": "string", + "example": "七牛云链接 带http" + }, + "id": { + "type": "string", + "example": "列表id" + } + } + }, "md.SmsReq": { "type": "object", "properties": { diff --git a/docs/swagger.json b/docs/swagger.json index 23ff792..abb3d1f 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -319,9 +319,9 @@ } } }, - "/api/login": { + "/api/dataCenter/commission/record/list": { "post": { - "description": "登入", + "description": "数据中心-佣金收益-数据明细", "consumes": [ "application/json" ], @@ -329,25 +329,32 @@ "application/json" ], "tags": [ - "ADMIN" + "数据中心------嘉俊" ], - "summary": "登陆", + "summary": "佣金收益-数据明细", "parameters": [ { - "description": "用户名密码", - "name": "req", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.LoginReq" + "$ref": "#/definitions/md.DataCenterRecordReq" } } ], "responses": { "200": { - "description": "token", + "description": "具体看返回内容 这是data里面的数据", "schema": { - "$ref": "#/definitions/md.LoginResponse" + "$ref": "#/definitions/md.DataCenterCommissionRecordRes" } }, "400": { @@ -359,9 +366,9 @@ } } }, - "/api/login/phone": { + "/api/dataCenter/commission/record/output": { "post": { - "description": "手机号登入", + "description": "数据中心-佣金收益-数据明细-导出", "consumes": [ "application/json" ], @@ -369,25 +376,32 @@ "application/json" ], "tags": [ - "ADMIN" + "数据中心------嘉俊" ], - "summary": "手机号登陆", + "summary": "佣金收益-数据明细-导出", "parameters": [ { - "description": "用户名、验证码", - "name": "req", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.LoginPhoneReq" + "$ref": "#/definitions/md.DataCenterRecordOutPutReq" } } ], "responses": { "200": { - "description": "token", + "description": "具体看返回内容 这是data里面的数据", "schema": { - "$ref": "#/definitions/md.LoginResponse" + "type": "string" } }, "400": { @@ -399,9 +413,9 @@ } } }, - "/api/login/register": { + "/api/dataCenter/commission/record/total": { "post": { - "description": "手机号注册", + "description": "数据中心-佣金收益-明细合计", "consumes": [ "application/json" ], @@ -409,25 +423,32 @@ "application/json" ], "tags": [ - "ADMIN" + "数据中心------嘉俊" ], - "summary": "手机号注册", + "summary": "佣金收益-明细合计", "parameters": [ { - "description": "用户名、验证码", - "name": "req", + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.LoginReq" + "$ref": "#/definitions/md.DataCenterTableReq" } } ], "responses": { "200": { - "description": "token", + "description": "具体看返回内容 这是data里面的数据", "schema": { - "$ref": "#/definitions/md.LoginResponse" + "$ref": "#/definitions/md.DataCenterCommissionTotalData" } }, "400": { @@ -439,9 +460,9 @@ } } }, - "/api/medium/list": { + "/api/dataCenter/profit/record/list": { "post": { - "description": "媒体中心-媒体列表", + "description": "数据中心-分润收益-数据明细", "consumes": [ "application/json" ], @@ -449,9 +470,9 @@ "application/json" ], "tags": [ - "媒体中心------嘉俊" + "数据中心------嘉俊" ], - "summary": "媒体列表", + "summary": "分润收益-数据明细", "parameters": [ { "type": "string", @@ -459,13 +480,22 @@ "name": "Authorization", "in": "header", "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.DataCenterProfitRecordReq" + } } ], "responses": { "200": { - "description": "具体看返回内容 data里面的数据", + "description": "具体看返回内容 这是data里面的数据", "schema": { - "$ref": "#/definitions/md.MediumListRes" + "$ref": "#/definitions/md.DataCenterProfitRecordRes" } }, "400": { @@ -477,9 +507,9 @@ } } }, - "/api/qiniuyun/upload": { + "/api/dataCenter/profit/record/output": { "post": { - "description": "七牛云-七牛云上传", + "description": "数据中心-分润收益-数据明细-导出", "consumes": [ "application/json" ], @@ -487,15 +517,16 @@ "application/json" ], "tags": [ - "七牛云" + "数据中心------嘉俊" ], - "summary": "七牛云上传", + "summary": "分润收益-数据明细-导出", "parameters": [ { "type": "string", "description": "验证参数Bearer和token空格拼接", "name": "Authorization", - "in": "header" + "in": "header", + "required": true }, { "description": "请求参数", @@ -503,13 +534,13 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.ImgReqUpload" + "$ref": "#/definitions/md.DataCenterProfitRecordOutPutReq" } } ], "responses": { "200": { - "description": "success", + "description": "具体看返回内容 这是data里面的数据", "schema": { "type": "string" } @@ -523,9 +554,9 @@ } } }, - "/api/role/addAdmin": { + "/api/dataCenter/record/list": { "post": { - "description": "新增管理员", + "description": "数据中心-数据明细", "consumes": [ "application/json" ], @@ -533,9 +564,9 @@ "application/json" ], "tags": [ - "ADMIN-权限管理" + "数据中心------嘉俊" ], - "summary": "新增管理员", + "summary": "数据明细", "parameters": [ { "type": "string", @@ -550,15 +581,15 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.AddAdminReq" + "$ref": "#/definitions/md.DataCenterRecordReq" } } ], "responses": { "200": { - "description": "success", + "description": "具体看返回内容 这是data里面的数据", "schema": { - "type": "string" + "$ref": "#/definitions/md.DataCenterRecordRes" } }, "400": { @@ -570,9 +601,9 @@ } } }, - "/api/role/addRole": { + "/api/dataCenter/record/output": { "post": { - "description": "添加角色", + "description": "数据中心-数据明细-导出", "consumes": [ "application/json" ], @@ -580,9 +611,9 @@ "application/json" ], "tags": [ - "ADMIN-权限管理" + "数据中心------嘉俊" ], - "summary": "添加角色", + "summary": "数据明细-导出", "parameters": [ { "type": "string", @@ -597,13 +628,13 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.AddRoleReq" + "$ref": "#/definitions/md.DataCenterRecordOutPutReq" } } ], "responses": { "200": { - "description": "success", + "description": "具体看返回内容 这是data里面的数据", "schema": { "type": "string" } @@ -617,9 +648,9 @@ } } }, - "/api/role/adminInfo": { - "get": { - "description": "管理员信息", + "/api/dataCenter/record/total": { + "post": { + "description": "数据中心-数据明细合计", "consumes": [ "application/json" ], @@ -627,9 +658,9 @@ "application/json" ], "tags": [ - "ADMIN-权限管理" + "数据中心------嘉俊" ], - "summary": "管理员信息", + "summary": "数据明细合计", "parameters": [ { "type": "string", @@ -639,18 +670,20 @@ "required": true }, { - "type": "string", - "description": "管理员id", - "name": "adm_id", - "in": "query", - "required": true + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.DataCenterTableReq" + } } ], "responses": { "200": { - "description": "具体看返回内容", + "description": "具体看返回内容 这是data里面的数据", "schema": { - "type": "string" + "$ref": "#/definitions/md.DataCenterTotalData" } }, "400": { @@ -662,9 +695,9 @@ } } }, - "/api/role/adminList": { - "post": { - "description": "管理员列表", + "/api/dataCenter/select/data": { + "get": { + "description": "数据中心-筛选条件", "consumes": [ "application/json" ], @@ -672,9 +705,9 @@ "application/json" ], "tags": [ - "ADMIN-权限管理" + "数据中心------嘉俊" ], - "summary": "管理员列表", + "summary": "筛选条件", "parameters": [ { "type": "string", @@ -682,20 +715,11 @@ "name": "Authorization", "in": "header", "required": true - }, - { - "description": "请求参数", - "name": "args", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/md.AdminListReq" - } } ], "responses": { "200": { - "description": "具体看返回内容", + "description": "具体看返回内容 这是data里面的数据", "schema": { "type": "string" } @@ -709,9 +733,9 @@ } } }, - "/api/role/bindAdminRole/": { + "/api/index/app/list": { "post": { - "description": "管理员绑定角色", + "description": "数据中心-数据明细", "consumes": [ "application/json" ], @@ -719,9 +743,9 @@ "application/json" ], "tags": [ - "ADMIN-权限管理" + "数据中心------嘉俊" ], - "summary": "管理员绑定角色", + "summary": "数据明细", "parameters": [ { "type": "string", @@ -736,15 +760,15 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.BindAdminRoleReq" + "$ref": "#/definitions/md.IndexAppListReq" } } ], "responses": { "200": { - "description": "success", + "description": "具体看返回内容 这是data里面的数据", "schema": { - "type": "string" + "$ref": "#/definitions/md.IndexAppListRes" } }, "400": { @@ -756,9 +780,9 @@ } } }, - "/api/role/deleteAdmin/{$adm_id}": { - "delete": { - "description": "删除管理员", + "/api/index/base": { + "get": { + "description": "首页-右上角基本数据", "consumes": [ "application/json" ], @@ -766,9 +790,9 @@ "application/json" ], "tags": [ - "ADMIN-权限管理" + "首页------嘉俊" ], - "summary": "删除管理员", + "summary": "右上角基本数据", "parameters": [ { "type": "string", @@ -780,7 +804,7 @@ ], "responses": { "200": { - "description": "success", + "description": "具体看返回内容 这是data里面的数据", "schema": { "type": "string" } @@ -794,9 +818,9 @@ } } }, - "/api/role/deleteRole/{$id}": { - "delete": { - "description": "删除角色", + "/api/index/total": { + "get": { + "description": "首页-统计数据", "consumes": [ "application/json" ], @@ -804,9 +828,9 @@ "application/json" ], "tags": [ - "ADMIN-权限管理" + "首页------嘉俊" ], - "summary": "删除角色", + "summary": "统计数据", "parameters": [ { "type": "string", @@ -814,20 +838,11 @@ "name": "Authorization", "in": "header", "required": true - }, - { - "description": "请求参数", - "name": "args", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/md.UpdateRoleStateReq" - } } ], "responses": { "200": { - "description": "success", + "description": "具体看返回内容 这是data里面的数据", "schema": { "type": "string" } @@ -841,9 +856,9 @@ } } }, - "/api/role/permissionGroupList": { - "get": { - "description": "权限组列表", + "/api/login": { + "post": { + "description": "登入", "consumes": [ "application/json" ], @@ -851,30 +866,25 @@ "application/json" ], "tags": [ - "ADMIN-权限管理" + "ADMIN" ], - "summary": "权限组列表", + "summary": "登陆", "parameters": [ { - "type": "string", - "description": "验证参数Bearer和token空格拼接", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "string", - "description": "管理员id", - "name": "adm_id", - "in": "query", - "required": true + "description": "用户名密码", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.LoginReq" + } } ], "responses": { "200": { - "description": "具体看返回内容", + "description": "token", "schema": { - "type": "string" + "$ref": "#/definitions/md.LoginResponse" } }, "400": { @@ -886,9 +896,9 @@ } } }, - "/api/role/roleBindPermissionGroup": { + "/api/login/phone": { "post": { - "description": "角色绑定权限组", + "description": "手机号登入", "consumes": [ "application/json" ], @@ -896,32 +906,25 @@ "application/json" ], "tags": [ - "ADMIN-权限管理" + "ADMIN" ], - "summary": "角色绑定权限组", + "summary": "手机号登陆", "parameters": [ { - "type": "string", - "description": "验证参数Bearer和token空格拼接", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "description": "请求参数", - "name": "args", + "description": "用户名、验证码", + "name": "req", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.RoleBindPermissionGroupReq" + "$ref": "#/definitions/md.LoginPhoneReq" } } ], "responses": { "200": { - "description": "success", + "description": "token", "schema": { - "type": "string" + "$ref": "#/definitions/md.LoginResponse" } }, "400": { @@ -933,9 +936,9 @@ } } }, - "/api/role/roleList": { - "get": { - "description": "角色列表", + "/api/login/register": { + "post": { + "description": "手机号注册", "consumes": [ "application/json" ], @@ -943,23 +946,25 @@ "application/json" ], "tags": [ - "ADMIN-权限管理" + "ADMIN" ], - "summary": "角色列表", + "summary": "手机号注册", "parameters": [ { - "type": "string", - "description": "验证参数Bearer和token空格拼接", - "name": "Authorization", - "in": "header", - "required": true + "description": "用户名、验证码", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.LoginReq" + } } ], "responses": { "200": { - "description": "具体看返回内容", + "description": "token", "schema": { - "type": "string" + "$ref": "#/definitions/md.LoginResponse" } }, "400": { @@ -971,9 +976,9 @@ } } }, - "/api/role/updateAdmin": { + "/api/medium/list": { "post": { - "description": "修改管理员信息", + "description": "媒体中心-媒体列表", "consumes": [ "application/json" ], @@ -981,9 +986,9 @@ "application/json" ], "tags": [ - "ADMIN-权限管理" + "媒体中心------嘉俊" ], - "summary": "修改管理员信息", + "summary": "媒体列表", "parameters": [ { "type": "string", @@ -991,6 +996,43 @@ "name": "Authorization", "in": "header", "required": true + } + ], + "responses": { + "200": { + "description": "具体看返回内容 data里面的数据", + "schema": { + "$ref": "#/definitions/md.MediumListRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/qiniuyun/upload": { + "post": { + "description": "七牛云-七牛云上传", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "七牛云" + ], + "summary": "七牛云上传", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header" }, { "description": "请求参数", @@ -998,7 +1040,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.UpdateAdminReq" + "$ref": "#/definitions/md.ImgReqUpload" } } ], @@ -1018,9 +1060,9 @@ } } }, - "/api/role/updateAdminState": { + "/api/role/addAdmin": { "post": { - "description": "修改管理员状态", + "description": "新增管理员", "consumes": [ "application/json" ], @@ -1030,7 +1072,7 @@ "tags": [ "ADMIN-权限管理" ], - "summary": "修改管理员状态", + "summary": "新增管理员", "parameters": [ { "type": "string", @@ -1045,7 +1087,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.UpdateAdminStateReq" + "$ref": "#/definitions/md.AddAdminReq" } } ], @@ -1065,9 +1107,9 @@ } } }, - "/api/role/updateRole": { + "/api/role/addRole": { "post": { - "description": "修改角色", + "description": "添加角色", "consumes": [ "application/json" ], @@ -1077,7 +1119,7 @@ "tags": [ "ADMIN-权限管理" ], - "summary": "修改角色", + "summary": "添加角色", "parameters": [ { "type": "string", @@ -1092,7 +1134,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.UpdateRoleReq" + "$ref": "#/definitions/md.AddRoleReq" } } ], @@ -1112,9 +1154,54 @@ } } }, - "/api/role/updateRoleState": { + "/api/role/adminInfo": { + "get": { + "description": "管理员信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "管理员信息", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "管理员id", + "name": "adm_id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "具体看返回内容", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/role/adminList": { "post": { - "description": "修改角色状态", + "description": "管理员列表", "consumes": [ "application/json" ], @@ -1124,7 +1211,7 @@ "tags": [ "ADMIN-权限管理" ], - "summary": "修改角色状态", + "summary": "管理员列表", "parameters": [ { "type": "string", @@ -1139,13 +1226,13 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.UpdateRoleStateReq" + "$ref": "#/definitions/md.AdminListReq" } } ], "responses": { "200": { - "description": "success", + "description": "具体看返回内容", "schema": { "type": "string" } @@ -1159,9 +1246,9 @@ } } }, - "/api/sms": { + "/api/role/bindAdminRole/": { "post": { - "description": "短信-短信发送", + "description": "管理员绑定角色", "consumes": [ "application/json" ], @@ -1169,15 +1256,16 @@ "application/json" ], "tags": [ - "短信" + "ADMIN-权限管理" ], - "summary": "短信发送", + "summary": "管理员绑定角色", "parameters": [ { "type": "string", "description": "验证参数Bearer和token空格拼接", "name": "Authorization", - "in": "header" + "in": "header", + "required": true }, { "description": "请求参数", @@ -1185,7 +1273,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.SmsReq" + "$ref": "#/definitions/md.BindAdminRoleReq" } } ], @@ -1204,288 +1292,1410 @@ } } } - } - }, - "definitions": { - "md.AccountBase": { - "type": "object", - "properties": { - "admin_phone": { - "type": "string", - "example": "管理员手机号" - }, - "agent_id": { - "type": "string", - "example": "账户ID" - }, - "company_abbreviation": { - "type": "string", - "example": "公司简称" - }, - "company_name": { - "type": "string", - "example": "公司名称" - }, - "contact_address": { - "type": "string", - "example": "联系地址" - }, - "contact_email": { - "type": "string", - "example": "邮箱" - }, - "contact_name": { - "type": "string", - "example": "联系人" - }, - "contact_phone": { - "type": "string", - "example": "联系电话" - }, - "country_region": { - "type": "string", - "example": "国家地区" - }, - "currency_conf": { - "type": "string", - "example": "结算币种" - }, - "nickname": { - "type": "string", - "example": "昵称" + }, + "/api/role/deleteAdmin/{$adm_id}": { + "delete": { + "description": "删除管理员", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "删除管理员", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } } } }, - "md.AccountUpdatePasswordReq": { - "type": "object", - "properties": { - "captcha": { - "type": "string", - "example": "验证码" - }, - "password": { - "type": "string", - "example": "登录密码" + "/api/role/deleteRole/{$id}": { + "delete": { + "description": "删除角色", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "删除角色", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.UpdateRoleStateReq" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } } } }, - "md.AddAdminReq": { - "type": "object", + "/api/role/permissionGroupList": { + "get": { + "description": "权限组列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "权限组列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "管理员id", + "name": "adm_id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "具体看返回内容", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/role/roleBindPermissionGroup": { + "post": { + "description": "角色绑定权限组", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "角色绑定权限组", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.RoleBindPermissionGroupReq" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/role/roleList": { + "get": { + "description": "角色列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "角色列表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "具体看返回内容", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/role/updateAdmin": { + "post": { + "description": "修改管理员信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "修改管理员信息", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.UpdateAdminReq" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/role/updateAdminState": { + "post": { + "description": "修改管理员状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "修改管理员状态", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.UpdateAdminStateReq" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/role/updateRole": { + "post": { + "description": "修改角色", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "修改角色", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.UpdateRoleReq" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/role/updateRoleState": { + "post": { + "description": "修改角色状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ADMIN-权限管理" + ], + "summary": "修改角色状态", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.UpdateRoleStateReq" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/settleCenter/agent/detail": { + "post": { + "description": "结算中心-渠道个人结算报表-详情", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "结算中心------嘉俊" + ], + "summary": "渠道个人结算报表-详情", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.CommDetailReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.SettleCenterDataDetailRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/settleCenter/agent/invoice/save": { + "post": { + "description": "财务中心-渠道个人详情-发票上传", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "财务中心------嘉俊" + ], + "summary": "渠道个人详情-发票上传", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.InvoiceReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/settleCenter/agent/list": { + "post": { + "description": "结算中心-渠道个人结算报表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "结算中心------嘉俊" + ], + "summary": "渠道个人结算报表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.SettleCenterDataReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.SettleCenterDataRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/settleCenter/agent/settle/file/save": { + "post": { + "description": "财务中心-渠道个人详情-结算单保存", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "财务中心------嘉俊" + ], + "summary": "渠道个人详情-结算单保存", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.SettleFileReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/settleCenter/medium/list": { + "post": { + "description": "结算中心-媒体结算报表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "结算中心------嘉俊" + ], + "summary": "媒体结算报表", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.SettleCenterDataReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.SettleCenterMediumDataRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/sms": { + "post": { + "description": "短信-短信发送", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "短信" + ], + "summary": "短信发送", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header" + }, + { + "description": "请求参数", + "name": "args", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.SmsReq" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + } + }, + "definitions": { + "md.AccountBase": { + "type": "object", + "properties": { + "admin_phone": { + "type": "string", + "example": "管理员手机号" + }, + "agent_id": { + "type": "string", + "example": "账户ID" + }, + "company_abbreviation": { + "type": "string", + "example": "公司简称" + }, + "company_name": { + "type": "string", + "example": "公司名称" + }, + "contact_address": { + "type": "string", + "example": "联系地址" + }, + "contact_email": { + "type": "string", + "example": "邮箱" + }, + "contact_name": { + "type": "string", + "example": "联系人" + }, + "contact_phone": { + "type": "string", + "example": "联系电话" + }, + "country_region": { + "type": "string", + "example": "国家地区" + }, + "currency_conf": { + "type": "string", + "example": "结算币种" + }, + "nickname": { + "type": "string", + "example": "昵称" + } + } + }, + "md.AccountUpdatePasswordReq": { + "type": "object", + "properties": { + "captcha": { + "type": "string", + "example": "验证码" + }, + "password": { + "type": "string", + "example": "登录密码" + } + } + }, + "md.AddAdminReq": { + "type": "object", "required": [ "password", "username" ], "properties": { - "memo": { + "memo": { + "type": "string" + }, + "password": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "md.AddRoleReq": { + "type": "object", + "required": [ + "memo", + "name" + ], + "properties": { + "memo": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "md.AdminListReq": { + "type": "object", + "properties": { + "limit": { + "type": "integer" + }, + "page": { + "type": "integer" + }, + "state": { + "type": "integer" + }, + "username": { + "type": "string" + } + } + }, + "md.AgentBankInfo": { + "type": "object", + "properties": { + "agent_id": { + "type": "string" + }, + "bank": { + "type": "string" + }, + "bank_branch": { + "type": "string" + }, + "bank_no": { + "type": "string" + }, + "currency_conf": { + "type": "string" + }, + "id": { + "type": "string" + }, + "licence": { + "type": "string" + }, + "memo": { + "type": "string" + }, + "state": { + "type": "string" + }, + "uuid": { + "type": "string" + } + } + }, + "md.AgentContactInfo": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "agent_id": { + "type": "string" + }, + "email": { + "type": "string" + }, + "id": { + "type": "string" + }, + "memo": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "state": { + "type": "string" + }, + "uuid": { + "type": "string" + } + } + }, + "md.AgentList": { + "type": "object", + "properties": { + "agent_id": { + "type": "string" + }, + "business_license_address": { + "type": "string" + }, + "business_license_img_url": { + "type": "string" + }, + "certificate_first_type": { + "type": "string" + }, + "certificate_type": { + "type": "string" + }, + "certificate_validity": { + "type": "string" + }, + "company_abbreviation": { + "type": "string" + }, + "company_name": { + "type": "string" + }, + "country_region": { + "type": "string" + }, + "country_region_id": { + "type": "string" + }, + "id": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "legal_representative": { + "type": "string" + }, + "memo": { + "type": "string" + }, + "registered_address": { + "type": "string" + }, + "registered_address_city_id": { + "type": "string" + }, + "registered_address_country_id": { + "type": "string" + }, + "registered_address_county_id": { + "type": "string" + }, + "registered_address_province_id": { + "type": "string" + }, + "state": { + "type": "string" + }, + "unified_social_credit_code": { + "type": "string" + }, + "uuid": { + "type": "string" + } + } + }, + "md.BindAdminRoleReq": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "integer" + }, + "role_ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "md.CommDetailReq": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "列表id" + } + } + }, + "md.DataCenterCommissionRecordRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.DataCenterCommissionTotalData" + } + }, + "total": { + "type": "integer" + } + } + }, + "md.DataCenterCommissionTotalData": { + "type": "object", + "properties": { + "adv_name": { "type": "string" }, - "password": { + "all_commission": { + "type": "string", + "example": "预估总佣金" + }, + "app_name": { "type": "string" }, - "username": { + "click_count": { + "type": "string", + "example": "点击量" + }, + "click_rate": { + "type": "string", + "example": "点击率" + }, + "commission": { + "type": "string", + "example": "预估佣金" + }, + "date": { + "type": "string", + "example": "日期" + }, + "ecpm": { + "type": "string", + "example": "ecpm" + }, + "exposure_count": { + "type": "string", + "example": "曝光量" + }, + "other_commission": { + "type": "string", + "example": "额外奖励" + }, + "platform_name": { "type": "string" } } }, - "md.AddRoleReq": { + "md.DataCenterProfitRecordData": { "type": "object", - "required": [ - "memo", - "name" - ], "properties": { - "memo": { + "all_commission": { + "type": "string", + "example": "预估总佣金" + }, + "app_name": { "type": "string" }, - "name": { + "commission": { + "type": "string", + "example": "预估佣金" + }, + "date": { + "type": "string", + "example": "日期" + }, + "other_commission": { + "type": "string", + "example": "额外奖励" + }, + "platform_name": { "type": "string" } } }, - "md.AdminListReq": { + "md.DataCenterProfitRecordOutPutReq": { "type": "object", "properties": { + "app_id": { + "type": "string", + "example": "应用" + }, + "end_date": { + "type": "string", + "example": "2024-08-30" + }, "limit": { - "type": "integer" + "type": "string", + "example": "10000 个一页" }, "page": { - "type": "integer" + "type": "string" }, - "state": { - "type": "integer" + "platform": { + "type": "string", + "example": "平台" }, - "username": { - "type": "string" + "start_date": { + "type": "string", + "example": "2024-08-30 默认查昨天的 最近7天" + }, + "type": { + "type": "string", + "example": "0-日收益 1-月收益 2年收益" } } }, - "md.AgentBankInfo": { + "md.DataCenterProfitRecordReq": { "type": "object", "properties": { - "agent_id": { - "type": "string" + "app_id": { + "type": "string", + "example": "应用" }, - "bank": { - "type": "string" + "end_date": { + "type": "string", + "example": "2024-08-30" }, - "bank_branch": { + "limit": { "type": "string" }, - "bank_no": { + "page": { "type": "string" }, - "currency_conf": { - "type": "string" + "platform": { + "type": "string", + "example": "平台" }, - "id": { - "type": "string" + "start_date": { + "type": "string", + "example": "2024-08-30 默认查昨天的 最近7天" }, - "licence": { - "type": "string" + "type": { + "type": "string", + "example": "0-日收益 1-月收益 2年收益" + } + } + }, + "md.DataCenterProfitRecordRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.DataCenterProfitRecordData" + } }, - "memo": { - "type": "string" + "total": { + "type": "integer" + } + } + }, + "md.DataCenterRecordOutPutReq": { + "type": "object", + "properties": { + "ad_type": { + "type": "string", + "example": "广告位类型" }, - "state": { - "type": "string" + "app_id": { + "type": "string", + "example": "应用" }, - "uuid": { + "end_date": { + "type": "string", + "example": "2024-08-30" + }, + "limit": { + "type": "string", + "example": "10000 个一页" + }, + "page": { "type": "string" + }, + "platform": { + "type": "string", + "example": "平台" + }, + "start_date": { + "type": "string", + "example": "2024-08-30 默认查昨天的 最近7天" } } }, - "md.AgentContactInfo": { + "md.DataCenterRecordReq": { "type": "object", "properties": { - "address": { - "type": "string" - }, - "agent_id": { - "type": "string" + "ad_type": { + "type": "string", + "example": "广告位类型" }, - "email": { - "type": "string" + "app_id": { + "type": "string", + "example": "应用" }, - "id": { - "type": "string" + "end_date": { + "type": "string", + "example": "2024-08-30" }, - "memo": { + "limit": { "type": "string" }, - "name": { + "page": { "type": "string" }, - "phone": { - "type": "string" + "platform": { + "type": "string", + "example": "平台" }, - "state": { - "type": "string" + "start_date": { + "type": "string", + "example": "2024-08-30 默认查昨天的 最近7天" + } + } + }, + "md.DataCenterRecordRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.DataCenterTotalData" + } }, - "uuid": { - "type": "string" + "total": { + "type": "integer" } } }, - "md.AgentList": { + "md.DataCenterTableReq": { "type": "object", "properties": { - "agent_id": { - "type": "string" + "ad_type": { + "type": "string", + "example": "广告位类型" }, - "business_license_address": { - "type": "string" + "app_id": { + "type": "string", + "example": "应用" }, - "business_license_img_url": { - "type": "string" + "end_date": { + "type": "string", + "example": "2024-08-30" }, - "certificate_first_type": { - "type": "string" + "platform": { + "type": "string", + "example": "平台" }, - "certificate_type": { + "start_date": { + "type": "string", + "example": "2024-08-30 默认查昨天的 最近7天" + } + } + }, + "md.DataCenterTotalData": { + "type": "object", + "properties": { + "adv_name": { "type": "string" }, - "certificate_validity": { + "app_name": { "type": "string" }, - "company_abbreviation": { - "type": "string" + "click_count": { + "type": "string", + "example": "点击量" }, - "company_name": { - "type": "string" + "click_rate": { + "type": "string", + "example": "点击率" }, - "country_region": { - "type": "string" + "date": { + "type": "string", + "example": "日期" }, - "country_region_id": { - "type": "string" + "ecpm": { + "type": "string", + "example": "ecpm" }, - "id": { - "type": "string" + "exposure_count": { + "type": "string", + "example": "曝光量" }, - "kind": { - "type": "string" + "media_revenue": { + "type": "string", + "example": "预估收益" }, - "legal_representative": { + "platform_name": { + "type": "string" + } + } + }, + "md.ImgReqUpload": { + "type": "object", + "properties": { + "dir": { "type": "string" }, - "memo": { + "file_name": { "type": "string" }, - "registered_address": { + "file_size": { + "description": "文件大小, 单位byte", + "type": "integer" + } + } + }, + "md.IndexAppListData": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.IndexAppListDataList" + } + }, + "logo": { "type": "string" }, - "registered_address_city_id": { + "name": { "type": "string" }, - "registered_address_country_id": { + "table_list": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "md.IndexAppListDataList": { + "type": "object", + "properties": { + "bili": { "type": "string" }, - "registered_address_county_id": { + "name": { "type": "string" }, - "registered_address_province_id": { + "type": { "type": "string" }, - "state": { + "value": { "type": "string" + } + } + }, + "md.IndexAppListReq": { + "type": "object", + "properties": { + "end_date": { + "type": "string", + "example": "2024-08-30" }, - "unified_social_credit_code": { - "type": "string" + "sort": { + "type": "string", + "example": "排序" }, - "uuid": { - "type": "string" + "start_date": { + "type": "string", + "example": "2024-08-30" } } }, - "md.BindAdminRoleReq": { + "md.IndexAppListRes": { "type": "object", - "required": [ - "id" - ], "properties": { - "id": { - "type": "integer" + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.IndexAppListData" + } }, - "role_ids": { + "sort": { "type": "array", "items": { - "type": "integer" + "$ref": "#/definitions/md.SelectData" } } } }, - "md.ImgReqUpload": { + "md.Invoice": { "type": "object", "properties": { - "dir": { + "count": { "type": "string" }, - "file_name": { + "file": { + "type": "array", + "items": { + "$ref": "#/definitions/md.InvoiceFile" + } + }, + "time": { "type": "string" }, - "file_size": { - "description": "文件大小, 单位byte", - "type": "integer" + "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" + }, + "type": { + "type": "string", + "example": "0电子发票 1纸质发票" } } }, @@ -1642,6 +2852,291 @@ } } }, + "md.SettleCenterDataData": { + "type": "object", + "properties": { + "all_income": { + "type": "string", + "example": "合计收益" + }, + "business_kind": { + "type": "string", + "example": "业务类型(1:广告合作)" + }, + "id": { + "type": "string" + }, + "income": { + "type": "string", + "example": "基础收益" + }, + "label": { + "type": "string" + }, + "other_income": { + "type": "string", + "example": "其他调整" + }, + "pay_state": { + "type": "string", + "example": "结算单支付状态(0:未开始 1:待审核发票 2:发票审核中 3:发票审核拒绝 4:付款中 5:已付款)" + }, + "settle_file": { + "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": "业务时间" + } + } + }, + "md.SettleCenterDataDetail": { + "type": "object", + "properties": { + "all_income": { + "type": "string", + "example": "合计收益" + }, + "business_kind": { + "type": "string", + "example": "业务类型(1:广告合作)" + }, + "invoice": { + "$ref": "#/definitions/md.Invoice" + }, + "medium_income": { + "type": "string", + "example": "媒体结算" + }, + "other_income": { + "type": "string", + "example": "其他调整" + }, + "pay_state": { + "type": "string", + "example": "结算单支付状态(0:未开始 1:待审核发票 2:发票审核中 3:发票审核拒绝 4:付款中 5:已付款)" + }, + "settle_file": { + "type": "string", + "example": "结算单" + }, + "state": { + "type": "string", + "example": "结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订)" + }, + "time_str": { + "type": "string", + "example": "业务时间" + } + } + }, + "md.SettleCenterDataDetailRes": { + "type": "object", + "properties": { + "business_kind": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "data": { + "$ref": "#/definitions/md.SettleCenterDataDetail" + }, + "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.SettleCenterDataReq": { + "type": "object", + "properties": { + "end_time": { + "type": "string" + }, + "limit": { + "type": "string" + }, + "page": { + "type": "string" + }, + "start_time": { + "type": "string", + "example": "2024-08-29" + } + } + }, + "md.SettleCenterDataRes": { + "type": "object", + "properties": { + "business_kind": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SettleCenterDataData" + } + }, + "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.SettleCenterMediumDataData": { + "type": "object", + "properties": { + "all_income": { + "type": "string", + "example": "合计收益" + }, + "business_kind": { + "type": "string", + "example": "业务类型(1:广告合作)" + }, + "id": { + "type": "string" + }, + "income": { + "type": "string", + "example": "基础收益" + }, + "label": { + "type": "string" + }, + "name": { + "type": "string", + "example": "媒体名称" + }, + "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.SettleCenterMediumDataRes": { + "type": "object", + "properties": { + "business_kind": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SettleCenterMediumDataData" + } + }, + "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.SettleFileReq": { + "type": "object", + "properties": { + "file": { + "type": "string", + "example": "七牛云链接 带http" + }, + "id": { + "type": "string", + "example": "列表id" + } + } + }, "md.SmsReq": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 947baba..07d6f9b 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -179,6 +179,226 @@ definitions: required: - id type: object + md.CommDetailReq: + properties: + id: + example: 列表id + type: string + type: object + md.DataCenterCommissionRecordRes: + properties: + list: + items: + $ref: '#/definitions/md.DataCenterCommissionTotalData' + type: array + total: + type: integer + type: object + md.DataCenterCommissionTotalData: + properties: + adv_name: + type: string + all_commission: + example: 预估总佣金 + type: string + app_name: + type: string + click_count: + example: 点击量 + type: string + click_rate: + example: 点击率 + type: string + commission: + example: 预估佣金 + type: string + date: + example: 日期 + type: string + ecpm: + example: ecpm + type: string + exposure_count: + example: 曝光量 + type: string + other_commission: + example: 额外奖励 + type: string + platform_name: + type: string + type: object + md.DataCenterProfitRecordData: + properties: + all_commission: + example: 预估总佣金 + type: string + app_name: + type: string + commission: + example: 预估佣金 + type: string + date: + example: 日期 + type: string + other_commission: + example: 额外奖励 + type: string + platform_name: + type: string + type: object + md.DataCenterProfitRecordOutPutReq: + properties: + app_id: + example: 应用 + type: string + end_date: + example: "2024-08-30" + type: string + limit: + example: 10000 个一页 + type: string + page: + type: string + platform: + example: 平台 + type: string + start_date: + example: 2024-08-30 默认查昨天的 最近7天 + type: string + type: + example: 0-日收益 1-月收益 2年收益 + type: string + type: object + md.DataCenterProfitRecordReq: + properties: + app_id: + example: 应用 + type: string + end_date: + example: "2024-08-30" + type: string + limit: + type: string + page: + type: string + platform: + example: 平台 + type: string + start_date: + example: 2024-08-30 默认查昨天的 最近7天 + type: string + type: + example: 0-日收益 1-月收益 2年收益 + type: string + type: object + md.DataCenterProfitRecordRes: + properties: + list: + items: + $ref: '#/definitions/md.DataCenterProfitRecordData' + type: array + total: + type: integer + type: object + md.DataCenterRecordOutPutReq: + properties: + ad_type: + example: 广告位类型 + type: string + app_id: + example: 应用 + type: string + end_date: + example: "2024-08-30" + type: string + limit: + example: 10000 个一页 + type: string + page: + type: string + platform: + example: 平台 + type: string + start_date: + example: 2024-08-30 默认查昨天的 最近7天 + type: string + type: object + md.DataCenterRecordReq: + properties: + ad_type: + example: 广告位类型 + type: string + app_id: + example: 应用 + type: string + end_date: + example: "2024-08-30" + type: string + limit: + type: string + page: + type: string + platform: + example: 平台 + type: string + start_date: + example: 2024-08-30 默认查昨天的 最近7天 + type: string + type: object + md.DataCenterRecordRes: + properties: + list: + items: + $ref: '#/definitions/md.DataCenterTotalData' + type: array + total: + type: integer + type: object + md.DataCenterTableReq: + properties: + ad_type: + example: 广告位类型 + type: string + app_id: + example: 应用 + type: string + end_date: + example: "2024-08-30" + type: string + platform: + example: 平台 + type: string + start_date: + example: 2024-08-30 默认查昨天的 最近7天 + type: string + type: object + md.DataCenterTotalData: + properties: + adv_name: + type: string + app_name: + type: string + click_count: + example: 点击量 + type: string + click_rate: + example: 点击率 + type: string + date: + example: 日期 + type: string + ecpm: + example: ecpm + type: string + exposure_count: + example: 曝光量 + type: string + media_revenue: + example: 预估收益 + type: string + platform_name: + type: string + type: object md.ImgReqUpload: properties: dir: @@ -189,6 +409,89 @@ definitions: description: 文件大小, 单位byte type: integer type: object + md.IndexAppListData: + properties: + list: + items: + $ref: '#/definitions/md.IndexAppListDataList' + type: array + logo: + type: string + name: + type: string + table_list: + items: + type: string + type: array + type: object + md.IndexAppListDataList: + properties: + bili: + type: string + name: + type: string + type: + type: string + value: + type: string + type: object + md.IndexAppListReq: + properties: + end_date: + example: "2024-08-30" + type: string + sort: + example: 排序 + type: string + start_date: + example: "2024-08-30" + type: string + type: object + md.IndexAppListRes: + properties: + list: + items: + $ref: '#/definitions/md.IndexAppListData' + type: array + sort: + items: + $ref: '#/definitions/md.SelectData' + type: array + type: object + md.Invoice: + properties: + count: + type: string + file: + items: + $ref: '#/definitions/md.InvoiceFile' + type: array + time: + type: string + type: + type: string + type: object + md.InvoiceFile: + properties: + state: + example: 0待确认 1审核通过 2审核失败 + type: string + url: + type: string + type: object + md.InvoiceReq: + properties: + file: + items: + $ref: '#/definitions/md.InvoiceFile' + type: array + id: + example: 列表id + type: string + type: + example: 0电子发票 1纸质发票 + type: string + type: object md.LoginPhoneReq: properties: captcha: @@ -295,6 +598,203 @@ definitions: example: 值 type: string type: object + md.SettleCenterDataData: + properties: + all_income: + example: 合计收益 + type: string + business_kind: + example: 业务类型(1:广告合作) + type: string + id: + type: string + income: + example: 基础收益 + type: string + label: + type: string + other_income: + example: 其他调整 + type: string + pay_state: + example: 结算单支付状态(0:未开始 1:待审核发票 2:发票审核中 3:发票审核拒绝 4:付款中 5:已付款) + type: string + settle_file: + example: 结算单 + type: string + settle_type: + example: 结算单类型(1:日结 2:周结 3:月结 4:预付) + type: string + state: + example: 结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订) + type: string + time_str: + example: 业务时间 + type: string + type: object + md.SettleCenterDataDetail: + properties: + all_income: + example: 合计收益 + type: string + business_kind: + example: 业务类型(1:广告合作) + type: string + invoice: + $ref: '#/definitions/md.Invoice' + medium_income: + example: 媒体结算 + type: string + other_income: + example: 其他调整 + type: string + pay_state: + example: 结算单支付状态(0:未开始 1:待审核发票 2:发票审核中 3:发票审核拒绝 4:付款中 5:已付款) + type: string + settle_file: + example: 结算单 + type: string + state: + example: 结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订) + type: string + time_str: + example: 业务时间 + type: string + type: object + md.SettleCenterDataDetailRes: + properties: + business_kind: + items: + $ref: '#/definitions/md.SelectData' + type: array + data: + $ref: '#/definitions/md.SettleCenterDataDetail' + invoice_cate: + items: + $ref: '#/definitions/md.SelectData' + type: array + invoice_state: + items: + $ref: '#/definitions/md.SelectData' + type: array + settle_pay_state: + items: + $ref: '#/definitions/md.SelectData' + type: array + settle_state: + items: + $ref: '#/definitions/md.SelectData' + type: array + settle_type: + items: + $ref: '#/definitions/md.SelectData' + type: array + type: object + md.SettleCenterDataReq: + properties: + end_time: + type: string + limit: + type: string + page: + type: string + start_time: + example: "2024-08-29" + type: string + type: object + md.SettleCenterDataRes: + properties: + business_kind: + items: + $ref: '#/definitions/md.SelectData' + type: array + list: + items: + $ref: '#/definitions/md.SettleCenterDataData' + type: array + settle_pay_state: + items: + $ref: '#/definitions/md.SelectData' + type: array + settle_state: + items: + $ref: '#/definitions/md.SelectData' + type: array + settle_type: + items: + $ref: '#/definitions/md.SelectData' + type: array + total: + type: integer + type: object + md.SettleCenterMediumDataData: + properties: + all_income: + example: 合计收益 + type: string + business_kind: + example: 业务类型(1:广告合作) + type: string + id: + type: string + income: + example: 基础收益 + type: string + label: + type: string + name: + example: 媒体名称 + type: string + other_income: + example: 其他调整 + type: string + pay_state: + example: 结算单支付状态(0:未开始 1:待审核发票 2:发票审核中 3:发票审核拒绝 4:付款中 5:已付款) + type: string + settle_type: + example: 结算单类型(1:日结 2:周结 3:月结 4:预付) + type: string + state: + example: 结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订) + type: string + time_str: + example: 业务时间 + type: string + type: object + md.SettleCenterMediumDataRes: + properties: + business_kind: + items: + $ref: '#/definitions/md.SelectData' + type: array + list: + items: + $ref: '#/definitions/md.SettleCenterMediumDataData' + type: array + settle_pay_state: + items: + $ref: '#/definitions/md.SelectData' + type: array + settle_state: + items: + $ref: '#/definitions/md.SelectData' + type: array + settle_type: + items: + $ref: '#/definitions/md.SelectData' + type: array + total: + type: integer + type: object + md.SettleFileReq: + properties: + file: + example: 七牛云链接 带http + type: string + id: + example: 列表id + type: string + type: object md.SmsReq: properties: phone: @@ -369,32 +869,299 @@ paths: get: consumes: - application/json - description: 账号信息 + description: 账号信息 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + produces: + - application/json + responses: + "200": + description: 具体看返回内容 + schema: + $ref: '#/definitions/md.AccountBase' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 账号信息 + tags: + - 账号中心------嘉俊 + /api/account/qualification/bank/save: + post: + consumes: + - application/json + description: 资质认证-银行资质保存 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.AgentBankInfo' + produces: + - application/json + responses: + "200": + description: 具体看返回内容 + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 银行资质保存 + tags: + - 资质认证------嘉俊 + /api/account/qualification/contact/save: + post: + consumes: + - application/json + description: 资质认证-联系方式保存 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.AgentContactInfo' + produces: + - application/json + responses: + "200": + description: 具体看返回内容 + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 联系方式保存 + tags: + - 资质认证------嘉俊 + /api/account/qualification/enterprise/save: + post: + consumes: + - application/json + description: 资质认证-企业认证保存 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.AgentList' + produces: + - application/json + responses: + "200": + description: 具体看返回内容 + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 企业认证保存 + tags: + - 资质认证------嘉俊 + /api/account/qualification/info: + get: + consumes: + - application/json + description: 资质认证-基本信息 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + produces: + - application/json + responses: + "200": + description: 具体看返回内容 + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 基本信息 + tags: + - 资质认证------嘉俊 + /api/account/qualification/select/base: + get: + consumes: + - application/json + description: 资质认证-认证下拉框选择内容 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + produces: + - application/json + responses: + "200": + description: 具体看返回内容 + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 认证下拉框选择内容 + tags: + - 资质认证------嘉俊 + /api/account/update/password: + post: + consumes: + - application/json + description: 资质认证-企业认证保存 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.AccountUpdatePasswordReq' + produces: + - application/json + responses: + "200": + description: 具体看返回内容 + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 企业认证保存 + tags: + - 账号中心------嘉俊 + /api/dataCenter/commission/record/list: + post: + consumes: + - application/json + description: 数据中心-佣金收益-数据明细 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.DataCenterRecordReq' + produces: + - application/json + responses: + "200": + description: 具体看返回内容 这是data里面的数据 + schema: + $ref: '#/definitions/md.DataCenterCommissionRecordRes' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 佣金收益-数据明细 + tags: + - 数据中心------嘉俊 + /api/dataCenter/commission/record/output: + post: + consumes: + - application/json + description: 数据中心-佣金收益-数据明细-导出 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.DataCenterRecordOutPutReq' + produces: + - application/json + responses: + "200": + description: 具体看返回内容 这是data里面的数据 + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 佣金收益-数据明细-导出 + tags: + - 数据中心------嘉俊 + /api/dataCenter/commission/record/total: + post: + consumes: + - application/json + description: 数据中心-佣金收益-明细合计 parameters: - description: 验证参数Bearer和token空格拼接 in: header name: Authorization required: true type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.DataCenterTableReq' produces: - application/json responses: "200": - description: 具体看返回内容 + description: 具体看返回内容 这是data里面的数据 schema: - $ref: '#/definitions/md.AccountBase' + $ref: '#/definitions/md.DataCenterCommissionTotalData' "400": description: 具体错误 schema: $ref: '#/definitions/md.Response' - summary: 账号信息 + summary: 佣金收益-明细合计 tags: - - 账号中心------嘉俊 - /api/account/qualification/bank/save: + - 数据中心------嘉俊 + /api/dataCenter/profit/record/list: post: consumes: - application/json - description: 资质认证-银行资质保存 + description: 数据中心-分润收益-数据明细 parameters: - description: 验证参数Bearer和token空格拼接 in: header @@ -406,26 +1173,26 @@ paths: name: args required: true schema: - $ref: '#/definitions/md.AgentBankInfo' + $ref: '#/definitions/md.DataCenterProfitRecordReq' produces: - application/json responses: "200": - description: 具体看返回内容 + description: 具体看返回内容 这是data里面的数据 schema: - type: string + $ref: '#/definitions/md.DataCenterProfitRecordRes' "400": description: 具体错误 schema: $ref: '#/definitions/md.Response' - summary: 银行资质保存 + summary: 分润收益-数据明细 tags: - - 资质认证------嘉俊 - /api/account/qualification/contact/save: + - 数据中心------嘉俊 + /api/dataCenter/profit/record/output: post: consumes: - application/json - description: 资质认证-联系方式保存 + description: 数据中心-分润收益-数据明细-导出 parameters: - description: 验证参数Bearer和token空格拼接 in: header @@ -437,26 +1204,26 @@ paths: name: args required: true schema: - $ref: '#/definitions/md.AgentContactInfo' + $ref: '#/definitions/md.DataCenterProfitRecordOutPutReq' produces: - application/json responses: "200": - description: 具体看返回内容 + description: 具体看返回内容 这是data里面的数据 schema: type: string "400": description: 具体错误 schema: $ref: '#/definitions/md.Response' - summary: 联系方式保存 + summary: 分润收益-数据明细-导出 tags: - - 资质认证------嘉俊 - /api/account/qualification/enterprise/save: + - 数据中心------嘉俊 + /api/dataCenter/record/list: post: consumes: - application/json - description: 资质认证-企业认证保存 + description: 数据中心-数据明细 parameters: - description: 验证参数Bearer和token空格拼接 in: header @@ -468,51 +1235,88 @@ paths: name: args required: true schema: - $ref: '#/definitions/md.AgentList' + $ref: '#/definitions/md.DataCenterRecordReq' produces: - application/json responses: "200": - description: 具体看返回内容 + description: 具体看返回内容 这是data里面的数据 schema: - type: string + $ref: '#/definitions/md.DataCenterRecordRes' "400": description: 具体错误 schema: $ref: '#/definitions/md.Response' - summary: 企业认证保存 + summary: 数据明细 tags: - - 资质认证------嘉俊 - /api/account/qualification/info: - get: + - 数据中心------嘉俊 + /api/dataCenter/record/output: + post: consumes: - application/json - description: 资质认证-基本信息 + description: 数据中心-数据明细-导出 parameters: - description: 验证参数Bearer和token空格拼接 in: header name: Authorization required: true type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.DataCenterRecordOutPutReq' produces: - application/json responses: "200": - description: 具体看返回内容 + description: 具体看返回内容 这是data里面的数据 schema: type: string "400": description: 具体错误 schema: $ref: '#/definitions/md.Response' - summary: 基本信息 + summary: 数据明细-导出 tags: - - 资质认证------嘉俊 - /api/account/qualification/select/base: + - 数据中心------嘉俊 + /api/dataCenter/record/total: + post: + consumes: + - application/json + description: 数据中心-数据明细合计 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.DataCenterTableReq' + produces: + - application/json + responses: + "200": + description: 具体看返回内容 这是data里面的数据 + schema: + $ref: '#/definitions/md.DataCenterTotalData' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 数据明细合计 + tags: + - 数据中心------嘉俊 + /api/dataCenter/select/data: get: consumes: - application/json - description: 资质认证-认证下拉框选择内容 + description: 数据中心-筛选条件 parameters: - description: 验证参数Bearer和token空格拼接 in: header @@ -523,21 +1327,21 @@ paths: - application/json responses: "200": - description: 具体看返回内容 + description: 具体看返回内容 这是data里面的数据 schema: type: string "400": description: 具体错误 schema: $ref: '#/definitions/md.Response' - summary: 认证下拉框选择内容 + summary: 筛选条件 tags: - - 资质认证------嘉俊 - /api/account/update/password: + - 数据中心------嘉俊 + /api/index/app/list: post: consumes: - application/json - description: 资质认证-企业认证保存 + description: 数据中心-数据明细 parameters: - description: 验证参数Bearer和token空格拼接 in: header @@ -549,21 +1353,71 @@ paths: name: args required: true schema: - $ref: '#/definitions/md.AccountUpdatePasswordReq' + $ref: '#/definitions/md.IndexAppListReq' produces: - application/json responses: "200": - description: 具体看返回内容 + description: 具体看返回内容 这是data里面的数据 + schema: + $ref: '#/definitions/md.IndexAppListRes' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 数据明细 + tags: + - 数据中心------嘉俊 + /api/index/base: + get: + consumes: + - application/json + description: 首页-右上角基本数据 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + produces: + - application/json + responses: + "200": + description: 具体看返回内容 这是data里面的数据 schema: type: string "400": description: 具体错误 schema: $ref: '#/definitions/md.Response' - summary: 企业认证保存 + summary: 右上角基本数据 tags: - - 账号中心------嘉俊 + - 首页------嘉俊 + /api/index/total: + get: + consumes: + - application/json + description: 首页-统计数据 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + produces: + - application/json + responses: + "200": + description: 具体看返回内容 这是data里面的数据 + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 统计数据 + tags: + - 首页------嘉俊 /api/login: post: consumes: @@ -1117,6 +1971,161 @@ paths: summary: 修改角色状态 tags: - ADMIN-权限管理 + /api/settleCenter/agent/detail: + post: + consumes: + - application/json + description: 结算中心-渠道个人结算报表-详情 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.CommDetailReq' + produces: + - application/json + responses: + "200": + description: 具体看返回内容 这是data里面的数据 + schema: + $ref: '#/definitions/md.SettleCenterDataDetailRes' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 渠道个人结算报表-详情 + tags: + - 结算中心------嘉俊 + /api/settleCenter/agent/invoice/save: + post: + consumes: + - application/json + description: 财务中心-渠道个人详情-发票上传 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.InvoiceReq' + produces: + - application/json + responses: + "200": + description: 具体看返回内容 这是data里面的数据 + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 渠道个人详情-发票上传 + tags: + - 财务中心------嘉俊 + /api/settleCenter/agent/list: + post: + consumes: + - application/json + description: 结算中心-渠道个人结算报表 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.SettleCenterDataReq' + produces: + - application/json + responses: + "200": + description: 具体看返回内容 这是data里面的数据 + schema: + $ref: '#/definitions/md.SettleCenterDataRes' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 渠道个人结算报表 + tags: + - 结算中心------嘉俊 + /api/settleCenter/agent/settle/file/save: + post: + consumes: + - application/json + description: 财务中心-渠道个人详情-结算单保存 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.SettleFileReq' + produces: + - application/json + responses: + "200": + description: 具体看返回内容 这是data里面的数据 + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 渠道个人详情-结算单保存 + tags: + - 财务中心------嘉俊 + /api/settleCenter/medium/list: + post: + consumes: + - application/json + description: 结算中心-媒体结算报表 + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 请求参数 + in: body + name: args + required: true + schema: + $ref: '#/definitions/md.SettleCenterDataReq' + produces: + - application/json + responses: + "200": + description: 具体看返回内容 这是data里面的数据 + schema: + $ref: '#/definitions/md.SettleCenterMediumDataRes' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 媒体结算报表 + tags: + - 结算中心------嘉俊 /api/sms: post: consumes: diff --git a/go.mod b/go.mod index c0991cd..a520be8 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,6 @@ go 1.18 require ( code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git v1.1.21-0.20240821062104-50d608c7fd6a - code.fnuoos.com/zhimeng/model.git v0.0.3-0.20240823034048-34202e969e8d github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 github.com/boombuler/barcode v1.0.1 github.com/dchest/uniuri v0.0.0-20200228104902-7aecb25e1fe5 @@ -37,6 +36,11 @@ require ( xorm.io/xorm v1.3.2 ) +require ( + code.fnuoos.com/zhimeng/model.git v0.0.3-0.20240831030801-8c60631f7b95 + github.com/360EntSecGroup-Skylar/excelize v1.4.1 +) + require ( filippo.io/edwards25519 v1.1.0 // indirect github.com/KyleBanks/depth v1.2.1 // indirect @@ -73,6 +77,7 @@ require ( github.com/mattn/go-isatty v0.0.19 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/pelletier/go-toml/v2 v2.0.6 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect