Browse Source

update

master
dengbiao 3 months ago
parent
commit
b0968636da
16 changed files with 2817 additions and 21 deletions
  1. +57
    -0
      app/hdl/hdl_data_center_generate_data.go
  2. +34
    -0
      app/hdl/hdl_data_center_original_data.go
  3. +144
    -0
      app/hdl/hdl_sms.go
  4. +3
    -2
      app/hdl/hdl_wx_open.go
  5. +9
    -0
      app/md/comm.go
  6. +111
    -0
      app/md/md_data_center_generate_data.go
  7. +133
    -0
      app/md/md_data_center_original_data.go
  8. +55
    -0
      app/md/md_sms.go
  9. +17
    -2
      app/router/router.go
  10. +113
    -0
      app/svc/svc_data_center_generate_data.go
  11. +126
    -0
      app/svc/svc_data_center_original_data.go
  12. +31
    -0
      app/svc/svc_medium_agent.go
  13. +741
    -8
      docs/docs.go
  14. +741
    -8
      docs/swagger.json
  15. +501
    -0
      docs/swagger.yaml
  16. +1
    -1
      go.mod

+ 57
- 0
app/hdl/hdl_data_center_generate_data.go View File

@@ -0,0 +1,57 @@
package hdl

import (
"applet/app/e"
"applet/app/lib/validate"
"applet/app/md"
"applet/app/svc"
"github.com/gin-gonic/gin"
)

// GenerateDataList
// @Summary 分成数据-列表
// @Tags 数据中心
// @Description 数据中心-分成数据-列表
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Accept json
// @Produce json
// @Param args body md.DataCenterGenerateDataReq true "请求参数"
// @Success 200 {object} md.DataCenterGenerateDataRes "具体看返回内容 这是data里面的数据"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/dataCenter/generate/data/list [POST]
func GenerateDataList(c *gin.Context) {
var req md.DataCenterGenerateDataReq
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.DataCenterGenerateDataList(c, req)
e.OutSuc(c, res, nil)
return
}

// GenerateDataDetail
// @Summary 分成数据-详情
// @Tags 数据中心
// @Description 数据中心-分成数据-详情
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Accept json
// @Produce json
// @Param args body md.DataCenterGenerateDataCommReq true "请求参数"
// @Success 200 {object} md.DataCenterGenerateDataDetailData "具体看返回内容 "
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/dataCenter/generate/data/detail [POST]
func GenerateDataDetail(c *gin.Context) {
var req md.DataCenterGenerateDataCommReq
err := c.ShouldBindJSON(&req)
if err != nil {
err = validate.HandleValidateErr(err)
err1 := err.(e.E)
e.OutErr(c, err1.Code, err1.Error())
return
}
svc.DataCenterGenerateDataDetail(c, req)
}

+ 34
- 0
app/hdl/hdl_data_center_original_data.go View File

@@ -0,0 +1,34 @@
package hdl

import (
"applet/app/e"
"applet/app/lib/validate"
"applet/app/md"
"applet/app/svc"
"github.com/gin-gonic/gin"
)

// OriginalDataList
// @Summary 原始数据-列表
// @Tags 数据中心
// @Description 数据中心-原始数据-列表
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Accept json
// @Produce json
// @Param args body md.DataCenterOriginalDataReq true "请求参数"
// @Success 200 {object} md.DataCenterOriginalDataRes "具体看返回内容 这是data里面的数据"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/dataCenter/original/data/list [POST]
func OriginalDataList(c *gin.Context) {
var req md.DataCenterOriginalDataReq
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.DataCenterOriginalDataList(c, req)
e.OutSuc(c, res, nil)
return
}

+ 144
- 0
app/hdl/hdl_sms.go View File

@@ -0,0 +1,144 @@
package hdl

import (
"applet/app/e"
"applet/app/lib/validate"
"applet/app/md"
"applet/app/utils"
db "code.fnuoos.com/zhimeng/model.git/src"
"code.fnuoos.com/zhimeng/model.git/src/super/model"
"github.com/gin-gonic/gin"
)

// SmsList
// @Summary 列表
// @Tags 短信中心
// @Description 短信中心-列表
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Accept json
// @Produce json
// @Param args body md.SmsListReq true "请求参数"
// @Success 200 {object} md.SmsListResp "具体看返回内容 这是data里面的数据"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/smsCenter/list [POST]
func SmsList(c *gin.Context) {
var req md.SmsListReq
err := c.ShouldBindJSON(&req)
if err != nil {
err = validate.HandleValidateErr(err)
err1 := err.(e.E)
e.OutErr(c, err1.Code, err1.Error())
return
}

var list []*md.MasterWithSmsNumList
sess := db.Db.Where("1 = 1").Limit(req.Limit, (req.Page-1)*req.Limit)
if req.Uuid != "" {
sess.And("user_list.uuid=?", req.Uuid)
}
if req.Name != "" {
sess.And("user_list.name like ?", "%"+req.Name+"%")
}
total, err := sess.Where("1 =1 ").
Join("LEFT", "sms_num_list", "user_list.uuid = sms_num_list.uid").
FindAndCount(&list)

var resp = md.SmsListResp{
Total: total,
}
for _, v := range list {
resp.List = append(resp.List, md.SmsList{
Uuid: utils.IntToStr(v.UserList.Uuid),
Name: v.UserList.Name,
Num: int64(v.SmsNumList.Num),
})
}
e.OutSuc(c, resp, nil)
return
}

// SmsDetail
// @Summary 详情
// @Tags 短信中心
// @Description 短信中心-详情
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Accept json
// @Produce json
// @Param args body md.SmsDetailReq true "请求参数"
// @Success 200 {object} md.SmsDetailResp "具体看返回内容 这是data里面的数据"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/smsCenter/detail [POST]
func SmsDetail(c *gin.Context) {
var req md.SmsDetailReq
err := c.ShouldBindJSON(&req)
if err != nil {
err = validate.HandleValidateErr(err)
err1 := err.(e.E)
e.OutErr(c, err1.Code, err1.Error())
return
}

var list []*model.SmsRecord
sess := db.Db.Where("uid = ?", req.Uuid).Limit(req.Limit, (req.Page-1)*req.Limit)
total, err := sess.FindAndCount(&list)

var resp = md.SmsDetailResp{
Total: total,
}
for _, v := range list {
stateZh := "发送成功"
if v.State != 1 {
stateZh = "发送失败"
}
resp.List = append(resp.List, md.SmsDetail{
Id: v.Id,
Phone: v.Phone,
StateZh: stateZh,
CreateAt: v.CreateAt.Format("2006-01-02 15:04:05"),
})
}
e.OutSuc(c, resp, nil)
return
}

// SmsUpdate
// @Summary 修改
// @Tags 短信中心
// @Description 短信中心-修改
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Accept json
// @Produce json
// @Param args body md.SmsDetailReq true "请求参数"
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/smsCenter/update [POST]
func SmsUpdate(c *gin.Context) {
var req md.SmsUpdateReq
err := c.ShouldBindJSON(&req)
if err != nil {
err = validate.HandleValidateErr(err)
err1 := err.(e.E)
e.OutErr(c, err1.Code, err1.Error())
return
}

m := new(model.SmsNumList)
has, err := db.Db.Where("uid =?", req.Uuid).Get(m)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
if has == false {
e.OutErr(c, e.ERR_NOT_FAN, "未查询到站长记录")
return
}
m.Num = req.Num
_, err = db.Db.Where("uid =?", req.Uuid).Cols("num").Update(m)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}

e.OutSuc(c, "success", nil)
return
}

+ 3
- 2
app/hdl/hdl_wx_open.go View File

@@ -153,7 +153,7 @@ func GetPreAuthCode(c *gin.Context) {
c.Writer.Header().Set("Access-Control-Allow-Origin", "*")
redirectURI := "http://super.advertisement.dengbiao.top/api/wxOpen/getAuthUrlCallBack?masterId=" + masterId
if cfg.Prd {
redirectURI = "http://ad.zhios.cn//api/wxOpen/getAuthUrlCallBack?masterId=" + masterId
redirectURI = "http://ad.zhios.cn/api/wxOpen/getAuthUrlCallBack?masterId=" + masterId
}
// 对redirectURI进行URL编码
//encodedRedirectURI := url.QueryEscape(redirectURI)
@@ -223,8 +223,9 @@ func GetAuthUrlCallBack(c *gin.Context) {
e.OutErr(c, e.ERR_NOT_FAN, "未查询到小程序应用记录")
return
}
userWxAppletList.IsAuth = 1
userWxAppletList.AuthorizerRefreshToken = resp.AuthorizationInfo.AuthorizerRefreshToken
_, err = userWxAppletListDb.UpdateUserWxAppletList(userWxAppletList, "authorizer_refresh_token")
_, err = userWxAppletListDb.UpdateUserWxAppletList(userWxAppletList, "authorizer_refresh_token", "is_auth")
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return


+ 9
- 0
app/md/comm.go View File

@@ -0,0 +1,9 @@
package md

type SelectData struct {
Name string `json:"name" example:"名称"`
Value string `json:"value" example:"值"`
}
type CommDetailReq struct {
Id string `json:"id" example:"列表id"`
}

+ 111
- 0
app/md/md_data_center_generate_data.go View File

@@ -0,0 +1,111 @@
package md

type DataCenterGenerateDataReq struct {
Limit string `json:"limit"`
Page string `json:"page" `
Name string `json:"name"`
State string `json:"state"`
Platform string `json:"platform"`
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
}

type DataCenterGenerateDataRes struct {
List []DataCenterGenerateDataData `json:"list" `
Total int64 `json:"total"`
State []SelectData `json:"state"`
Platform []SelectData `json:"platform"`
}

type DataCenterGenerateDataData struct {
Id string `json:"id" example:"id"`
Date string `json:"date" example:"日期"`
Name string `json:"name" example:"名称"`
Platform string `json:"platform" example:"平台名称"`
AdvName string `json:"adv_name" example:"广告位"`
State string `json:"state" example:"状态id"`
OldExposureCount string `json:"old_exposure_count" example:"原-曝光量"`
OldClickCount string `json:"old_click_count" example:"原-点击量"`
OldClickRate string `json:"old_click_rate" example:"原-点击率"`
OldEcpm string `json:"old_ecpm" example:"'原-ecpm(元)"`
ExposureCount string `json:"exposure_count" example:"现-曝光量"`
ClickCount string `json:"click_count" example:"现-点击量"`
ClickRate string `json:"click_rate" example:"现-点击率"`
Ecpm string `json:"ecpm" example:"'现-ecpm(元)"`
PlatformRetention string `json:"platform_retention" example:"平台留存(元)"`
CommissionRetention string `json:"commission_retention" example:"佣金留存(元)"`
PriceAdjustmentRetention string `json:"price_adjustment_retention" example:"调价留存(元)"`
MediaRevenue string `json:"media_revenue" example:"媒体收益(元)"`
AgentRevenue string `json:"agent_revenue" example:"代理收益(元)"`
ExtraRevenue string `json:"extra_revenue" example:"额外收益(元)"`
AgreementSharing string `json:"agreement_sharing" example:"协议分成(元)"`
AgreementSharingTotal string `json:"agreement_sharing_total" example:"协议总分成(元)"`
IsGenerateReport string `json:"is_generate_report" example:"是否已生成报表(0:未 1:已)"`
}

type DataCenterIncomeDataRes struct {
List []DataCenterIncomeDataData `json:"list" `
Total int64 `json:"total"`
State []SelectData `json:"state"`
Platform []SelectData `json:"platform"`
}

type DataCenterIncomeDataData struct {
Id string `json:"id" example:"id"`
Date string `json:"date" example:"日期"`
Name string `json:"name" example:"名称"`
Platform string `json:"platform" example:"平台名称"`
AdvName string `json:"adv_name" example:"广告位"`
State string `json:"state" example:"状态id"`
ExposureCount string `json:"exposure_count" example:"现-曝光量"`
ClickCount string `json:"click_count" example:"现-点击量"`
ClickRate string `json:"click_rate" example:"现-点击率"`
Ecpm string `json:"ecpm" example:"'现-ecpm(元)"`
MediaRevenue string `json:"media_revenue" example:"媒体收益(元)"`
AgreementSharing string `json:"agreement_sharing" example:"平台收益(元)"`
AgentRevenue string `json:"agent_revenue" example:"代理收益(元)"`
SettleAmount string `json:"settle_amount" example:"结算收益(元)"`
}
type DataCenterIncomeDataDetail struct {
Platform string `json:"platform" example:"填充来源"`
MediaRevenue string `json:"media_revenue" example:"媒体收益(元)"`
MediaRevenueRate string `json:"media_revenue_rate" example:"媒体收益百分比"`
AgreementSharingRate string `json:"agreement_sharing_rate" example:"平台收益百分比"`
AgreementSharing string `json:"agreement_sharing" example:"平台收益(元)"`
AgentRevenue string `json:"agent_revenue" example:"代理收益(元)"`
AgentRevenueRate string `json:"agent_revenue_rate" example:"代理收益百分比"`
DataSource string `json:"data_source" example:"数据来源"`
MediumName string `json:"medium_name" example:"媒体名称"`
CreateAt string `json:"create_at"`
UpdateAt string `json:"update_at"`
AgentReward []DataCenterGenerateDataDetailAgentRewardSecond `json:"agent_reward"`
}
type DataCenterGenerateDataCommReq struct {
Id string `json:"id" example:"列表id"`
}

type DataCenterGenerateDataDetailData struct {
PlatformRetentionRate string `json:"platform_retention_rate" example:"平台留存百分比"`
CommissionRetentionRate string `json:"commission_retention_rate" example:"佣金留存百分比"`
MediaRevenueRate string `json:"media_revenue_rate" example:"媒体收益百分比"`
AgentRevenueRate string `json:"agent_revenue_rate" example:"代理收益百分比"`
ExtraRevenueRate string `json:"extra_revenue_rate" example:"额外收益百分比"`
AgreementSharingRate string `json:"agreement_sharing_rate" example:"协议分成百分比"`
CreateAt string `json:"create_at" `
UpdateAt string `json:"update_at" `
AgentReward []DataCenterGenerateDataDetailAgentReward `json:"agent_reward"`
}
type DataCenterGenerateDataDetailAgentReward struct {
Name string `json:"name"`
Account string `json:"account"`
AgentRevenue string `json:"agent_revenue" example:"代理收益(元)"`
AgentRevenueRate string `json:"agent_revenue_rate" example:"代理收益百分比"`
ExtraRevenue string `json:"extra_revenue" example:"额外收益(元)"`
ExtraRevenueRate string `json:"extra_revenue_rate" example:"'额外收益百分比"`
}
type DataCenterGenerateDataDetailAgentRewardSecond struct {
Name string `json:"name"`
Account string `json:"account"`
AgentRevenue string `json:"agent_revenue" example:"代理收益(元)"`
AgentRevenueRate string `json:"agent_revenue_rate" example:"代理收益百分比"`
}

+ 133
- 0
app/md/md_data_center_original_data.go View File

@@ -0,0 +1,133 @@
package md

var AdState = []SelectData{
{Name: "审核通过", Value: "1"},
{Name: "待审核", Value: "0"},
{Name: "审核拒绝", Value: "2"},
{Name: "封禁中", Value: "3"},
}

var AdPlatform = []SelectData{
{Name: "微信小程序", Value: "wx_applet"},
}

type DataCenterOriginalDataReq struct {
Limit string `json:"limit"`
Page string `json:"page" `
Name string `json:"name"`
State string `json:"state"`
Platform string `json:"platform"`
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
}

type DataCenterOriginalDataRes struct {
List []DataCenterOriginalDataData `json:"list" `
Total int64 `json:"total"`
State []SelectData `json:"state"`
Platform []SelectData `json:"platform"`
}

type DataCenterOriginalDataData struct {
Id string `json:"id" example:"id"`
Date string `json:"date" example:"日期"`
Name string `json:"name" example:"名称"`
Platform string `json:"platform" example:"平台名称"`
AdvName string `json:"adv_name" example:"广告位"`
State string `json:"state" example:"状态id"`
ReqSuccCount string `json:"req_succ_count" example:"拉取量"`
ExposureCount string `json:"exposure_count" example:"曝光量"`
ExposureRate string `json:"exposure_rate" example:"曝光率"`
ClickCount string `json:"click_count" example:"点击量"`
ClickRate string `json:"click_rate" example:"点击率"`
PublisherIncome string `json:"publisher_income" example:"总收益(元)"`
Ecpm string `json:"ecpm" example:"'ecpm(元)"`
IsApply string `json:"is_apply" example:"是否已应用"`
}

type DataCenterOriginalDataCommReq struct {
Id string `json:"id" example:"列表id"`
}
type DataCenterDataCenterOriginalDataDoingReq struct {
Id string `json:"id" example:"列表id"`
NowExposureCount string `json:"now_exposure_count" example:"现-曝光量"`
NowEcpm string `json:"now_ecpm" example:"现-广告千次曝光收益(元)"`
}
type DataCenterOriginalDataMoreApplicationReq struct {
Limit string `json:"limit"`
Page string `json:"page" `
Name string `json:"name"`
}

type DataCenterOriginalDataMoreApplicationRes struct {
List []DataCenterOriginalDataMoreApplicationData `json:"list" `
Total int64 `json:"total"`
State []SelectData `json:"state"`
}

type DataCenterOriginalDataMoreApplicationData struct {
Id string `json:"id" example:"id"`
AppId string `json:"app_id" example:"小程序id"`
AdId string `json:"ad_id" example:"广告位id"`
Logo string `json:"logo"`
Name string `json:"name" example:"名称"`
AdvName string `json:"adv_name" example:"广告位"`
State string `json:"state" example:"状态id"`
}
type DataCenterOriginalDataOneApplicationRes struct {
List []DataCenterOriginalDataOneApplicationData `json:"list" `
}
type DataCenterOriginalDataOneApplicationData struct {
Id string `json:"id" example:"id"`
AppId string `json:"app_id" example:"小程序id"`
Logo string `json:"logo"`
Name string `json:"name" example:"名称"`
}
type DataCenterOriginalDataOneApplicationAdListReq struct {
AppId string `json:"app_id"`
}
type DataCenterOriginalDataOneApplicationAdListRes struct {
List []DataCenterOriginalDataOneApplicationAdListData `json:"list" `
State []SelectData `json:"state"`
}
type DataCenterOriginalDataOneApplicationAdListData struct {
Id string `json:"id" example:"id"`
Name string `json:"name" example:"名称"`
AdId string `json:"ad_id" example:"广告位id"`
State string `json:"state" example:"状态id"`
}
type DataCenterOriginalDataMoreApplicationDoingReq struct {
Ids []DataCenterOriginalDataOneApplicationDoingReqData `json:"ids"`
Date string `json:"date" example:"2024-08-28"`
}
type DataCenterOriginalDataOneApplicationDoingReqData struct {
AppId string `json:"app_id"`
AdId string `json:"ad_id"`
}
type DataCenterOriginalDataOneApplicationDoingReq struct {
AppId string `json:"app_id"`
AdId string `json:"ad_id"`
Date string `json:"date" example:"2024-08-28"`
}
type DataCenterOriginalDataOneApplicationDoingRes struct {
AdId string `json:"ad_id"`
AdSlot string `json:"ad_slot" example:"广告位类型名称"`
ExposureCount string `json:"exposure_count" example:"曝光量"`
ReqSuccCount string `json:"req_succ_count" example:"拉取量"`
PublisherIncome string `json:"publisher_income" example:"总收益(元)"`
ClickCount string `json:"click_count" example:"点击量"`
Ecpm string `json:"ecpm" example:"ecpm(元)"`
ExposureRate string `json:"exposure_rate" example:"曝光率"`
ClickRate string `json:"click_rate" example:"点击率"`
}
type MediumDivisionStrategy struct {
PlatformRetentionRate string `json:"platform_retention_rate" example:"平台留存百分比"`
CommissionRetentionRate string `json:"commission_retention_rate" example:"佣金留存百分比"`
MediaRevenueRate string `json:"media_revenue_rate" example:"媒体收益百分比"`
AgentRevenueRate string `json:"agent_revenue_rate" example:"代理收益百分比"`
ExtraRevenueRate string `json:"extra_revenue_rate" example:"额外收益百分比"`
AgreementSharingRate string `json:"agreement_sharing_rate" example:"协议分成百分比"`
ExposureCount string `json:"exposure_count" example:"曝光量"`
OldEcpm string `json:"old_ecpm" example:"原-ecpm(元)"`
Ecpm string `json:"ecpm" example:"现-ecpm(元)"`
}

+ 55
- 0
app/md/md_sms.go View File

@@ -0,0 +1,55 @@
package md

import (
"code.fnuoos.com/zhimeng/model.git/src/super/model"
)

type SmsListReq struct {
Limit int `json:"limit"`
Page int `json:"page" `
Name string `json:"name" example:"站长名称"`
Uuid string `json:"uuid" example:"站长ID"`
}

type SmsListResp struct {
List []SmsList `json:"list" `
Total int64 `json:"total"`
}

type SmsList struct {
Uuid string `json:"uuid" example:"站长ID"`
Name string `json:"name" example:"站长名称"`
Num int64 `json:"num"` //短信条数
}

type SmsDetailReq struct {
Limit int `json:"limit"`
Page int `json:"page" `
Uuid string `json:"uuid" example:"站长ID"`
}

type SmsDetailResp struct {
List []SmsDetail `json:"list" `
Total int64 `json:"total"`
}

type SmsDetail struct {
Id int `json:"id"`
Phone string `json:"phone" example:"接收号码"`
StateZh string `json:"state_zh" example:"发送状态"`
CreateAt string `json:"create_at" example:"创建时间"`
}

type SmsUpdateReq struct {
Num int `json:"num"` //短信条数
Uuid string `json:"uuid" example:"站长ID"`
}

type MasterWithSmsNumList struct {
model.UserList
model.SmsNumList
}

func (MasterWithSmsNumList) TableName() string {
return "user_list"
}

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

@@ -67,8 +67,10 @@ func route(r *gin.RouterGroup) {
r.Use(mw.CheckBody) //body参数转换
r.Use(mw.CheckSign) //签名校验

r.Use(mw.Auth) // 以下接口需要JWT验证
rRole(r.Group("/role")) //权限管理
r.Use(mw.Auth) // 以下接口需要JWT验证
rRole(r.Group("/role")) //权限管理
rDataCenter(r.Group("/dataCenter")) //数据中心
rSmsCenter(r.Group("/smsCenter")) //短信中心
}

func rRole(r *gin.RouterGroup) {
@@ -87,3 +89,16 @@ func rRole(r *gin.RouterGroup) {
r.GET("/adminInfo", hdl.AdminInfo) //获取管理员信息
r.POST("/bindAdminRole", hdl.BindAdminRole) //绑定角色
}

func rDataCenter(r *gin.RouterGroup) {
r.POST("/original/data/list", hdl.OriginalDataList) //数据中心-原始数据

r.POST("/generate/data/list", hdl.GenerateDataList) //数据中心-分成数据
r.POST("/generate/data/detail", hdl.GenerateDataDetail) //数据中心-分成数据-详情
}

func rSmsCenter(r *gin.RouterGroup) {
r.POST("/list", hdl.SmsList)
r.POST("/detail", hdl.SmsDetail)
r.POST("/update", hdl.SmsUpdate)
}

+ 113
- 0
app/svc/svc_data_center_generate_data.go View File

@@ -0,0 +1,113 @@
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"
"github.com/gin-gonic/gin"
)

func DataCenterGenerateDataList(c *gin.Context, req md.DataCenterGenerateDataReq) md.DataCenterGenerateDataRes {
engine := db.Db
NewGenerateWxAdDataDb := implement.NewGenerateWxAdDataDb(engine)
appId := GetAppletId(c, req.Name, req.Platform)
slotId := GetSlotId(c, req.State)
MediumList, total, _ := NewGenerateWxAdDataDb.FindGenerateWxAdDataList("", appId, slotId, req.StartTime, req.EndTime, utils.StrToInt(req.Page), utils.StrToInt(req.Limit))
data := make([]md.DataCenterGenerateDataData, 0)
if len(MediumList) > 0 {
NewOriginalWxAdDataDb := implement.NewOriginalWxAdDataDb(engine)
for _, v := range MediumList {
wxData, _ := NewOriginalWxAdDataDb.GetOriginalWxAdData(v.Id)
var tmp = md.DataCenterGenerateDataData{
Id: utils.IntToStr(v.Id),
ExposureCount: utils.IntToStr(v.ExposureCount),
ClickCount: utils.IntToStr(v.ClickCount),
ClickRate: v.ClickRate,
Ecpm: utils.Float64ToStr(utils.StrToFloat64(v.Ecpm) / 100),
IsGenerateReport: utils.IntToStr(v.IsGenerateReport),
Date: v.Date,
PlatformRetention: utils.Float64ToStr(float64(v.PlatformRetention) / 100),
CommissionRetention: utils.Float64ToStr(float64(v.CommissionRetention) / 100),
PriceAdjustmentRetention: utils.Float64ToStr(float64(v.PriceAdjustmentRetention) / 100),
MediaRevenue: utils.Float64ToStr(float64(v.MediaRevenue) / 100),
AgentRevenue: utils.Float64ToStr(float64(v.AgentRevenue) / 100),
ExtraRevenue: utils.Float64ToStr(float64(v.ExtraRevenue) / 100),
AgreementSharing: utils.Float64ToStr(float64(v.AgreementSharing) / 100),
AgreementSharingTotal: utils.Float64ToStr(float64(v.AgreementSharingTotal) / 100),
}
if wxData != nil {
tmp.OldClickRate = wxData.ClickRate
tmp.OldClickCount = utils.IntToStr(wxData.ClickCount)
tmp.OldEcpm = utils.Float64ToStr(utils.StrToFloat64(wxData.Ecpm) / 100)
tmp.OldExposureCount = utils.IntToStr(wxData.ExposureCount)
}
tmpApplet := GetAppletInfo(c, v.AppId)
if tmpApplet["platform"] != "" {
tmp.Platform = tmpApplet["platform"]
}
if tmpApplet["name"] != "" {
tmp.Name = tmpApplet["name"]
}
tmpSlot := GetSlotInfo(c, v.SlotId)
if tmpSlot["state"] != "" {
tmp.State = tmpSlot["state"]
}
if tmpSlot["name"] != "" {
tmp.AdvName = tmpSlot["name"]
}
data = append(data, tmp)
}
}
res := md.DataCenterGenerateDataRes{
List: data,
Total: total,
State: md.AdState,
Platform: md.AdPlatform,
}
return res
}

func DataCenterGenerateDataDetail(c *gin.Context, req md.DataCenterGenerateDataCommReq) {
NewGenerateWxAdDataDb := implement.NewGenerateWxAdDataDb(db.Db)
data, _ := NewGenerateWxAdDataDb.GetGenerateWxAdData(utils.StrToInt(req.Id))
if data == nil {
e.OutErr(c, 400, e.NewErr(400, "记录不存在"))
return
}
agentReward := make([]md.DataCenterGenerateDataDetailAgentReward, 0)
NewGenerateWxAdDataWithAgentFlowDb := implement.NewGenerateWxAdDataWithAgentFlowDb(db.Db)
agent, _ := NewGenerateWxAdDataWithAgentFlowDb.FindGenerateWxAdDataWithAgentFlowByStrategyId(data.Id)
if agent != nil {
for _, v := range *agent {
tmp := md.DataCenterGenerateDataDetailAgentReward{
Name: "",
Account: "",
AgentRevenue: utils.Float64ToStr(float64(v.AgentRevenue) / 100),
AgentRevenueRate: utils.IntToStr(data.AgentRevenueRate),
ExtraRevenue: utils.Float64ToStr(float64(v.ExtraRevenue) / 100),
ExtraRevenueRate: utils.IntToStr(data.ExtraRevenueRate),
}
tmpApplet := GetAgentInfo(c, v.AgentId)
if tmpApplet["name"] != "" {
tmp.Name = tmpApplet["name"]
}
if tmpApplet["account"] != "" {
tmp.Account = tmpApplet["account"]
}
agentReward = append(agentReward, tmp)
}
}
res := md.DataCenterGenerateDataDetailData{
PlatformRetentionRate: utils.IntToStr(data.PlatformRetentionRate),
CommissionRetentionRate: utils.IntToStr(data.CommissionRetentionRate),
MediaRevenueRate: utils.IntToStr(data.MediaRevenueRate),
AgentRevenueRate: utils.IntToStr(data.AgentRevenueRate),
ExtraRevenueRate: utils.IntToStr(data.ExtraRevenueRate),
AgreementSharingRate: utils.IntToStr(data.AgreementSharingRate),
AgentReward: agentReward,
}
e.OutSuc(c, res, nil)
return
}

+ 126
- 0
app/svc/svc_data_center_original_data.go View File

@@ -0,0 +1,126 @@
package svc

import (
"applet/app/md"
"applet/app/utils"
db "code.fnuoos.com/zhimeng/model.git/src"
implement2 "code.fnuoos.com/zhimeng/model.git/src/implement"
model2 "code.fnuoos.com/zhimeng/model.git/src/model"
"code.fnuoos.com/zhimeng/model.git/src/super/implement"
"github.com/gin-gonic/gin"
"strings"
)

func DataCenterOriginalDataList(c *gin.Context, req md.DataCenterOriginalDataReq) md.DataCenterOriginalDataRes {
engine := db.Db
NewOriginalWxAdDataDb := implement.NewOriginalWxAdDataDb(engine)
appId := GetAppletId(c, req.Name, req.Platform)
slotId := GetSlotId(c, req.State)
MediumList, total, _ := NewOriginalWxAdDataDb.FindOriginalWxAdDataList("", appId, slotId, req.StartTime, req.EndTime, utils.StrToInt(req.Page), utils.StrToInt(req.Limit))
data := make([]md.DataCenterOriginalDataData, 0)
if len(MediumList) > 0 {
for _, v := range MediumList {
var tmp = md.DataCenterOriginalDataData{
Id: utils.IntToStr(v.Id),
ReqSuccCount: utils.IntToStr(v.ReqSuccCount),
ExposureCount: utils.IntToStr(v.ExposureCount),
ExposureRate: v.ExposureRate,
ClickCount: utils.IntToStr(v.ClickCount),
ClickRate: v.ClickRate,
Date: v.Date,
PublisherIncome: utils.Float64ToStr(float64(v.PublisherIncome) / 100),
Ecpm: utils.Float64ToStr(utils.StrToFloat64(v.Ecpm) / 100),
IsApply: utils.IntToStr(v.IsApply),
}
tmpApplet := GetAppletInfo(c, v.AppId)
if tmpApplet["platform"] != "" {
tmp.Platform = tmpApplet["platform"]
}
if tmpApplet["name"] != "" {
tmp.Name = tmpApplet["name"]
}
tmpSlot := GetSlotInfo(c, v.SlotId)
if tmpSlot["state"] != "" {
tmp.State = tmpSlot["state"]
}
if tmpSlot["name"] != "" {
tmp.AdvName = tmpSlot["name"]
}
data = append(data, tmp)
}
}
res := md.DataCenterOriginalDataRes{
List: data,
Total: total,
State: md.AdState,
Platform: md.AdPlatform,
}
return res
}

// 应用
func GetAppletId(c *gin.Context, name, platform string) string {
mediumId := ""
sess := MasterDb(c).Where("1=1")
if name != "" || platform != "" {
ids := []string{"-1"}
var tmp []model2.AppletApplication
if name != "" {
sess.And("name like ? ", "%"+name+"%")
}
if platform != "" {
sess.And("platform = ? ", platform)
}
sess.Find(&tmp)
for _, v := range tmp {
ids = append(ids, utils.IntToStr(v.MediumId))
}
mediumId = strings.Join(ids, ",")
}
return mediumId
}

// 广告位
func GetSlotId(c *gin.Context, state string) string {
mediumId := ""
if state != "" {
ids := []string{"-1"}
var tmp []model2.AppletApplicationAdSpaceList
MasterDb(c).Where("state=?", state).Find(&tmp)
for _, v := range tmp {
ids = append(ids, utils.IntToStr(v.MediumId))
}
mediumId = strings.Join(ids, ",")
}
return mediumId
}

// 应用
func GetAppletInfo(c *gin.Context, id string) map[string]string {
var res = map[string]string{
"platform": "",
"name": "",
}
NewAppletApplicationDb := implement2.NewAppletApplicationDb(MasterDb(c))
data, _ := NewAppletApplicationDb.GetAppletApplicationListByAppid(id)
if data != nil {
res["platform"] = data.Platform
res["name"] = data.Name
}
return res
}

// 广告位
func GetSlotInfo(c *gin.Context, id string) map[string]string {
var res = map[string]string{
"state": "",
"name": "",
}
NewAppletApplicationAdSpaceListDb := implement2.NewAppletApplicationAdSpaceListDb(MasterDb(c))
data, _ := NewAppletApplicationAdSpaceListDb.GetAppletApplicationAdSpaceListByAdId(id)
if data != nil {
res["name"] = data.Name
res["state"] = utils.IntToStr(data.State)
}
return res
}

+ 31
- 0
app/svc/svc_medium_agent.go View File

@@ -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 GetAgentInfo(c *gin.Context, mediumId int) map[string]string {
var res = map[string]string{
"account": "",
"name": "",
}
NewAgentDb := implement2.NewAgentDb(MasterDb(c))
NewAgentListDb := implement.NewAgentListDb(MasterDb(c))
medium := NewAgentDb.GetSuperAdmin(mediumId)
if medium != nil {
res["account"] = medium.Username
res["name"] = medium.Memo
}
NewAgentList, _ := NewAgentListDb.GetAgentList(mediumId)
if NewAgentList != nil {
if NewAgentList.CompanyName != "" {
res["name"] = NewAgentList.CompanyName
}
if NewAgentList.CompanyAbbreviation != "" {
res["name"] = NewAgentList.CompanyAbbreviation
}
}
return res
}

+ 741
- 8
docs/docs.go View File

@@ -25,6 +25,147 @@ const docTemplate = `{
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/api/dataCenter/generate/data/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.DataCenterGenerateDataCommReq"
}
}
],
"responses": {
"200": {
"description": "具体看返回内容 ",
"schema": {
"$ref": "#/definitions/md.DataCenterGenerateDataDetailData"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/dataCenter/generate/data/list": {
"post": {
"description": "数据中心-分成数据-列表",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"数据中心"
],
"summary": "分成数据-列表",
"parameters": [
{
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "请求参数",
"name": "args",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.DataCenterGenerateDataReq"
}
}
],
"responses": {
"200": {
"description": "具体看返回内容 这是data里面的数据",
"schema": {
"$ref": "#/definitions/md.DataCenterGenerateDataRes"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/dataCenter/original/data/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.DataCenterOriginalDataReq"
}
}
],
"responses": {
"200": {
"description": "具体看返回内容 这是data里面的数据",
"schema": {
"$ref": "#/definitions/md.DataCenterOriginalDataRes"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/login": {
"post": {
"description": "登入",
@@ -653,6 +794,147 @@ const docTemplate = `{
}
}
}
},
"/api/smsCenter/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.SmsDetailReq"
}
}
],
"responses": {
"200": {
"description": "具体看返回内容 这是data里面的数据",
"schema": {
"$ref": "#/definitions/md.SmsDetailResp"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/smsCenter/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.SmsListReq"
}
}
],
"responses": {
"200": {
"description": "具体看返回内容 这是data里面的数据",
"schema": {
"$ref": "#/definitions/md.SmsListResp"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/smsCenter/update": {
"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.SmsDetailReq"
}
}
],
"responses": {
"200": {
"description": "success",
"schema": {
"type": "string"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
}
},
"definitions": {
@@ -723,18 +1005,357 @@ const docTemplate = `{
}
}
},
"md.LoginReq": {
"md.DataCenterGenerateDataCommReq": {
"type": "object",
"required": [
"password",
"username"
],
"properties": {
"code": {
"id": {
"type": "string",
"example": "验证码"
"example": "列表id"
}
}
},
"md.DataCenterGenerateDataData": {
"type": "object",
"properties": {
"adv_name": {
"type": "string",
"example": "广告位"
},
"password": {
"agent_revenue": {
"type": "string",
"example": "代理收益(元)"
},
"agreement_sharing": {
"type": "string",
"example": "协议分成(元)"
},
"agreement_sharing_total": {
"type": "string",
"example": "协议总分成(元)"
},
"click_count": {
"type": "string",
"example": "现-点击量"
},
"click_rate": {
"type": "string",
"example": "现-点击率"
},
"commission_retention": {
"type": "string",
"example": "佣金留存(元)"
},
"date": {
"type": "string",
"example": "日期"
},
"ecpm": {
"type": "string",
"example": "'现-ecpm(元)"
},
"exposure_count": {
"type": "string",
"example": "现-曝光量"
},
"extra_revenue": {
"type": "string",
"example": "额外收益(元)"
},
"id": {
"type": "string",
"example": "id"
},
"is_generate_report": {
"type": "string",
"example": "是否已生成报表(0:未 1:已)"
},
"media_revenue": {
"type": "string",
"example": "媒体收益(元)"
},
"name": {
"type": "string",
"example": "名称"
},
"old_click_count": {
"type": "string",
"example": "原-点击量"
},
"old_click_rate": {
"type": "string",
"example": "原-点击率"
},
"old_ecpm": {
"type": "string",
"example": "'原-ecpm(元)"
},
"old_exposure_count": {
"type": "string",
"example": "原-曝光量"
},
"platform": {
"type": "string",
"example": "平台名称"
},
"platform_retention": {
"type": "string",
"example": "平台留存(元)"
},
"price_adjustment_retention": {
"type": "string",
"example": "调价留存(元)"
},
"state": {
"type": "string",
"example": "状态id"
}
}
},
"md.DataCenterGenerateDataDetailAgentReward": {
"type": "object",
"properties": {
"account": {
"type": "string"
},
"agent_revenue": {
"type": "string",
"example": "代理收益(元)"
},
"agent_revenue_rate": {
"type": "string",
"example": "代理收益百分比"
},
"extra_revenue": {
"type": "string",
"example": "额外收益(元)"
},
"extra_revenue_rate": {
"type": "string",
"example": "'额外收益百分比"
},
"name": {
"type": "string"
}
}
},
"md.DataCenterGenerateDataDetailData": {
"type": "object",
"properties": {
"agent_revenue_rate": {
"type": "string",
"example": "代理收益百分比"
},
"agent_reward": {
"type": "array",
"items": {
"$ref": "#/definitions/md.DataCenterGenerateDataDetailAgentReward"
}
},
"agreement_sharing_rate": {
"type": "string",
"example": "协议分成百分比"
},
"commission_retention_rate": {
"type": "string",
"example": "佣金留存百分比"
},
"create_at": {
"type": "string"
},
"extra_revenue_rate": {
"type": "string",
"example": "额外收益百分比"
},
"media_revenue_rate": {
"type": "string",
"example": "媒体收益百分比"
},
"platform_retention_rate": {
"type": "string",
"example": "平台留存百分比"
},
"update_at": {
"type": "string"
}
}
},
"md.DataCenterGenerateDataReq": {
"type": "object",
"properties": {
"end_time": {
"type": "string"
},
"limit": {
"type": "string"
},
"name": {
"type": "string"
},
"page": {
"type": "string"
},
"platform": {
"type": "string"
},
"start_time": {
"type": "string"
},
"state": {
"type": "string"
}
}
},
"md.DataCenterGenerateDataRes": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/md.DataCenterGenerateDataData"
}
},
"platform": {
"type": "array",
"items": {
"$ref": "#/definitions/md.SelectData"
}
},
"state": {
"type": "array",
"items": {
"$ref": "#/definitions/md.SelectData"
}
},
"total": {
"type": "integer"
}
}
},
"md.DataCenterOriginalDataData": {
"type": "object",
"properties": {
"adv_name": {
"type": "string",
"example": "广告位"
},
"click_count": {
"type": "string",
"example": "点击量"
},
"click_rate": {
"type": "string",
"example": "点击率"
},
"date": {
"type": "string",
"example": "日期"
},
"ecpm": {
"type": "string",
"example": "'ecpm(元)"
},
"exposure_count": {
"type": "string",
"example": "曝光量"
},
"exposure_rate": {
"type": "string",
"example": "曝光率"
},
"id": {
"type": "string",
"example": "id"
},
"is_apply": {
"type": "string",
"example": "是否已应用"
},
"name": {
"type": "string",
"example": "名称"
},
"platform": {
"type": "string",
"example": "平台名称"
},
"publisher_income": {
"type": "string",
"example": "总收益(元)"
},
"req_succ_count": {
"type": "string",
"example": "拉取量"
},
"state": {
"type": "string",
"example": "状态id"
}
}
},
"md.DataCenterOriginalDataReq": {
"type": "object",
"properties": {
"end_time": {
"type": "string"
},
"limit": {
"type": "string"
},
"name": {
"type": "string"
},
"page": {
"type": "string"
},
"platform": {
"type": "string"
},
"start_time": {
"type": "string"
},
"state": {
"type": "string"
}
}
},
"md.DataCenterOriginalDataRes": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/md.DataCenterOriginalDataData"
}
},
"platform": {
"type": "array",
"items": {
"$ref": "#/definitions/md.SelectData"
}
},
"state": {
"type": "array",
"items": {
"$ref": "#/definitions/md.SelectData"
}
},
"total": {
"type": "integer"
}
}
},
"md.LoginReq": {
"type": "object",
"required": [
"password",
"username"
],
"properties": {
"code": {
"type": "string",
"example": "验证码"
},
"password": {
"type": "string",
"example": "登录密码"
},
@@ -785,6 +1406,118 @@ const docTemplate = `{
}
}
},
"md.SelectData": {
"type": "object",
"properties": {
"name": {
"type": "string",
"example": "名称"
},
"value": {
"type": "string",
"example": "值"
}
}
},
"md.SmsDetail": {
"type": "object",
"properties": {
"create_at": {
"type": "string",
"example": "创建时间"
},
"id": {
"type": "integer"
},
"phone": {
"type": "string",
"example": "接收号码"
},
"state_zh": {
"type": "string",
"example": "发送状态"
}
}
},
"md.SmsDetailReq": {
"type": "object",
"properties": {
"limit": {
"type": "integer"
},
"page": {
"type": "integer"
},
"uuid": {
"type": "string",
"example": "站长ID"
}
}
},
"md.SmsDetailResp": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/md.SmsDetail"
}
},
"total": {
"type": "integer"
}
}
},
"md.SmsList": {
"type": "object",
"properties": {
"name": {
"type": "string",
"example": "站长名称"
},
"num": {
"description": "短信条数",
"type": "integer"
},
"uuid": {
"type": "string",
"example": "站长ID"
}
}
},
"md.SmsListReq": {
"type": "object",
"properties": {
"limit": {
"type": "integer"
},
"name": {
"type": "string",
"example": "站长名称"
},
"page": {
"type": "integer"
},
"uuid": {
"type": "string",
"example": "站长ID"
}
}
},
"md.SmsListResp": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/md.SmsList"
}
},
"total": {
"type": "integer"
}
}
},
"md.UpdateAdminReq": {
"type": "object",
"required": [


+ 741
- 8
docs/swagger.json View File

@@ -17,6 +17,147 @@
},
"host": "localhost:1001 or advertisement.dengbiao.top",
"paths": {
"/api/dataCenter/generate/data/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.DataCenterGenerateDataCommReq"
}
}
],
"responses": {
"200": {
"description": "具体看返回内容 ",
"schema": {
"$ref": "#/definitions/md.DataCenterGenerateDataDetailData"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/dataCenter/generate/data/list": {
"post": {
"description": "数据中心-分成数据-列表",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"数据中心"
],
"summary": "分成数据-列表",
"parameters": [
{
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "请求参数",
"name": "args",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.DataCenterGenerateDataReq"
}
}
],
"responses": {
"200": {
"description": "具体看返回内容 这是data里面的数据",
"schema": {
"$ref": "#/definitions/md.DataCenterGenerateDataRes"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/dataCenter/original/data/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.DataCenterOriginalDataReq"
}
}
],
"responses": {
"200": {
"description": "具体看返回内容 这是data里面的数据",
"schema": {
"$ref": "#/definitions/md.DataCenterOriginalDataRes"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/login": {
"post": {
"description": "登入",
@@ -645,6 +786,147 @@
}
}
}
},
"/api/smsCenter/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.SmsDetailReq"
}
}
],
"responses": {
"200": {
"description": "具体看返回内容 这是data里面的数据",
"schema": {
"$ref": "#/definitions/md.SmsDetailResp"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/smsCenter/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.SmsListReq"
}
}
],
"responses": {
"200": {
"description": "具体看返回内容 这是data里面的数据",
"schema": {
"$ref": "#/definitions/md.SmsListResp"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/smsCenter/update": {
"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.SmsDetailReq"
}
}
],
"responses": {
"200": {
"description": "success",
"schema": {
"type": "string"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
}
},
"definitions": {
@@ -715,18 +997,357 @@
}
}
},
"md.LoginReq": {
"md.DataCenterGenerateDataCommReq": {
"type": "object",
"required": [
"password",
"username"
],
"properties": {
"code": {
"id": {
"type": "string",
"example": "验证码"
"example": "列表id"
}
}
},
"md.DataCenterGenerateDataData": {
"type": "object",
"properties": {
"adv_name": {
"type": "string",
"example": "广告位"
},
"password": {
"agent_revenue": {
"type": "string",
"example": "代理收益(元)"
},
"agreement_sharing": {
"type": "string",
"example": "协议分成(元)"
},
"agreement_sharing_total": {
"type": "string",
"example": "协议总分成(元)"
},
"click_count": {
"type": "string",
"example": "现-点击量"
},
"click_rate": {
"type": "string",
"example": "现-点击率"
},
"commission_retention": {
"type": "string",
"example": "佣金留存(元)"
},
"date": {
"type": "string",
"example": "日期"
},
"ecpm": {
"type": "string",
"example": "'现-ecpm(元)"
},
"exposure_count": {
"type": "string",
"example": "现-曝光量"
},
"extra_revenue": {
"type": "string",
"example": "额外收益(元)"
},
"id": {
"type": "string",
"example": "id"
},
"is_generate_report": {
"type": "string",
"example": "是否已生成报表(0:未 1:已)"
},
"media_revenue": {
"type": "string",
"example": "媒体收益(元)"
},
"name": {
"type": "string",
"example": "名称"
},
"old_click_count": {
"type": "string",
"example": "原-点击量"
},
"old_click_rate": {
"type": "string",
"example": "原-点击率"
},
"old_ecpm": {
"type": "string",
"example": "'原-ecpm(元)"
},
"old_exposure_count": {
"type": "string",
"example": "原-曝光量"
},
"platform": {
"type": "string",
"example": "平台名称"
},
"platform_retention": {
"type": "string",
"example": "平台留存(元)"
},
"price_adjustment_retention": {
"type": "string",
"example": "调价留存(元)"
},
"state": {
"type": "string",
"example": "状态id"
}
}
},
"md.DataCenterGenerateDataDetailAgentReward": {
"type": "object",
"properties": {
"account": {
"type": "string"
},
"agent_revenue": {
"type": "string",
"example": "代理收益(元)"
},
"agent_revenue_rate": {
"type": "string",
"example": "代理收益百分比"
},
"extra_revenue": {
"type": "string",
"example": "额外收益(元)"
},
"extra_revenue_rate": {
"type": "string",
"example": "'额外收益百分比"
},
"name": {
"type": "string"
}
}
},
"md.DataCenterGenerateDataDetailData": {
"type": "object",
"properties": {
"agent_revenue_rate": {
"type": "string",
"example": "代理收益百分比"
},
"agent_reward": {
"type": "array",
"items": {
"$ref": "#/definitions/md.DataCenterGenerateDataDetailAgentReward"
}
},
"agreement_sharing_rate": {
"type": "string",
"example": "协议分成百分比"
},
"commission_retention_rate": {
"type": "string",
"example": "佣金留存百分比"
},
"create_at": {
"type": "string"
},
"extra_revenue_rate": {
"type": "string",
"example": "额外收益百分比"
},
"media_revenue_rate": {
"type": "string",
"example": "媒体收益百分比"
},
"platform_retention_rate": {
"type": "string",
"example": "平台留存百分比"
},
"update_at": {
"type": "string"
}
}
},
"md.DataCenterGenerateDataReq": {
"type": "object",
"properties": {
"end_time": {
"type": "string"
},
"limit": {
"type": "string"
},
"name": {
"type": "string"
},
"page": {
"type": "string"
},
"platform": {
"type": "string"
},
"start_time": {
"type": "string"
},
"state": {
"type": "string"
}
}
},
"md.DataCenterGenerateDataRes": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/md.DataCenterGenerateDataData"
}
},
"platform": {
"type": "array",
"items": {
"$ref": "#/definitions/md.SelectData"
}
},
"state": {
"type": "array",
"items": {
"$ref": "#/definitions/md.SelectData"
}
},
"total": {
"type": "integer"
}
}
},
"md.DataCenterOriginalDataData": {
"type": "object",
"properties": {
"adv_name": {
"type": "string",
"example": "广告位"
},
"click_count": {
"type": "string",
"example": "点击量"
},
"click_rate": {
"type": "string",
"example": "点击率"
},
"date": {
"type": "string",
"example": "日期"
},
"ecpm": {
"type": "string",
"example": "'ecpm(元)"
},
"exposure_count": {
"type": "string",
"example": "曝光量"
},
"exposure_rate": {
"type": "string",
"example": "曝光率"
},
"id": {
"type": "string",
"example": "id"
},
"is_apply": {
"type": "string",
"example": "是否已应用"
},
"name": {
"type": "string",
"example": "名称"
},
"platform": {
"type": "string",
"example": "平台名称"
},
"publisher_income": {
"type": "string",
"example": "总收益(元)"
},
"req_succ_count": {
"type": "string",
"example": "拉取量"
},
"state": {
"type": "string",
"example": "状态id"
}
}
},
"md.DataCenterOriginalDataReq": {
"type": "object",
"properties": {
"end_time": {
"type": "string"
},
"limit": {
"type": "string"
},
"name": {
"type": "string"
},
"page": {
"type": "string"
},
"platform": {
"type": "string"
},
"start_time": {
"type": "string"
},
"state": {
"type": "string"
}
}
},
"md.DataCenterOriginalDataRes": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/md.DataCenterOriginalDataData"
}
},
"platform": {
"type": "array",
"items": {
"$ref": "#/definitions/md.SelectData"
}
},
"state": {
"type": "array",
"items": {
"$ref": "#/definitions/md.SelectData"
}
},
"total": {
"type": "integer"
}
}
},
"md.LoginReq": {
"type": "object",
"required": [
"password",
"username"
],
"properties": {
"code": {
"type": "string",
"example": "验证码"
},
"password": {
"type": "string",
"example": "登录密码"
},
@@ -777,6 +1398,118 @@
}
}
},
"md.SelectData": {
"type": "object",
"properties": {
"name": {
"type": "string",
"example": "名称"
},
"value": {
"type": "string",
"example": "值"
}
}
},
"md.SmsDetail": {
"type": "object",
"properties": {
"create_at": {
"type": "string",
"example": "创建时间"
},
"id": {
"type": "integer"
},
"phone": {
"type": "string",
"example": "接收号码"
},
"state_zh": {
"type": "string",
"example": "发送状态"
}
}
},
"md.SmsDetailReq": {
"type": "object",
"properties": {
"limit": {
"type": "integer"
},
"page": {
"type": "integer"
},
"uuid": {
"type": "string",
"example": "站长ID"
}
}
},
"md.SmsDetailResp": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/md.SmsDetail"
}
},
"total": {
"type": "integer"
}
}
},
"md.SmsList": {
"type": "object",
"properties": {
"name": {
"type": "string",
"example": "站长名称"
},
"num": {
"description": "短信条数",
"type": "integer"
},
"uuid": {
"type": "string",
"example": "站长ID"
}
}
},
"md.SmsListReq": {
"type": "object",
"properties": {
"limit": {
"type": "integer"
},
"name": {
"type": "string",
"example": "站长名称"
},
"page": {
"type": "integer"
},
"uuid": {
"type": "string",
"example": "站长ID"
}
}
},
"md.SmsListResp": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/md.SmsList"
}
},
"total": {
"type": "integer"
}
}
},
"md.UpdateAdminReq": {
"type": "object",
"required": [


+ 501
- 0
docs/swagger.yaml View File

@@ -43,6 +43,245 @@ definitions:
required:
- adm_id
type: object
md.DataCenterGenerateDataCommReq:
properties:
id:
example: 列表id
type: string
type: object
md.DataCenterGenerateDataData:
properties:
adv_name:
example: 广告位
type: string
agent_revenue:
example: 代理收益(元)
type: string
agreement_sharing:
example: 协议分成(元)
type: string
agreement_sharing_total:
example: 协议总分成(元)
type: string
click_count:
example: 现-点击量
type: string
click_rate:
example: 现-点击率
type: string
commission_retention:
example: 佣金留存(元)
type: string
date:
example: 日期
type: string
ecpm:
example: '''现-ecpm(元)'
type: string
exposure_count:
example: 现-曝光量
type: string
extra_revenue:
example: 额外收益(元)
type: string
id:
example: id
type: string
is_generate_report:
example: 是否已生成报表(0:未 1:已)
type: string
media_revenue:
example: 媒体收益(元)
type: string
name:
example: 名称
type: string
old_click_count:
example: 原-点击量
type: string
old_click_rate:
example: 原-点击率
type: string
old_ecpm:
example: '''原-ecpm(元)'
type: string
old_exposure_count:
example: 原-曝光量
type: string
platform:
example: 平台名称
type: string
platform_retention:
example: 平台留存(元)
type: string
price_adjustment_retention:
example: 调价留存(元)
type: string
state:
example: 状态id
type: string
type: object
md.DataCenterGenerateDataDetailAgentReward:
properties:
account:
type: string
agent_revenue:
example: 代理收益(元)
type: string
agent_revenue_rate:
example: 代理收益百分比
type: string
extra_revenue:
example: 额外收益(元)
type: string
extra_revenue_rate:
example: '''额外收益百分比'
type: string
name:
type: string
type: object
md.DataCenterGenerateDataDetailData:
properties:
agent_revenue_rate:
example: 代理收益百分比
type: string
agent_reward:
items:
$ref: '#/definitions/md.DataCenterGenerateDataDetailAgentReward'
type: array
agreement_sharing_rate:
example: 协议分成百分比
type: string
commission_retention_rate:
example: 佣金留存百分比
type: string
create_at:
type: string
extra_revenue_rate:
example: 额外收益百分比
type: string
media_revenue_rate:
example: 媒体收益百分比
type: string
platform_retention_rate:
example: 平台留存百分比
type: string
update_at:
type: string
type: object
md.DataCenterGenerateDataReq:
properties:
end_time:
type: string
limit:
type: string
name:
type: string
page:
type: string
platform:
type: string
start_time:
type: string
state:
type: string
type: object
md.DataCenterGenerateDataRes:
properties:
list:
items:
$ref: '#/definitions/md.DataCenterGenerateDataData'
type: array
platform:
items:
$ref: '#/definitions/md.SelectData'
type: array
state:
items:
$ref: '#/definitions/md.SelectData'
type: array
total:
type: integer
type: object
md.DataCenterOriginalDataData:
properties:
adv_name:
example: 广告位
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
exposure_rate:
example: 曝光率
type: string
id:
example: id
type: string
is_apply:
example: 是否已应用
type: string
name:
example: 名称
type: string
platform:
example: 平台名称
type: string
publisher_income:
example: 总收益(元)
type: string
req_succ_count:
example: 拉取量
type: string
state:
example: 状态id
type: string
type: object
md.DataCenterOriginalDataReq:
properties:
end_time:
type: string
limit:
type: string
name:
type: string
page:
type: string
platform:
type: string
start_time:
type: string
state:
type: string
type: object
md.DataCenterOriginalDataRes:
properties:
list:
items:
$ref: '#/definitions/md.DataCenterOriginalDataData'
type: array
platform:
items:
$ref: '#/definitions/md.SelectData'
type: array
state:
items:
$ref: '#/definitions/md.SelectData'
type: array
total:
type: integer
type: object
md.LoginReq:
properties:
code:
@@ -85,6 +324,82 @@ definitions:
required:
- role_id
type: object
md.SelectData:
properties:
name:
example: 名称
type: string
value:
example: 值
type: string
type: object
md.SmsDetail:
properties:
create_at:
example: 创建时间
type: string
id:
type: integer
phone:
example: 接收号码
type: string
state_zh:
example: 发送状态
type: string
type: object
md.SmsDetailReq:
properties:
limit:
type: integer
page:
type: integer
uuid:
example: 站长ID
type: string
type: object
md.SmsDetailResp:
properties:
list:
items:
$ref: '#/definitions/md.SmsDetail'
type: array
total:
type: integer
type: object
md.SmsList:
properties:
name:
example: 站长名称
type: string
num:
description: 短信条数
type: integer
uuid:
example: 站长ID
type: string
type: object
md.SmsListReq:
properties:
limit:
type: integer
name:
example: 站长名称
type: string
page:
type: integer
uuid:
example: 站长ID
type: string
type: object
md.SmsListResp:
properties:
list:
items:
$ref: '#/definitions/md.SmsList'
type: array
total:
type: integer
type: object
md.UpdateAdminReq:
properties:
adm_id:
@@ -147,6 +462,99 @@ info:
title: 广告联盟-总站长平台
version: "1.0"
paths:
/api/dataCenter/generate/data/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.DataCenterGenerateDataCommReq'
produces:
- application/json
responses:
"200":
description: '具体看返回内容 '
schema:
$ref: '#/definitions/md.DataCenterGenerateDataDetailData'
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 分成数据-详情
tags:
- 数据中心
/api/dataCenter/generate/data/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.DataCenterGenerateDataReq'
produces:
- application/json
responses:
"200":
description: 具体看返回内容 这是data里面的数据
schema:
$ref: '#/definitions/md.DataCenterGenerateDataRes'
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 分成数据-列表
tags:
- 数据中心
/api/dataCenter/original/data/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.DataCenterOriginalDataReq'
produces:
- application/json
responses:
"200":
description: 具体看返回内容 这是data里面的数据
schema:
$ref: '#/definitions/md.DataCenterOriginalDataRes'
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 原始数据-列表
tags:
- 数据中心
/api/login:
post:
consumes:
@@ -562,6 +970,99 @@ paths:
summary: 修改角色状态
tags:
- 权限管理
/api/smsCenter/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.SmsDetailReq'
produces:
- application/json
responses:
"200":
description: 具体看返回内容 这是data里面的数据
schema:
$ref: '#/definitions/md.SmsDetailResp'
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 详情
tags:
- 短信中心
/api/smsCenter/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.SmsListReq'
produces:
- application/json
responses:
"200":
description: 具体看返回内容 这是data里面的数据
schema:
$ref: '#/definitions/md.SmsListResp'
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 列表
tags:
- 短信中心
/api/smsCenter/update:
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.SmsDetailReq'
produces:
- application/json
responses:
"200":
description: success
schema:
type: string
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 修改
tags:
- 短信中心
securityDefinitions:
MasterID:
in: header


+ 1
- 1
go.mod View File

@@ -5,7 +5,7 @@ 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.20240912093058-21813223cda2
code.fnuoos.com/zhimeng/model.git v0.0.3-0.20240920094146-abf78f48200d
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


Loading…
Cancel
Save