huangjiajun 2 дні тому
джерело
коміт
9d32703e3e
9 змінених файлів з 545 додано та 15 видалено
  1. +15
    -0
      app/hdl/advertising/hdl_list.go
  2. +38
    -0
      app/md/md_advertising.go
  3. +1
    -0
      app/router/router.go
  4. +1
    -8
      app/svc/advertising/svc_function.go
  5. +55
    -0
      app/svc/advertising/svc_list.go
  6. +163
    -4
      docs/docs.go
  7. +161
    -1
      docs/swagger.json
  8. +110
    -1
      docs/swagger.yaml
  9. +1
    -1
      go.mod

+ 15
- 0
app/hdl/advertising/hdl_list.go Переглянути файл

@@ -20,6 +20,21 @@ func List(c *gin.Context) {
advertising.List(c)
}

// VisitList
// @Summary 广告管理-回调列表
// @Tags 广告管理
// @Description 广告管理-回调列表
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Param req body md.AdvertisingVisitListReq true "(分页信息必填)"
// @Success 200 {object} md.AdvertisingVisitListResp "具体数据"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/advertising/visit/list [post]
func VisitList(c *gin.Context) {
advertising.VisitList(c)
}

// Del
// @Summary 广告管理-广告列表-删除
// @Tags 广告管理


+ 38
- 0
app/md/md_advertising.go Переглянути файл

@@ -4,6 +4,14 @@ var AdvertisingPlatform = []map[string]string{
{"name": "穿山甲", "value": "chuanshanjia"},
{"name": "优量汇", "value": "youlianghui"},
}
var AdvertisingType = []map[string]string{
{"name": "APP开屏(开屏广告)", "value": "open_advertisement"},
{"name": "首页砸蛋(激励视频)", "value": "incentive_eggSmash"},
{"name": "首页签到(激励视频)", "value": "incentive_eggSign"},
{"name": "提现(激励视频)", "value": "incentive_withdraw"},
{"name": "积分兑换(插屏)", "value": "interstitial_integralExchange"},
{"name": "动态IM(信息流)", "value": "information_im"},
}

type AdvertisingBase struct {
AndroidAdIsOpen string `json:"android_ad_is_open" example:"安卓广告是否开启(1:开启 0:不开启)"`
@@ -24,6 +32,7 @@ type AdvertisingListReq struct {
Name string `json:"name"`
Kind string `json:"kind"`
}

type AdvertisingListResp struct {
AdvData []map[string]string `json:"adv_data"`
SelectData []map[string]string `json:"select_data"`
@@ -37,6 +46,35 @@ type AdvertisingList struct {
Info string `json:"info" example:"广告位配置 {\"chuanshanjia\":{\"android_ad_id\":[{\"id\":\"\",\"key\":\"\"}],\"ios_ad_id\":[{\"id\":\"\",\"key\":\"\"}}}"`
CountingDown string `json:"counting_down" example:"倒计时 单位秒"`
}
type AdvertisingVisitListReq struct {
Page string `json:"page"`
Limit string `json:"limit"`
Uid string `json:"uid"`
Phone string `json:"phone"`
Amount string `json:"amount" example:"ecpm "`
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
Platform string `json:"platform" example:"广告平台 "`
Type string `json:"type" example:"广告类型 "`
}

type AdvertisingVisitListResp struct {
PlatformData []map[string]string `json:"platform_data"`
TypeData []map[string]string `json:"type_data"`
Total int64 `json:"total"`
List []AdvertisingVisitList `json:"list"`
}
type AdvertisingVisitList struct {
Id string `json:"id" `
Uid string `json:"uid" example:"用户id"`
Phone string `json:"phone" example:"手机号"`
Ecpm string `json:"ecpm" example:"ecpm"`
Integral string `json:"integral" example:"活跃值"`
Platform string `json:"platform" example:"广告平台"`
PhonePlatform string `json:"phone_platform" example:"手机平台"`
Type string `json:"type" example:"广告位置"`
Time string `json:"time" example:"时间"`
}
type AdvertisingDelReq struct {
Id []string `json:"id"`
}


+ 1
- 0
app/router/router.go Переглянути файл

@@ -140,6 +140,7 @@ func rAdvertising(r *gin.RouterGroup) {
r.POST("/function/list", advertising.FunctionList)
r.POST("/function/save", advertising.FunctionSave)
r.POST("/function/del", advertising.FunctionDel)
r.POST("/visit/list", advertising.VisitList)
}
func rNotice(r *gin.RouterGroup) {
rBase := r.Group("/base") //极光


+ 1
- 8
app/svc/advertising/svc_function.go Переглянути файл

@@ -18,14 +18,7 @@ func FunctionList(c *gin.Context) {
}
var resp md.AdvertisingFunctionListResp
noticeList := make([]md.AdvertisingFunctionList, 0)
resp.SelectData = []map[string]string{
{"name": "APP开屏(开屏广告)", "value": "open_advertisement"},
{"name": "首页砸蛋(激励视频)", "value": "incentive_eggSmash"},
{"name": "首页签到(激励视频)", "value": "incentive_eggSign"},
{"name": "提现(激励视频)", "value": "incentive_withdraw"},
{"name": "积分兑换(插屏)", "value": "interstitial_integralExchange"},
{"name": "动态IM(信息流)", "value": "information_im"},
}
resp.SelectData = md.AdvertisingType
NewAdvertisingSpaceDb := implement.NewAdvertisingSpaceDb(db.Db)
adv, _, _ := NewAdvertisingSpaceDb.FindUserFeedbackCateAndTotal("1", "1000", "", "")
advList := make([]map[string]string, 0)


+ 55
- 0
app/svc/advertising/svc_list.go Переглянути файл

@@ -45,6 +45,61 @@ func List(c *gin.Context) {
e.OutSuc(c, resp, nil)
return
}
func VisitList(c *gin.Context) {
var req *md.AdvertisingVisitListReq
if err := c.ShouldBindJSON(&req); err != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err)
return
}
var resp md.AdvertisingVisitListResp
noticeList := make([]md.AdvertisingVisitList, 0)
resp.TypeData = md.AdvertisingType
resp.PlatformData = md.AdvertisingPlatform
uid := req.Uid
if req.Phone != "" {
userDb := implement.NewUserDb(db.Db)
user, err := userDb.UserGetOneByParams(map[string]interface{}{
"key": "phone",
"value": req.Phone,
})
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
uid = utils.Int64ToStr(user.Id)
}
NewAdvertisingCallbackDb := implement.NewAdvertisingCallbackDb(db.Db)
notice, total, _ := NewAdvertisingCallbackDb.FindAdvertisingCallbackAndTotal(req.Page, req.Limit, req.Amount, uid, req.StartTime, req.EndTime, req.Platform, req.Type)
resp.Total = total
if notice != nil {
for _, v := range *notice {
userDb := implement.NewUserDb(db.Db)
users, _ := userDb.UserGetOneByParams(map[string]interface{}{
"key": "id",
"value": v.Uid,
})
phone := ""
if users != nil {
phone = users.Phone
}
tmp := md.AdvertisingVisitList{
Id: utils.IntToStr(v.Id),
Uid: utils.IntToStr(v.Uid),
Phone: phone,
Ecpm: v.Amount,
Integral: v.Integral,
Platform: v.Platform,
PhonePlatform: v.PhonePlatform,
Type: v.Type,
Time: v.CreateAt.Format("2006-01-02 15:04:05"),
}
noticeList = append(noticeList, tmp)
}
}
resp.List = noticeList
e.OutSuc(c, resp, nil)
return
}
func Del(c *gin.Context) {
var req *md.ArticleCateDelReq
if err := c.ShouldBindJSON(&req); err != nil {


+ 163
- 4
docs/docs.go Переглянути файл

@@ -1,4 +1,5 @@
// Package docs Code generated by swaggo/swag. DO NOT EDIT
// Code generated by swaggo/swag. DO NOT EDIT.

package docs

import "github.com/swaggo/swag"
@@ -608,6 +609,53 @@ const docTemplate = `{
}
}
},
"/api/advertising/visit/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": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.AdvertisingVisitListReq"
}
}
],
"responses": {
"200": {
"description": "具体数据",
"schema": {
"$ref": "#/definitions/md.AdvertisingVisitListResp"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/article/cate/del": {
"post": {
"description": "分类列表-分类删除",
@@ -1608,7 +1656,9 @@ const docTemplate = `{
"name": "req",
"in": "body",
"required": true,
"schema": {}
"schema": {
"type": "object"
}
}
],
"responses": {
@@ -10431,6 +10481,113 @@ const docTemplate = `{
}
}
},
"md.AdvertisingVisitList": {
"type": "object",
"properties": {
"ecpm": {
"type": "string",
"example": "ecpm"
},
"id": {
"type": "string"
},
"integral": {
"type": "string",
"example": "活跃值"
},
"phone": {
"type": "string",
"example": "手机号"
},
"phone_platform": {
"type": "string",
"example": "手机平台"
},
"platform": {
"type": "string",
"example": "广告平台"
},
"time": {
"type": "string",
"example": "时间"
},
"type": {
"type": "string",
"example": "广告位置"
},
"uid": {
"type": "string",
"example": "用户id"
}
}
},
"md.AdvertisingVisitListReq": {
"type": "object",
"properties": {
"amount": {
"type": "string",
"example": "ecpm "
},
"end_time": {
"type": "string"
},
"limit": {
"type": "string"
},
"page": {
"type": "string"
},
"phone": {
"type": "string"
},
"platform": {
"type": "string",
"example": "广告平台 "
},
"start_time": {
"type": "string"
},
"type": {
"type": "string",
"example": "广告类型 "
},
"uid": {
"type": "string"
}
}
},
"md.AdvertisingVisitListResp": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/md.AdvertisingVisitList"
}
},
"platform_data": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"total": {
"type": "integer"
},
"type_data": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"md.AliyunSmsGetLevelListResp": {
"type": "object",
"properties": {
@@ -12389,6 +12546,10 @@ const docTemplate = `{
"description": "社区分红",
"type": "string"
},
"destruction_quantity_nums": {
"description": "销毁数量",
"type": "string"
},
"development_committee": {
"description": "发展委员会",
"type": "string"
@@ -17111,8 +17272,6 @@ var SwaggerInfo = &swag.Spec{
Description: "管理后台接口文档",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}

func init() {


+ 161
- 1
docs/swagger.json Переглянути файл

@@ -601,6 +601,53 @@
}
}
},
"/api/advertising/visit/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": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.AdvertisingVisitListReq"
}
}
],
"responses": {
"200": {
"description": "具体数据",
"schema": {
"$ref": "#/definitions/md.AdvertisingVisitListResp"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/article/cate/del": {
"post": {
"description": "分类列表-分类删除",
@@ -1601,7 +1648,9 @@
"name": "req",
"in": "body",
"required": true,
"schema": {}
"schema": {
"type": "object"
}
}
],
"responses": {
@@ -10424,6 +10473,113 @@
}
}
},
"md.AdvertisingVisitList": {
"type": "object",
"properties": {
"ecpm": {
"type": "string",
"example": "ecpm"
},
"id": {
"type": "string"
},
"integral": {
"type": "string",
"example": "活跃值"
},
"phone": {
"type": "string",
"example": "手机号"
},
"phone_platform": {
"type": "string",
"example": "手机平台"
},
"platform": {
"type": "string",
"example": "广告平台"
},
"time": {
"type": "string",
"example": "时间"
},
"type": {
"type": "string",
"example": "广告位置"
},
"uid": {
"type": "string",
"example": "用户id"
}
}
},
"md.AdvertisingVisitListReq": {
"type": "object",
"properties": {
"amount": {
"type": "string",
"example": "ecpm "
},
"end_time": {
"type": "string"
},
"limit": {
"type": "string"
},
"page": {
"type": "string"
},
"phone": {
"type": "string"
},
"platform": {
"type": "string",
"example": "广告平台 "
},
"start_time": {
"type": "string"
},
"type": {
"type": "string",
"example": "广告类型 "
},
"uid": {
"type": "string"
}
}
},
"md.AdvertisingVisitListResp": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/md.AdvertisingVisitList"
}
},
"platform_data": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"total": {
"type": "integer"
},
"type_data": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"md.AliyunSmsGetLevelListResp": {
"type": "object",
"properties": {
@@ -12382,6 +12538,10 @@
"description": "社区分红",
"type": "string"
},
"destruction_quantity_nums": {
"description": "销毁数量",
"type": "string"
},
"development_committee": {
"description": "发展委员会",
"type": "string"


+ 110
- 1
docs/swagger.yaml Переглянути файл

@@ -765,6 +765,80 @@ definitions:
example: 名称
type: string
type: object
md.AdvertisingVisitList:
properties:
ecpm:
example: ecpm
type: string
id:
type: string
integral:
example: 活跃值
type: string
phone:
example: 手机号
type: string
phone_platform:
example: 手机平台
type: string
platform:
example: 广告平台
type: string
time:
example: 时间
type: string
type:
example: 广告位置
type: string
uid:
example: 用户id
type: string
type: object
md.AdvertisingVisitListReq:
properties:
amount:
example: 'ecpm '
type: string
end_time:
type: string
limit:
type: string
page:
type: string
phone:
type: string
platform:
example: '广告平台 '
type: string
start_time:
type: string
type:
example: '广告类型 '
type: string
uid:
type: string
type: object
md.AdvertisingVisitListResp:
properties:
list:
items:
$ref: '#/definitions/md.AdvertisingVisitList'
type: array
platform_data:
items:
additionalProperties:
type: string
type: object
type: array
total:
type: integer
type_data:
items:
additionalProperties:
type: string
type: object
type: array
type: object
md.AliyunSmsGetLevelListResp:
properties:
list:
@@ -2107,6 +2181,9 @@ definitions:
community_dividends:
description: 社区分红
type: string
destruction_quantity_nums:
description: 销毁数量
type: string
development_committee:
description: 发展委员会
type: string
@@ -5780,6 +5857,37 @@ paths:
summary: 广告管理-短剧设置-信息保存
tags:
- 广告管理
/api/advertising/visit/list:
post:
consumes:
- application/json
description: 广告管理-回调列表
parameters:
- description: 验证参数Bearer和token空格拼接
in: header
name: Authorization
required: true
type: string
- description: (分页信息必填)
in: body
name: req
required: true
schema:
$ref: '#/definitions/md.AdvertisingVisitListReq'
produces:
- application/json
responses:
"200":
description: 具体数据
schema:
$ref: '#/definitions/md.AdvertisingVisitListResp'
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 广告管理-回调列表
tags:
- 广告管理
/api/article/cate/del:
post:
consumes:
@@ -6437,7 +6545,8 @@ paths:
in: body
name: req
required: true
schema: {}
schema:
type: object
produces:
- application/json
responses:


+ 1
- 1
go.mod Переглянути файл

@@ -33,7 +33,7 @@ require (
)

require (
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241214095356-fdac2df9537f
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241216065523-f6396041c02b
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241214095427-b3f9e6ed2446
code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be
code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5


Завантаження…
Відмінити
Зберегти