Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
toutiao-api
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
chenmingyang
toutiao-api
Commits
da45ae56
Commit
da45ae56
authored
Apr 29, 2019
by
BetterXT
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
complete AdvertisingPlan client and some dto
parent
6a68a574
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
271 additions
and
30 deletions
+271
-30
AdvertisingPlanApi.java
...r/toutiao/api/advertisingdelivery/AdvertisingPlanApi.java
+72
-19
BaseRespDTO.java
src/main/java/io/better/toutiao/dto/BaseRespDTO.java
+1
-3
AdvertisingPlanInDTO.java
...ao/dto/advertisingdelivery/plan/AdvertisingPlanInDTO.java
+17
-8
AdvertisingPlanOutDTO.java
...o/dto/advertisingdelivery/plan/AdvertisingPlanOutDTO.java
+145
-0
UpdateBidDTO.java
src/main/java/io/better/toutiao/dto/budget/UpdateBidDTO.java
+20
-0
UpdateBudgetDTO.java
...in/java/io/better/toutiao/dto/budget/UpdateBudgetDTO.java
+16
-0
No files found.
src/main/java/io/better/toutiao/api/advertisingdelivery/AdvertisingPlanApi.java
View file @
da45ae56
package
io
.
better
.
toutiao
.
api
.
advertisingdelivery
;
import
io.better.toutiao.dto.advertisingdelivery.plan.AdvertisingPlanDTO
;
import
io.better.toutiao.dto.BaseRespDTO
;
import
io.better.toutiao.dto.advertisingdelivery.plan.AdvertisingPlanInDTO
;
import
io.better.toutiao.dto.budget.UpdateBidDTO
;
import
io.better.toutiao.dto.budget.UpdateBudgetDTO
;
import
io.better.toutiao.dto.resp.AdvertisingPlanRespDTO
;
import
io.better.toutiao.dto.status.UpdateStatusDTO
;
import
org.springframework.cloud.netflix.feign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -8,6 +13,8 @@ import java.util.List;
import
java.util.Map
;
/**
* The interface Advertising plan api.
*
* @author better create in 2019-04-28 16:27
*/
@FeignClient
(
value
=
"https://ad.toutiao.com/open_api/2"
,
url
=
"/ad"
)
...
...
@@ -16,31 +23,77 @@ public interface AdvertisingPlanApi {
/**
* 广告投放-获取某广告的广告计划
*
* @param accessToken 访问凭证
* @param page 当前页
* @param pageSize 每页记录数
* @param filtering 过滤字段
* @param fields 查询字段
* @return
* @param accessToken 访问凭证
* @param advertiserId the advertiser id
* @param page 当前页
* @param pageSize 每页记录数
* @param filtering 过滤字段
* @param fields 查询字段
* @return advertising plan
*/
@GetMapping
(
value
=
"/get"
)
List
<
Object
>
getAdvertisingPlan
(
@RequestHeader
(
"Access-Token"
)
String
accessToken
,
@RequestParam
(
"advertiser_id"
)
Long
advertiserId
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
,
required
=
false
)
Integer
page
,
@RequestParam
(
value
=
"page_size"
,
defaultValue
=
"20"
,
required
=
false
)
Integer
pageSize
,
@RequestParam
(
value
=
"filtering"
,
required
=
false
)
Map
<
String
,
Object
>
filtering
,
@RequestParam
(
value
=
"fields"
,
required
=
false
)
String
[]
fields
);
BaseRespDTO
<
List
<
AdvertisingPlanRespDTO
>
>
getAdvertisingPlan
(
@RequestHeader
(
"Access-Token"
)
String
accessToken
,
@RequestParam
(
"advertiser_id"
)
Long
advertiserId
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
,
required
=
false
)
Integer
page
,
@RequestParam
(
value
=
"page_size"
,
defaultValue
=
"20"
,
required
=
false
)
Integer
pageSize
,
@RequestParam
(
value
=
"filtering"
,
required
=
false
)
Map
<
String
,
Object
>
filtering
,
@RequestParam
(
value
=
"fields"
,
required
=
false
)
String
[]
fields
);
/**
* 广告投放-为某广告创建广告计划
*
* @param accessToken 访问凭证
* @param advertisingPlanDTO 更新对象
* @return
* @param accessToken 访问凭证
* @param advertisingPlanIn 更新对象
* @return 广告计划ID
*/
@PostMapping
(
value
=
"/create"
)
BaseRespDTO
<
Integer
>
createAdvertisingPlan
(
@RequestHeader
(
"Access-Token"
)
String
accessToken
,
@RequestBody
AdvertisingPlanInDTO
advertisingPlanIn
);
/**
* 广告投放-更新某广告主的广告计划
*
* @param accessToken 访问凭证
* @param advertisingPlanIn 更新信息
* @return 广告计划ID
*/
@PostMapping
(
value
=
"
https://ad.toutiao.com/open_api/2/ad/create/
"
)
List
<
Object
>
cre
ateAdvertisingPlan
(
@RequestHeader
(
"Access-Token"
)
String
accessToken
,
@RequestBody
AdvertisingPlanDTO
advertisingPlanDTO
@PostMapping
(
value
=
"
/update
"
)
BaseRespDTO
<
Integer
>
upd
ateAdvertisingPlan
(
@RequestHeader
(
"Access-Token"
)
String
accessToken
,
@RequestBody
AdvertisingPlanInDTO
advertisingPlanIn
);
/**
* 广告投放-更新某广告主下广告计划状态,可以批量更新
*
* @param accessToken 访问凭证
* @param updateStatusDTO 更新状态信息
* @return 广告计划ID集合
*/
@PostMapping
(
value
=
"/update/status"
)
BaseRespDTO
<
List
<
Integer
>>
updateAdvertisingPlanStatus
(
@RequestHeader
(
"Access-Token"
)
String
accessToken
,
@RequestBody
UpdateStatusDTO
updateStatusDTO
);
/**
* 广告投放-更新某广告主下广告计划预算,可以批量更新
*
* @param accessToken 访问凭证
* @param updateBudget 更新预算信息
* @return 广告计划ID集合
*/
@PostMapping
(
value
=
"/update/budget"
)
BaseRespDTO
<
List
<
Integer
>>
updateAdvertisingPlanBudget
(
@RequestHeader
(
"Access-Token"
)
String
accessToken
,
@RequestBody
UpdateBudgetDTO
updateBudget
);
/**
* 广告投放-更新某广告主下广告计划出价,可以批量更新
*
* @param accessToken 访问凭证
* @param updateBid 更新预算信息
* @return 广告计划ID集合
*/
@PostMapping
(
value
=
"/update/bid"
)
BaseRespDTO
<
List
<
Integer
>>
updateAdvertisingPlanBid
(
@RequestHeader
(
"Access-Token"
)
String
accessToken
,
@RequestBody
UpdateBidDTO
updateBid
);
}
src/main/java/io/better/toutiao/dto/BaseRespDTO.java
View file @
da45ae56
...
...
@@ -2,8 +2,6 @@ package io.better.toutiao.dto;
import
lombok.Data
;
import
java.util.List
;
/**
* @author better create in 2019-04-29 14:06
*/
...
...
@@ -28,7 +26,7 @@ public class BaseRespDTO<T> {
/**
* 响应数据
*/
private
List
<
T
>
data
;
private
T
data
;
/**
* 是否成功
...
...
src/main/java/io/better/toutiao/dto/advertisingdelivery/plan/AdvertisingPlanDTO.java
→
src/main/java/io/better/toutiao/dto/advertisingdelivery/plan/AdvertisingPlan
In
DTO.java
View file @
da45ae56
...
...
@@ -6,7 +6,17 @@ import lombok.Data;
* @author better create in 2019-04-29 10:23
*/
@Data
public
class
AdvertisingPlanDTO
{
public
class
AdvertisingPlanInDTO
{
/**
* 广告主ID
*/
private
Integer
advertiserId
;
/**
* 广告组ID
*/
private
String
campaignId
;
/**
* 投放范围
...
...
@@ -14,31 +24,30 @@ public class AdvertisingPlanDTO {
private
String
deliveryRange
;
/**
*
*
广告预算类型
*/
private
String
budgetMode
;
/**
*
*
广告预算
*/
private
Long
budget
;
/**
*
*
广告投放起始时间
*/
private
String
startTime
;
/**
*
*
广告投放结束时间
*/
private
String
endTime
;
/**
*
*
广告出价
*/
private
Long
bid
;
/**
* 计划出价类型
*/
...
...
@@ -75,7 +84,7 @@ public class AdvertisingPlanDTO {
private
String
externalUrl
;
/**
*
*
应用下载方式
*/
private
String
downloadUrl
;
...
...
src/main/java/io/better/toutiao/dto/advertisingdelivery/plan/AdvertisingPlanOutDTO.java
0 → 100644
View file @
da45ae56
package
io
.
better
.
toutiao
.
dto
.
advertisingdelivery
.
plan
;
import
lombok.Data
;
/**
* @author better create in 2019-04-29 10:23
*/
@Data
public
class
AdvertisingPlanOutDTO
extends
AdvertisingPlanInDTO
{
/**
* 广告主ID
*/
private
Integer
advertiserId
;
/**
* 广告组ID
*/
private
String
campaignId
;
/**
* 投放范围
*/
private
String
deliveryRange
;
/**
* 广告预算类型
*/
private
String
budgetMode
;
/**
* 广告预算
*/
private
Long
budget
;
/**
* 广告投放起始时间
*/
private
String
startTime
;
/**
* 广告投放结束时间
*/
private
String
endTime
;
/**
* 广告出价
*/
private
Long
bid
;
/**
* 计划出价类型
*/
private
String
pricing
;
/**
* 广告投放时间类型
*/
private
String
scheduleType
;
/**
* 广告投放时段
*/
private
String
scheduleTime
;
/**
* 广告投放速度类型
*/
private
String
flowControlMode
;
/**
* 应用直达链接
*/
private
String
openUrl
;
/**
* 应用下载方式
*/
private
String
downloadType
;
/**
* 广告落地页链接
*/
private
String
externalUrl
;
/**
* 应用下载方式
*/
private
String
downloadUrl
;
/**
* 广告名称
*/
private
String
name
;
/**
* 应用广告下载类型
*/
private
String
appType
;
/**
* 广告应用下载包名
*/
private
String
packageName
;
/**
* 过滤已转化用户类型的字段,只有转化为目标时可填
*/
private
String
hideIfConverted
;
/**
* 过滤已安装,允许值: 0, 1
*/
private
Long
hideIfExists
;
/**
* ocpm广告转化出价
*/
private
Long
cpaBid
;
/**
* 转换ID
*/
private
Long
convertId
;
/**
* 穿山甲视频创意类型,允许值:ORIGINAL_VIDEO,REWARDED_VIDEO
*/
private
String
unionVideoType
;
/**
* 深度优化方式
*/
private
String
deepBidType
;
/**
* 深度优化出价,deep_bid_type=DEEP_BID_MIN时必填
*/
private
Long
deepCpabid
;
/**
* 第三方唯一键
*/
private
String
uniqueFk
;
}
src/main/java/io/better/toutiao/dto/budget/UpdateBidDTO.java
0 → 100644
View file @
da45ae56
package
io
.
better
.
toutiao
.
dto
.
budget
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author better create in 2019-04-29 14:48
*/
@Data
public
class
UpdateBidDTO
{
private
Long
advertiserId
;
private
Integer
[]
adIds
;
private
Integer
bid
;
private
List
data
;
}
src/main/java/io/better/toutiao/dto/budget/UpdateBudgetDTO.java
0 → 100644
View file @
da45ae56
package
io
.
better
.
toutiao
.
dto
.
budget
;
import
lombok.Data
;
/**
* @author better create in 2019-04-29 14:48
*/
@Data
public
class
UpdateBudgetDTO
{
private
Long
advertiserId
;
private
Integer
[]
campaignIds
;
private
String
optStatus
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment