From 77cd85a06567b4e8b43a03073c5247a1bfe8fd98 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sat, 31 Aug 2024 09:20:20 +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 | 9 + app/hdl/hdl_data_center.go | 98 ++ app/hdl/hdl_invoice_center.go | 59 + app/hdl/hdl_login.go | 15 + app/hdl/hdl_settle_center.go | 105 ++ app/md/comm.go | 11 + .../md__applet_application_ad_space_list.go | 1 + app/md/md_data_center.go | 45 + app/md/md_invoice_center.go | 32 + app/md/md_settle_center.go | 104 ++ app/router/router.go | 24 +- app/svc/svc_applet_application_ad_space.go | 9 +- app/svc/svc_data_center.go | 205 ++++ app/svc/svc_invoice_center.go | 55 + app/svc/svc_settle_center.go | 147 +++ app/utils/rand.go | 27 +- docs/docs.go | 1058 ++++++++++++++++- docs/swagger.json | 1058 ++++++++++++++++- docs/swagger.yaml | 650 ++++++++++ go.mod | 4 +- 20 files changed, 3595 insertions(+), 121 deletions(-) create mode 100644 app/hdl/hdl_data_center.go create mode 100644 app/hdl/hdl_invoice_center.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_invoice_center.go create mode 100644 app/md/md_settle_center.go create mode 100644 app/svc/svc_data_center.go create mode 100644 app/svc/svc_invoice_center.go create mode 100644 app/svc/svc_settle_center.go diff --git a/app/enum/adunit_enum.go b/app/enum/adunit_enum.go index e83088a..1e173d9 100644 --- a/app/enum/adunit_enum.go +++ b/app/enum/adunit_enum.go @@ -1,6 +1,15 @@ 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" diff --git a/app/hdl/hdl_data_center.go b/app/hdl/hdl_data_center.go new file mode 100644 index 0000000..3377124 --- /dev/null +++ b/app/hdl/hdl_data_center.go @@ -0,0 +1,98 @@ +package hdl + +import ( + "applet/app/e" + "applet/app/lib/validate" + "applet/app/md" + "applet/app/svc" + "github.com/gin-gonic/gin" +) + +// DataCenterTable +// @Summary 数据图表 +// @Tags 数据中心------嘉俊 +// @Description 数据中心-数据图表 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.DataCenterTableReq true "请求参数" +// @Success 200 {object} md.DataCenterTableRes "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/dataCenter/table [POST] +func DataCenterTable(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 + } + res := svc.DataCenterTable(c, req) + e.OutSuc(c, res, nil) + return +} + +// 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 + } + 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 + } + res := svc.DataCenterRecordList(c, req) + e.OutSuc(c, res, nil) + 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) +} diff --git a/app/hdl/hdl_invoice_center.go b/app/hdl/hdl_invoice_center.go new file mode 100644 index 0000000..75b3963 --- /dev/null +++ b/app/hdl/hdl_invoice_center.go @@ -0,0 +1,59 @@ +package hdl + +import ( + "applet/app/e" + "applet/app/lib/validate" + "applet/app/md" + "applet/app/svc" + "github.com/gin-gonic/gin" +) + +// InvoiceCenterList +// @Summary 发票列表 +// @Tags 发票中心------嘉俊 +// @Description 发票中心-发票列表 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.InvoiceCenterDataReq true "请求参数" +// @Success 200 {object} md.InvoiceCenterDataRes "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/invoiceCenter/list [POST] +func InvoiceCenterList(c *gin.Context) { + var req md.InvoiceCenterDataReq + 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.InvoiceCenterList(c, req) + e.OutSuc(c, res, nil) + return +} + +// InvoiceCenterDetail +// @Summary 发票详情 +// @Tags 发票中心------嘉俊 +// @Description 发票中心-发票详情 +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Accept json +// @Produce json +// @Param args body md.CommDetailReq true "请求参数" +// @Success 200 {object} md.InvoiceCenterDataDetailRes "具体看返回内容 这是data里面的数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/invoiceCenter/detail [POST] +func InvoiceCenterDetail(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.InvoiceCenterDetail(c, req) + e.OutSuc(c, res, nil) + return +} diff --git a/app/hdl/hdl_login.go b/app/hdl/hdl_login.go index 8a74bba..5297662 100644 --- a/app/hdl/hdl_login.go +++ b/app/hdl/hdl_login.go @@ -200,6 +200,21 @@ func Register(c *gin.Context) { e.OutErr(c, e.ERR_DB_ORM, "新增 medium 记录失败") return } + //4、新增 MediumDivisionStrategy 记录 + MediumDivisionStrategyModel := model.MediumDivisionStrategy{ + MediumId: utils.StrToInt(mediumId), + Uuid: utils.StrToInt(c.GetString("mid")), + CreateAt: now.Format("2006-01-02 15:04:05"), + UpdateAt: now.Format("2006-01-02 15:04:05"), + } + insertAffected, err = db.Db.Insert(&MediumDivisionStrategyModel) + if err != nil { + return + } + if insertAffected <= 0 { + e.OutErr(c, e.ERR_DB_ORM, "新增 记录失败") + return + } ip := utils.GetIP(c.Request) key := fmt.Sprintf(md.JwtTokenKey, ip, utils.AnyToString(mediumModel.Id)) token, err := svc.HandleLoginToken(key, &mediumModel) diff --git a/app/hdl/hdl_settle_center.go b/app/hdl/hdl_settle_center.go new file mode 100644 index 0000000..1d714eb --- /dev/null +++ b/app/hdl/hdl_settle_center.go @@ -0,0 +1,105 @@ +package hdl + +import ( + "applet/app/e" + "applet/app/lib/validate" + "applet/app/md" + "applet/app/svc" + "github.com/gin-gonic/gin" +) + +// 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/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/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/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/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__applet_application_ad_space_list.go b/app/md/md__applet_application_ad_space_list.go index af59a89..d54541c 100644 --- a/app/md/md__applet_application_ad_space_list.go +++ b/app/md/md__applet_application_ad_space_list.go @@ -28,6 +28,7 @@ type AppletApplicationAdSpaceListData struct { AdId string `json:"ad_id" example:"广告位id"` State string `json:"state" example:"应用状态 state=2 才能再次编辑"` CooperateState string `json:"cooperate_state" example:"合作状态"` + AppName string `json:"app_name"` } type AppletApplicationAdSpaceSaveReq struct { Name string `json:"name" example:"应用名称"` diff --git a/app/md/md_data_center.go b/app/md/md_data_center.go new file mode 100644 index 0000000..be012d3 --- /dev/null +++ b/app/md/md_data_center.go @@ -0,0 +1,45 @@ +package md + +type DataCenterTableReq struct { + StartDate string `json:"start_date" example:"2024-08-30"` + 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"` + 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 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 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:"点击量"` +} diff --git a/app/md/md_invoice_center.go b/app/md/md_invoice_center.go new file mode 100644 index 0000000..274cdcf --- /dev/null +++ b/app/md/md_invoice_center.go @@ -0,0 +1,32 @@ +package md + +type InvoiceCenterDataReq struct { + Limit string `json:"limit"` + Page string `json:"page" ` + Type string `json:"type" example:"0电子发票 1纸质发票"` +} + +type InvoiceCenterDataRes struct { + List []InvoiceCenterDataData `json:"list" ` + Total int64 `json:"total"` + State []SelectData `json:"state"` +} + +type InvoiceCenterDataData struct { + Id string `json:"id"` + TimeStr string `json:"time_str" example:"上传时间"` + State string `json:"state" example:"结算单状态(0:待审核 1:审核通过 2:审核拒绝)"` + Count string `json:"count" example:"数量"` + Month string `json:"month" example:"订单月份"` + Amount string `json:"amount" example:"结算金额"` +} +type InvoiceCenterDataDetailRes struct { + Data InvoiceCenterDataDetailData `json:"data" ` + State []SelectData `json:"state"` +} +type InvoiceCenterDataDetailData struct { + TimeStr string `json:"time_str" example:"上传时间"` + State string `json:"state" example:"结算单状态(0:待审核 1:审核通过 2:审核拒绝)"` + Count string `json:"count" example:"数量"` + File []InvoiceFile `json:"file"` +} diff --git a/app/md/md_settle_center.go b/app/md/md_settle_center.go new file mode 100644 index 0000000..10c93b0 --- /dev/null +++ b/app/md/md_settle_center.go @@ -0,0 +1,104 @@ +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:"合计收益"` + 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:完成签订)"` + Label string `json:"label"` + SettleFile string `json:"settle_file" example:"结算单"` +} + +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 7cef74a..81cc16d 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -67,8 +67,11 @@ func route(r *gin.RouterGroup) { r.Use(mw.Auth) // 以下接口需要JWT验证 rRole(r.Group("/role")) //权限管理 - rApplication(r.Group("/application")) //应用管理 - rAccount(r.Group("/account")) //账号中心 + rApplication(r.Group("/application")) //应用管理 + rAccount(r.Group("/account")) //账号中心 + rSettleCenter(r.Group("/settleCenter")) //结算中心 + rInvoiceCenter(r.Group("/invoiceCenter")) //发票中心 + rDataCenter(r.Group("/dataCenter")) //数据中心 } func rRole(r *gin.RouterGroup) { @@ -102,3 +105,20 @@ func rApplication(r *gin.RouterGroup) { r.POST("/applet/ad/space/list", hdl.AppletApplicationAdSpaceList) //小程序应用-广告位列表数据 r.POST("/applet/ad/space/save", hdl.AppletApplicationAdSpaceSave) //小程序应用-广告位新增 } +func rSettleCenter(r *gin.RouterGroup) { + r.POST("/list", hdl.SettleCenterList) //结算中心-结算报表 + r.POST("/detail", hdl.SettleCenterDetail) //结算中心-结算报表-详情 + r.POST("/settle/file/save", hdl.SettleCenterSettleFileSave) //结算中心-结算报表-结算单上传 + r.POST("/invoice/save", hdl.SettleCenterInvoiceSave) //结算中心-结算报表-发票上传 +} +func rInvoiceCenter(r *gin.RouterGroup) { + r.POST("/list", hdl.InvoiceCenterList) //发票中心-列表 + r.POST("/detail", hdl.InvoiceCenterDetail) //发票中心-详情 +} + +func rDataCenter(r *gin.RouterGroup) { + r.GET("/select/data", hdl.DataCenterSelectData) //数据中心-筛选条件 + r.POST("/table", hdl.DataCenterTable) //数据中心-数据图表 + r.POST("/record/total", hdl.DataCenterRecordTotal) //数据中心-数据明细合计 + r.POST("/record/list", hdl.DataCenterRecordList) //数据中心-数据明细 +} diff --git a/app/svc/svc_applet_application_ad_space.go b/app/svc/svc_applet_application_ad_space.go index 259b2d3..b175249 100644 --- a/app/svc/svc_applet_application_ad_space.go +++ b/app/svc/svc_applet_application_ad_space.go @@ -32,6 +32,7 @@ func AppletApplicationAdSpaceList(c *gin.Context) { var tmp = md.AppletApplicationAdSpaceListData{ Id: utils.IntToStr(v.AppletApplicationAdSpaceList.Id), Name: v.AppletApplicationAdSpaceList.Name, + AppName: v.AppletApplication.Name, Platform: v.Platform, Kind: v.Kind, Memo: v.AppletApplicationAdSpaceList.Memo, @@ -60,13 +61,7 @@ func AppletApplicationAdSpaceList(c *gin.Context) { List: data, Total: total, Application: application, - AdType: []md.SelectData{ - {Name: "banner", Value: enum.AdunitTypeForBanner}, - {Name: "激励视频", Value: enum.AdunitTypeForRewardVideo}, - {Name: "插屏广告", Value: enum.AdunitTypeForInterstitial}, - {Name: "视频广告", Value: enum.AdunitTypeForVideoFeeds}, - //{Name: "视频贴片广告", Value: "5"}, - }, + AdType: enum.AdTypeList, Platform: []md.SelectData{ {Name: "微信小程序", Value: "wx_applet"}, }, diff --git a/app/svc/svc_data_center.go b/app/svc/svc_data_center.go new file mode 100644 index 0000000..f1700c8 --- /dev/null +++ b/app/svc/svc_data_center.go @@ -0,0 +1,205 @@ +package svc + +import ( + "applet/app/e" + "applet/app/enum" + "applet/app/md" + "applet/app/utils" + 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 DataCenterTable(c *gin.Context, req md.DataCenterTableReq) md.DataCenterTableRes { + var req1 md.DataCenterRecordReq + copier.Copy(&req1, &req) + nativeString, _ := comm(c, 0, req1) + list := make([]md.DataCenterTableData, 0) + for _, v := range nativeString { + tmp := md.DataCenterTableData{ + Date: v["date"], + ExposureCount: v["exposure_count"], + MediaRevenue: v["media_revenue"], + Ecpm: v["ecpm"], + } + list = append(list, tmp) + } + res := md.DataCenterTableRes{ + List: list, + } + return res +} +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_rate) as click_rate, + SUM(ecpm) as ecpm, + SUM(media_revenue) as media_revenue + FROM generate_wx_ad_data + where %s +` + 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 + "'" + } + 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: v["media_revenue"], + Ecpm: v["ecpm"], + ClickRate: v["click_rate"], + 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 + } + tmp := md.DataCenterTotalData{ + Date: v["date"], + AppName: name, + PlatformName: md.AppletPlatformMap[platform], + AdvName: enum.AdunitType(v["ad_slot"]).String(), + ExposureCount: v["exposure_count"], + MediaRevenue: v["media_revenue"], + Ecpm: v["ecpm"], + ClickRate: v["click_rate"], + ClickCount: v["click_count"], + } + list = append(list, tmp) + } + res := md.DataCenterRecordRes{ + 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 +` + 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 + "'" + } + field := `*` + start := (utils.StrToInt(req.Page) - 1) * utils.StrToInt(req.Limit) + groupBy := "" + if req.Page != "" { + groupBy = " group by date,app_id,slot_id order by date desc,id desc limit " + utils.IntToStr(start) + "," + req.Limit + } else { + groupBy = " group by date order by date 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 DataCenterSelectData(c *gin.Context) { + NewAppletApplicationDb := implement.NewAppletApplicationDb(MasterDb(c)) + appList, _ := NewAppletApplicationDb.FindAllAppletApplicationList() + appMap := make(map[string][]map[string]interface{}) + for _, v := range appList { + _, 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 +} diff --git a/app/svc/svc_invoice_center.go b/app/svc/svc_invoice_center.go new file mode 100644 index 0000000..72ffef7 --- /dev/null +++ b/app/svc/svc_invoice_center.go @@ -0,0 +1,55 @@ +package svc + +import ( + "applet/app/md" + "applet/app/utils" + db "code.fnuoos.com/zhimeng/model.git/src" + "code.fnuoos.com/zhimeng/model.git/src/super/implement" + "encoding/json" + "github.com/gin-gonic/gin" +) + +func InvoiceCenterList(c *gin.Context, req md.InvoiceCenterDataReq) md.InvoiceCenterDataRes { + user := GetUser(c) + engine := db.Db + NewMediumInvoiceDb := implement.NewMediumInvoiceDb(engine) + MediumList, total, _ := NewMediumInvoiceDb.FindMediumInvoiceList(c.GetString("mid"), req.Type, utils.IntToStr(user.MediumId), utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) + data := make([]md.InvoiceCenterDataData, 0) + if len(MediumList) > 0 { + for _, v := range MediumList { + var tmp = md.InvoiceCenterDataData{ + Id: utils.IntToStr(v.MediumInvoice.Id), + TimeStr: v.MediumInvoice.UpdateAt, + Month: v.StartDate, + Count: utils.IntToStr(v.MediumInvoice.Count), + Amount: utils.Float64ToStr(float64(v.MediumSettlement.OtherIncome+v.MediumSettlement.BasicIncome) / 100), + State: utils.IntToStr(v.MediumInvoice.State), + } + data = append(data, tmp) + } + } + res := md.InvoiceCenterDataRes{ + List: data, + Total: total, + State: md.InvoiceState, + } + return res +} +func InvoiceCenterDetail(c *gin.Context, req md.CommDetailReq) md.InvoiceCenterDataDetailRes { + engine := db.Db + NewMediumInvoiceDb := implement.NewMediumInvoiceDb(engine) + data, _ := NewMediumInvoiceDb.GetMediumInvoiceById(utils.StrToInt(req.Id)) + file := make([]md.InvoiceFile, 0) + json.Unmarshal([]byte(data.File), &file) + tmp := md.InvoiceCenterDataDetailData{ + TimeStr: data.UpdateAt, + State: utils.IntToStr(data.State), + Count: utils.IntToStr(data.Count), + File: file, + } + res := md.InvoiceCenterDataDetailRes{ + Data: tmp, + State: md.InvoiceState, + } + return res +} diff --git a/app/svc/svc_settle_center.go b/app/svc/svc_settle_center.go new file mode 100644 index 0000000..650a1bc --- /dev/null +++ b/app/svc/svc_settle_center.go @@ -0,0 +1,147 @@ +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 SettleCenterList(c *gin.Context, req md.SettleCenterDataReq) md.SettleCenterDataRes { + user := GetUser(c) + engine := db.Db + NewMediumSettlementDb := implement.NewMediumSettlementDb(engine) + MediumList, total, _ := NewMediumSettlementDb.FindMediumSettlementList(c.GetString("mid"), utils.IntToStr(user.MediumId), "", "", "", req.StartTime, req.EndTime, utils.StrToInt(req.Page), utils.StrToInt(req.Limit)) + data := make([]md.SettleCenterDataData, 0) + if len(MediumList) > 0 { + for _, v := range MediumList { + var tmp = md.SettleCenterDataData{ + Id: utils.IntToStr(v.Id), + AllIncome: utils.Float64ToStr(float64(v.OtherIncome+v.BasicIncome) / 100), + MediumIncome: 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 + NewMediumSettlementDb := implement.NewMediumSettlementDb(engine) + data, _ := NewMediumSettlementDb.GetMediumSettlementById(utils.StrToInt(req.Id)) + file := make([]md.InvoiceFile, 0) + invoice := md.Invoice{ + Type: "0", + Time: "", + Count: "0", + File: file, + } + //发票 + NewMediumInvoiceDb := implement.NewMediumInvoiceDb(engine) + invoiceData, _ := NewMediumInvoiceDb.GetMediumInvoice(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 + NewMediumSettlementDb := implement.NewMediumSettlementDb(engine) + data, _ := NewMediumSettlementDb.GetMediumSettlementById(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 + NewMediumSettlementDb := implement.NewMediumSettlementDb(engine) + data, _ := NewMediumSettlementDb.GetMediumSettlementById(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) + NewMediumInvoiceDb := implement.NewMediumInvoiceDb(engine) + invoice, _ := NewMediumInvoiceDb.GetMediumInvoice(data.Id) + if invoice == nil { + invoice = &model.MediumInvoice{ + 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/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/docs/docs.go b/docs/docs.go index ffa3f2a..c69988a 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -515,6 +515,279 @@ const docTemplate = `{ } } }, + "/api/dataCenter/record/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.DataCenterRecordReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.DataCenterRecordRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/record/total": { + "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.DataCenterTableReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.DataCenterTotalData" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/select/data": { + "get": { + "description": "数据中心-筛选条件", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "数据中心------嘉俊" + ], + "summary": "筛选条件", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/table": { + "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.DataCenterTableReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.DataCenterTableRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/invoiceCenter/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.InvoiceCenterDataDetailRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/invoiceCenter/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.InvoiceCenterDataReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.InvoiceCenterDataRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, "/api/login": { "post": { "description": "登入", @@ -1317,9 +1590,9 @@ const docTemplate = `{ } } }, - "/api/sms": { + "/api/settleCenter/detail": { "post": { - "description": "短信-短信发送", + "description": "结算中心-结算报表-详情", "consumes": [ "application/json" ], @@ -1327,15 +1600,16 @@ const docTemplate = `{ "application/json" ], "tags": [ - "短信" + "结算中心------嘉俊" ], - "summary": "短信发送", + "summary": "结算报表-详情", "parameters": [ { "type": "string", "description": "验证参数Bearer和token空格拼接", "name": "Authorization", - "in": "header" + "in": "header", + "required": true }, { "description": "请求参数", @@ -1343,15 +1617,15 @@ const docTemplate = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.SmsReq" + "$ref": "#/definitions/md.CommDetailReq" } } ], "responses": { "200": { - "description": "success", + "description": "具体看返回内容 这是data里面的数据", "schema": { - "type": "string" + "$ref": "#/definitions/md.SettleCenterDataDetailRes" } }, "400": { @@ -1362,19 +1636,206 @@ const docTemplate = `{ } } } - } - }, - "definitions": { - "md.AccountBase": { - "type": "object", - "properties": { - "admin_phone": { - "type": "string", - "example": "管理员手机号" - }, - "company_abbreviation": { - "type": "string", - "example": "公司简称" + }, + "/api/settleCenter/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/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/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/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": "管理员手机号" + }, + "company_abbreviation": { + "type": "string", + "example": "公司简称" }, "company_name": { "type": "string", @@ -1488,6 +1949,9 @@ const docTemplate = `{ "type": "string", "example": "小程序appid" }, + "app_name": { + "type": "string" + }, "cooperate_state": { "type": "string", "example": "合作状态" @@ -1751,60 +2215,360 @@ const docTemplate = `{ } } }, - "md.ImgReqUpload": { + "md.CommDetailReq": { "type": "object", "properties": { - "dir": { + "id": { + "type": "string", + "example": "列表id" + } + } + }, + "md.DataCenterRecordReq": { + "type": "object", + "properties": { + "ad_type": { + "type": "string", + "example": "广告位类型" + }, + "app_id": { + "type": "string", + "example": "应用" + }, + "end_date": { + "type": "string", + "example": "2024-08-30" + }, + "limit": { "type": "string" }, - "file_name": { + "page": { "type": "string" }, - "file_size": { - "description": "文件大小, 单位byte", + "platform": { + "type": "string", + "example": "平台" + }, + "start_date": { + "type": "string", + "example": "2024-08-30" + } + } + }, + "md.DataCenterRecordRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.DataCenterTotalData" + } + }, + "total": { "type": "integer" } } }, - "md.LoginPhoneReq": { + "md.DataCenterTableData": { "type": "object", - "required": [ - "captcha", - "username" - ], "properties": { - "captcha": { + "date": { "type": "string", - "example": "验证码" + "example": "日期" }, - "username": { + "ecpm": { "type": "string", - "example": "登录账号" + "example": "ecpm" + }, + "exposure_count": { + "type": "string", + "example": "曝光量" + }, + "media_revenue": { + "type": "string", + "example": "预估收益" } } }, - "md.LoginReq": { + "md.DataCenterTableReq": { "type": "object", - "required": [ - "password", - "username" - ], "properties": { - "code": { + "ad_type": { "type": "string", - "example": "验证码" + "example": "广告位类型" }, - "password": { + "app_id": { "type": "string", - "example": "登录密码" + "example": "应用" }, - "username": { + "end_date": { "type": "string", - "example": "登录账号" + "example": "2024-08-30" + }, + "platform": { + "type": "string", + "example": "平台" + }, + "start_date": { + "type": "string", + "example": "2024-08-30" } } }, - "md.LoginResponse": { + "md.DataCenterTableRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.DataCenterTableData" + } + } + } + }, + "md.DataCenterTotalData": { + "type": "object", + "properties": { + "adv_name": { + "type": "string" + }, + "app_name": { + "type": "string" + }, + "click_count": { + "type": "string", + "example": "点击量" + }, + "click_rate": { + "type": "string", + "example": "点击率" + }, + "date": { + "type": "string", + "example": "日期" + }, + "ecpm": { + "type": "string", + "example": "ecpm" + }, + "exposure_count": { + "type": "string", + "example": "曝光量" + }, + "media_revenue": { + "type": "string", + "example": "预估收益" + }, + "platform_name": { + "type": "string" + } + } + }, + "md.ImgReqUpload": { + "type": "object", + "properties": { + "dir": { + "type": "string" + }, + "file_name": { + "type": "string" + }, + "file_size": { + "description": "文件大小, 单位byte", + "type": "integer" + } + } + }, + "md.Invoice": { + "type": "object", + "properties": { + "count": { + "type": "string" + }, + "file": { + "type": "array", + "items": { + "$ref": "#/definitions/md.InvoiceFile" + } + }, + "time": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "md.InvoiceCenterDataData": { + "type": "object", + "properties": { + "amount": { + "type": "string", + "example": "结算金额" + }, + "count": { + "type": "string", + "example": "数量" + }, + "id": { + "type": "string" + }, + "month": { + "type": "string", + "example": "订单月份" + }, + "state": { + "type": "string", + "example": "结算单状态(0:待审核 1:审核通过 2:审核拒绝)" + }, + "time_str": { + "type": "string", + "example": "上传时间" + } + } + }, + "md.InvoiceCenterDataDetailData": { + "type": "object", + "properties": { + "count": { + "type": "string", + "example": "数量" + }, + "file": { + "type": "array", + "items": { + "$ref": "#/definitions/md.InvoiceFile" + } + }, + "state": { + "type": "string", + "example": "结算单状态(0:待审核 1:审核通过 2:审核拒绝)" + }, + "time_str": { + "type": "string", + "example": "上传时间" + } + } + }, + "md.InvoiceCenterDataDetailRes": { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/md.InvoiceCenterDataDetailData" + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + } + } + }, + "md.InvoiceCenterDataReq": { + "type": "object", + "properties": { + "limit": { + "type": "string" + }, + "page": { + "type": "string" + }, + "type": { + "type": "string", + "example": "0电子发票 1纸质发票" + } + } + }, + "md.InvoiceCenterDataRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.InvoiceCenterDataData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, + "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纸质发票" + } + } + }, + "md.LoginPhoneReq": { + "type": "object", + "required": [ + "captcha", + "username" + ], + "properties": { + "captcha": { + "type": "string", + "example": "验证码" + }, + "username": { + "type": "string", + "example": "登录账号" + } + } + }, + "md.LoginReq": { + "type": "object", + "required": [ + "password", + "username" + ], + "properties": { + "code": { + "type": "string", + "example": "验证码" + }, + "password": { + "type": "string", + "example": "登录密码" + }, + "username": { + "type": "string", + "example": "登录账号" + } + } + }, + "md.LoginResponse": { "type": "object", "properties": { "token": { @@ -1996,6 +2760,206 @@ const docTemplate = `{ } } }, + "md.SettleCenterDataData": { + "type": "object", + "properties": { + "all_income": { + "type": "string", + "example": "合计收益" + }, + "business_kind": { + "type": "string", + "example": "业务类型(1:广告合作)" + }, + "id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "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": "结算单" + }, + "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.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 0ba5a46..870eba7 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -507,6 +507,279 @@ } } }, + "/api/dataCenter/record/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.DataCenterRecordReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.DataCenterRecordRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/record/total": { + "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.DataCenterTableReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.DataCenterTotalData" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/select/data": { + "get": { + "description": "数据中心-筛选条件", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "数据中心------嘉俊" + ], + "summary": "筛选条件", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/dataCenter/table": { + "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.DataCenterTableReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.DataCenterTableRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/invoiceCenter/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.InvoiceCenterDataDetailRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, + "/api/invoiceCenter/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.InvoiceCenterDataReq" + } + } + ], + "responses": { + "200": { + "description": "具体看返回内容 这是data里面的数据", + "schema": { + "$ref": "#/definitions/md.InvoiceCenterDataRes" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, "/api/login": { "post": { "description": "登入", @@ -1309,9 +1582,9 @@ } } }, - "/api/sms": { + "/api/settleCenter/detail": { "post": { - "description": "短信-短信发送", + "description": "结算中心-结算报表-详情", "consumes": [ "application/json" ], @@ -1319,15 +1592,16 @@ "application/json" ], "tags": [ - "短信" + "结算中心------嘉俊" ], - "summary": "短信发送", + "summary": "结算报表-详情", "parameters": [ { "type": "string", "description": "验证参数Bearer和token空格拼接", "name": "Authorization", - "in": "header" + "in": "header", + "required": true }, { "description": "请求参数", @@ -1335,15 +1609,15 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/md.SmsReq" + "$ref": "#/definitions/md.CommDetailReq" } } ], "responses": { "200": { - "description": "success", + "description": "具体看返回内容 这是data里面的数据", "schema": { - "type": "string" + "$ref": "#/definitions/md.SettleCenterDataDetailRes" } }, "400": { @@ -1354,19 +1628,206 @@ } } } - } - }, - "definitions": { - "md.AccountBase": { - "type": "object", - "properties": { - "admin_phone": { - "type": "string", - "example": "管理员手机号" - }, - "company_abbreviation": { - "type": "string", - "example": "公司简称" + }, + "/api/settleCenter/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/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/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/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": "管理员手机号" + }, + "company_abbreviation": { + "type": "string", + "example": "公司简称" }, "company_name": { "type": "string", @@ -1480,6 +1941,9 @@ "type": "string", "example": "小程序appid" }, + "app_name": { + "type": "string" + }, "cooperate_state": { "type": "string", "example": "合作状态" @@ -1743,60 +2207,360 @@ } } }, - "md.ImgReqUpload": { + "md.CommDetailReq": { "type": "object", "properties": { - "dir": { + "id": { + "type": "string", + "example": "列表id" + } + } + }, + "md.DataCenterRecordReq": { + "type": "object", + "properties": { + "ad_type": { + "type": "string", + "example": "广告位类型" + }, + "app_id": { + "type": "string", + "example": "应用" + }, + "end_date": { + "type": "string", + "example": "2024-08-30" + }, + "limit": { "type": "string" }, - "file_name": { + "page": { "type": "string" }, - "file_size": { - "description": "文件大小, 单位byte", + "platform": { + "type": "string", + "example": "平台" + }, + "start_date": { + "type": "string", + "example": "2024-08-30" + } + } + }, + "md.DataCenterRecordRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.DataCenterTotalData" + } + }, + "total": { "type": "integer" } } }, - "md.LoginPhoneReq": { + "md.DataCenterTableData": { "type": "object", - "required": [ - "captcha", - "username" - ], "properties": { - "captcha": { + "date": { "type": "string", - "example": "验证码" + "example": "日期" }, - "username": { + "ecpm": { "type": "string", - "example": "登录账号" + "example": "ecpm" + }, + "exposure_count": { + "type": "string", + "example": "曝光量" + }, + "media_revenue": { + "type": "string", + "example": "预估收益" } } }, - "md.LoginReq": { + "md.DataCenterTableReq": { "type": "object", - "required": [ - "password", - "username" - ], "properties": { - "code": { + "ad_type": { "type": "string", - "example": "验证码" + "example": "广告位类型" }, - "password": { + "app_id": { "type": "string", - "example": "登录密码" + "example": "应用" }, - "username": { + "end_date": { "type": "string", - "example": "登录账号" + "example": "2024-08-30" + }, + "platform": { + "type": "string", + "example": "平台" + }, + "start_date": { + "type": "string", + "example": "2024-08-30" } } }, - "md.LoginResponse": { + "md.DataCenterTableRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.DataCenterTableData" + } + } + } + }, + "md.DataCenterTotalData": { + "type": "object", + "properties": { + "adv_name": { + "type": "string" + }, + "app_name": { + "type": "string" + }, + "click_count": { + "type": "string", + "example": "点击量" + }, + "click_rate": { + "type": "string", + "example": "点击率" + }, + "date": { + "type": "string", + "example": "日期" + }, + "ecpm": { + "type": "string", + "example": "ecpm" + }, + "exposure_count": { + "type": "string", + "example": "曝光量" + }, + "media_revenue": { + "type": "string", + "example": "预估收益" + }, + "platform_name": { + "type": "string" + } + } + }, + "md.ImgReqUpload": { + "type": "object", + "properties": { + "dir": { + "type": "string" + }, + "file_name": { + "type": "string" + }, + "file_size": { + "description": "文件大小, 单位byte", + "type": "integer" + } + } + }, + "md.Invoice": { + "type": "object", + "properties": { + "count": { + "type": "string" + }, + "file": { + "type": "array", + "items": { + "$ref": "#/definitions/md.InvoiceFile" + } + }, + "time": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "md.InvoiceCenterDataData": { + "type": "object", + "properties": { + "amount": { + "type": "string", + "example": "结算金额" + }, + "count": { + "type": "string", + "example": "数量" + }, + "id": { + "type": "string" + }, + "month": { + "type": "string", + "example": "订单月份" + }, + "state": { + "type": "string", + "example": "结算单状态(0:待审核 1:审核通过 2:审核拒绝)" + }, + "time_str": { + "type": "string", + "example": "上传时间" + } + } + }, + "md.InvoiceCenterDataDetailData": { + "type": "object", + "properties": { + "count": { + "type": "string", + "example": "数量" + }, + "file": { + "type": "array", + "items": { + "$ref": "#/definitions/md.InvoiceFile" + } + }, + "state": { + "type": "string", + "example": "结算单状态(0:待审核 1:审核通过 2:审核拒绝)" + }, + "time_str": { + "type": "string", + "example": "上传时间" + } + } + }, + "md.InvoiceCenterDataDetailRes": { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/md.InvoiceCenterDataDetailData" + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + } + } + }, + "md.InvoiceCenterDataReq": { + "type": "object", + "properties": { + "limit": { + "type": "string" + }, + "page": { + "type": "string" + }, + "type": { + "type": "string", + "example": "0电子发票 1纸质发票" + } + } + }, + "md.InvoiceCenterDataRes": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/md.InvoiceCenterDataData" + } + }, + "state": { + "type": "array", + "items": { + "$ref": "#/definitions/md.SelectData" + } + }, + "total": { + "type": "integer" + } + } + }, + "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纸质发票" + } + } + }, + "md.LoginPhoneReq": { + "type": "object", + "required": [ + "captcha", + "username" + ], + "properties": { + "captcha": { + "type": "string", + "example": "验证码" + }, + "username": { + "type": "string", + "example": "登录账号" + } + } + }, + "md.LoginReq": { + "type": "object", + "required": [ + "password", + "username" + ], + "properties": { + "code": { + "type": "string", + "example": "验证码" + }, + "password": { + "type": "string", + "example": "登录密码" + }, + "username": { + "type": "string", + "example": "登录账号" + } + } + }, + "md.LoginResponse": { "type": "object", "properties": { "token": { @@ -1988,6 +2752,206 @@ } } }, + "md.SettleCenterDataData": { + "type": "object", + "properties": { + "all_income": { + "type": "string", + "example": "合计收益" + }, + "business_kind": { + "type": "string", + "example": "业务类型(1:广告合作)" + }, + "id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "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": "结算单" + }, + "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.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 94aa127..1ff3994 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -85,6 +85,8 @@ definitions: app_id: example: 小程序appid type: string + app_name: + type: string cooperate_state: example: 合作状态 type: string @@ -267,6 +269,110 @@ definitions: required: - id type: object + md.CommDetailReq: + properties: + id: + example: 列表id + 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" + type: string + type: object + md.DataCenterRecordRes: + properties: + list: + items: + $ref: '#/definitions/md.DataCenterTotalData' + type: array + total: + type: integer + type: object + md.DataCenterTableData: + properties: + date: + example: 日期 + type: string + ecpm: + example: ecpm + type: string + exposure_count: + example: 曝光量 + type: string + media_revenue: + example: 预估收益 + type: string + 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" + type: string + type: object + md.DataCenterTableRes: + properties: + list: + items: + $ref: '#/definitions/md.DataCenterTableData' + type: array + 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: @@ -277,6 +383,108 @@ definitions: description: 文件大小, 单位byte type: integer 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.InvoiceCenterDataData: + properties: + amount: + example: 结算金额 + type: string + count: + example: 数量 + type: string + id: + type: string + month: + example: 订单月份 + type: string + state: + example: 结算单状态(0:待审核 1:审核通过 2:审核拒绝) + type: string + time_str: + example: 上传时间 + type: string + type: object + md.InvoiceCenterDataDetailData: + properties: + count: + example: 数量 + type: string + file: + items: + $ref: '#/definitions/md.InvoiceFile' + type: array + state: + example: 结算单状态(0:待审核 1:审核通过 2:审核拒绝) + type: string + time_str: + example: 上传时间 + type: string + type: object + md.InvoiceCenterDataDetailRes: + properties: + data: + $ref: '#/definitions/md.InvoiceCenterDataDetailData' + state: + items: + $ref: '#/definitions/md.SelectData' + type: array + type: object + md.InvoiceCenterDataReq: + properties: + limit: + type: string + page: + type: string + type: + example: 0电子发票 1纸质发票 + type: string + type: object + md.InvoiceCenterDataRes: + properties: + list: + items: + $ref: '#/definitions/md.InvoiceCenterDataData' + type: array + state: + items: + $ref: '#/definitions/md.SelectData' + type: array + total: + type: integer + 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: @@ -431,6 +639,144 @@ definitions: example: 值 type: string type: object + md.SettleCenterDataData: + properties: + all_income: + example: 合计收益 + type: string + business_kind: + example: 业务类型(1:广告合作) + type: string + id: + type: string + label: + type: string + 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 + 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.SettleFileReq: + properties: + file: + example: 七牛云链接 带http + type: string + id: + example: 列表id + type: string + type: object md.SmsReq: properties: phone: @@ -824,6 +1170,186 @@ paths: summary: 新增或保存 tags: - 小程序应用------嘉俊 + /api/dataCenter/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.DataCenterRecordRes' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 数据明细 + tags: + - 数据中心------嘉俊 + /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: 数据中心-筛选条件 + 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/dataCenter/table: + 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.DataCenterTableRes' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 数据图表 + tags: + - 数据中心------嘉俊 + /api/invoiceCenter/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.InvoiceCenterDataDetailRes' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 发票详情 + tags: + - 发票中心------嘉俊 + /api/invoiceCenter/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.InvoiceCenterDataReq' + produces: + - application/json + responses: + "200": + description: 具体看返回内容 这是data里面的数据 + schema: + $ref: '#/definitions/md.InvoiceCenterDataRes' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 发票列表 + tags: + - 发票中心------嘉俊 /api/login: post: consumes: @@ -1352,6 +1878,130 @@ paths: summary: 修改角色状态 tags: - ADMIN-权限管理 + /api/settleCenter/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/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/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/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/sms: post: consumes: diff --git a/go.mod b/go.mod index 2faa4bf..7957e4a 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,9 @@ module applet go 1.18 //replace code.fnuoos.com/zhimeng/model.git => E:/company/ad/models - +// require ( - code.fnuoos.com/zhimeng/model.git v0.0.3-0.20240828073010-6ec681bcb45d + code.fnuoos.com/zhimeng/model.git v0.0.3-0.20240830085315-046c30582759 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