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
9ea91eeb
Commit
9ea91eeb
authored
May 07, 2019
by
chenmingyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
complete account service
parent
37529f12
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
328 additions
and
10 deletions
+328
-10
AccountApi.java
src/main/java/io/better/toutiao/api/account/AccountApi.java
+20
-0
AgentApi.java
src/main/java/io/better/toutiao/api/account/AgentApi.java
+8
-8
FundFlowApi.java
src/main/java/io/better/toutiao/api/account/FundFlowApi.java
+74
-0
AccountBalanceDTO.java
...java/io/better/toutiao/dto/account/AccountBalanceDTO.java
+70
-0
AccountDayFundFlowDTO.java
.../io/better/toutiao/dto/account/AccountDayFundFlowDTO.java
+65
-0
AccountFundFlowDetailDTO.java
.../better/toutiao/dto/account/AccountFundFlowDetailDTO.java
+68
-0
AdvertiserDTO.java
...ain/java/io/better/toutiao/dto/account/AdvertiserDTO.java
+4
-2
FundFlowCallBackDTO.java
...va/io/better/toutiao/dto/account/FundFlowCallBackDTO.java
+19
-0
No files found.
src/main/java/io/better/toutiao/api/account/AccountApi.java
View file @
9ea91eeb
package
io
.
better
.
toutiao
.
api
.
account
;
package
io
.
better
.
toutiao
.
api
.
account
;
import
io.better.toutiao.dto.TouTiaoRespDTO
;
import
org.springframework.cloud.netflix.feign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestHeader
;
import
org.springframework.web.bind.annotation.RequestParam
;
/**
/**
* 账号管家Api
*
* @author better create in 2019-05-07 15:15
* @author better create in 2019-05-07 15:15
*/
*/
@FeignClient
(
value
=
"https://ad.toutiao.com/open_api/2"
,
url
=
"/majordomo"
)
public
interface
AccountApi
{
public
interface
AccountApi
{
/**
* 账号服务-账号管家-广告主列表
*
* @param accessToken the access token
* @param advertiserId the advertiser id
* @return the advertiser list
*/
@GetMapping
(
value
=
"/advertiser/select/"
)
TouTiaoRespDTO
<?>
getAdvertiserList
(
@RequestHeader
(
"Access-Token"
)
String
accessToken
,
@RequestParam
(
"advertiser_id"
)
Long
advertiserId
);
}
}
src/main/java/io/better/toutiao/api/account/AgentApi.java
View file @
9ea91eeb
...
@@ -2,7 +2,7 @@ package io.better.toutiao.api.account;
...
@@ -2,7 +2,7 @@ package io.better.toutiao.api.account;
import
io.better.toutiao.dto.TouTiaoRespDTO
;
import
io.better.toutiao.dto.TouTiaoRespDTO
;
import
io.better.toutiao.dto.account.AdvertiserInfoDTO
;
import
io.better.toutiao.dto.account.AdvertiserInfoDTO
;
import
io.better.toutiao.dto.account.A
gent
DTO
;
import
io.better.toutiao.dto.account.A
dvertiser
DTO
;
import
org.springframework.cloud.netflix.feign.FeignClient
;
import
org.springframework.cloud.netflix.feign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -24,10 +24,10 @@ public interface AgentApi {
...
@@ -24,10 +24,10 @@ public interface AgentApi {
* @return advertiser by agent id
* @return advertiser by agent id
*/
*/
@GetMapping
(
value
=
"/advertiser/select"
)
@GetMapping
(
value
=
"/advertiser/select"
)
TouTiaoRespDTO
<
A
gent
DTO
>
getAdvertiserByAgentId
(
@RequestHeader
(
"Access-Token"
)
String
accessToken
,
TouTiaoRespDTO
<
A
dvertiser
DTO
>
getAdvertiserByAgentId
(
@RequestHeader
(
"Access-Token"
)
String
accessToken
,
@RequestParam
(
"advertiser_id"
)
Long
advertiserId
,
@RequestParam
(
"advertiser_id"
)
Long
advertiserId
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
,
required
=
false
)
String
page
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
,
required
=
false
)
String
page
,
@RequestParam
(
value
=
"page_size"
,
defaultValue
=
"100"
,
required
=
false
)
String
pageSize
);
@RequestParam
(
value
=
"page_size"
,
defaultValue
=
"100"
,
required
=
false
)
String
pageSize
);
/**
/**
* 账号服务-代理商账号-创建广告主信息
* 账号服务-代理商账号-创建广告主信息
...
@@ -61,7 +61,7 @@ public interface AgentApi {
...
@@ -61,7 +61,7 @@ public interface AgentApi {
* @return the second agent
* @return the second agent
*/
*/
@GetMapping
(
value
=
"/child_agent/select/"
)
@GetMapping
(
value
=
"/child_agent/select/"
)
TouTiaoRespDTO
<
A
gent
DTO
>
getSecondAgent
(
@RequestHeader
(
"Access-Token"
)
String
accessToken
,
TouTiaoRespDTO
<
A
dvertiser
DTO
>
getSecondAgent
(
@RequestHeader
(
"Access-Token"
)
String
accessToken
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
,
required
=
false
)
String
page
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
,
required
=
false
)
String
page
,
@RequestParam
(
value
=
"page_size"
,
defaultValue
=
"100"
,
required
=
false
)
String
pageSize
);
@RequestParam
(
value
=
"page_size"
,
defaultValue
=
"100"
,
required
=
false
)
String
pageSize
);
}
}
src/main/java/io/better/toutiao/api/account/FundFlowApi.java
0 → 100644
View file @
9ea91eeb
package
io
.
better
.
toutiao
.
api
.
account
;
import
io.better.toutiao.dto.TouTiaoRespDTO
;
import
io.better.toutiao.dto.account.AccountBalanceDTO
;
import
io.better.toutiao.dto.account.AccountDayFundFlowDTO
;
import
io.better.toutiao.dto.account.FundFlowCallBackDTO
;
import
org.springframework.cloud.netflix.feign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestHeader
;
import
org.springframework.web.bind.annotation.RequestParam
;
/**
* 账号服务-资金流水
*
* @author better create in 2019-05-07 16:45
*/
@FeignClient
(
value
=
"https://ad.toutiao.com/open_api/2"
,
url
=
"/advertiser/fund"
)
public
interface
FundFlowApi
{
/**
* 账号服务-资金流水-查询账户余额
*
* @param accessToken 访问凭证
* @param advertiserId 广告主ID
* @return the account balance
*/
@GetMapping
(
value
=
"/get"
)
TouTiaoRespDTO
<
AccountBalanceDTO
>
getAccountBalance
(
@RequestHeader
(
"Access-Token"
)
String
accessToken
,
@RequestParam
(
"advertiser_id"
)
Long
advertiserId
);
/**
* 账号服务-资金流水-查询账号日流水
*
* @param accessToken 访问凭证
* @param advertiserId 广告主ID
* @param startDate 开始时间
* @param endDate 结束时间
* @param page 第几页
* @param pageSize 每页记录数
* @return the account balance
*/
@GetMapping
(
value
=
"/daily_stat"
)
TouTiaoRespDTO
<
AccountDayFundFlowDTO
>
getAccountDayFundFlow
(
@RequestHeader
(
"Access-Token"
)
String
accessToken
,
@RequestParam
(
"advertiser_id"
)
Long
advertiserId
,
@RequestParam
(
value
=
"start_date"
,
required
=
false
)
String
startDate
,
@RequestParam
(
value
=
"end_date"
,
required
=
false
)
String
endDate
,
@RequestParam
(
value
=
"page"
,
required
=
false
,
defaultValue
=
"1"
)
Integer
page
,
@RequestParam
(
value
=
"page_size"
,
required
=
false
,
defaultValue
=
"10"
)
Integer
pageSize
);
/**
* 账号服务-资金流水-查询账号流水明细
*
* @param accessToken 访问凭证
* @param advertiserId 广告主ID
* @param startDate 开始时间
* @param endDate 结束时间
* @param transactionType 流水类型
* @param page 第几页
* @param pageSize 每页记录数
* @return the account balance
* @see io.better.toutiao.enums.FlowType 查看流水类型取值
*/
@GetMapping
(
value
=
"/transaction/get"
)
TouTiaoRespDTO
<
FundFlowCallBackDTO
>
getAccountFundFlowDetail
(
@RequestHeader
(
"Access-Token"
)
String
accessToken
,
@RequestParam
(
"advertiser_id"
)
Long
advertiserId
,
@RequestParam
(
value
=
"start_date"
)
String
startDate
,
@RequestParam
(
value
=
"end_date"
)
String
endDate
,
@RequestParam
(
value
=
"transaction_type"
)
String
transactionType
,
@RequestParam
(
value
=
"page"
,
required
=
false
,
defaultValue
=
"1"
)
Integer
page
,
@RequestParam
(
value
=
"page_size"
,
required
=
false
,
defaultValue
=
"10"
)
Integer
pageSize
);
}
src/main/java/io/better/toutiao/dto/account/AccountBalanceDTO.java
0 → 100644
View file @
9ea91eeb
package
io
.
better
.
toutiao
.
dto
.
account
;
import
io.better.toutiao.dto.BaseDTO
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* 账号余额信息
*
* @author better create in 2019-05-07 16:47
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
AccountBalanceDTO
extends
BaseDTO
{
/**
* 账户名
*/
private
String
name
;
/**
* 联系邮箱
*/
private
String
email
;
/**
* 账户总余额(单位元)
*/
private
Double
balance
;
/**
* 账户可用总余额(单位元)
*/
private
Double
validBalance
;
/**
* 现金余额(单位元)
*/
private
Double
cash
;
/**
* 现金可用余额(单位元)
*/
private
Double
validCash
;
/**
* 赠款余额(单位元)
*/
private
Double
grant
;
/**
* 赠款可用余额(单位元)
*/
private
Double
validGrant
;
/**
* 返货余额(单位元),仅支持部分广告主
*/
private
Double
returnGoodsAbs
;
/**
* 返货可用余额(单位元),仅支持部分广告主
*/
private
Double
validReturnGoodsAbs
;
/**
* 返货支出(单位元),仅支持部分广告主
*/
private
Double
returnGoodsCost
;
}
src/main/java/io/better/toutiao/dto/account/AccountDayFundFlowDTO.java
0 → 100644
View file @
9ea91eeb
package
io
.
better
.
toutiao
.
dto
.
account
;
import
io.better.toutiao.dto.BaseDTO
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* 账号资金日流水
*
* @author better create in 2019-05-07 16:47
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
AccountDayFundFlowDTO
extends
BaseDTO
{
/**
* 日期
*/
private
String
date
;
/**
* 日终结余(单位元)
*/
private
Double
balance
;
/**
* 现金支出(单位元)
*/
private
Double
cashCost
;
/**
* 总支出(单位元)
*/
private
Double
cost
;
/**
* 冻结(单位元)
*/
private
Double
frozen
;
/**
* 总存入(单位元)
*/
private
Double
income
;
/**
* 赠款支出(单位元)
*/
private
Double
rewardCost
;
/**
* 返货支出(单位元)
*/
private
Double
returnGoodsCost
;
/**
* 总转入(单位元)
*/
private
Double
transferIn
;
/**
* 总转出(单位元)
*/
private
Double
transferOut
;
}
src/main/java/io/better/toutiao/dto/account/AccountFundFlowDetailDTO.java
0 → 100644
View file @
9ea91eeb
package
io
.
better
.
toutiao
.
dto
.
account
;
import
io.better.toutiao.dto.BaseDTO
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* 账号资金流水明细
*
* @author better create in 2019-05-07 17:06
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
AccountFundFlowDetailDTO
extends
BaseDTO
{
/**
* 流水类型
*
* @see io.better.toutiao.enums.FlowType
*/
private
String
transactionType
;
/**
* 流水产生时间
*/
private
String
createTime
;
/**
* 交易总金额(单位元)
*/
private
Double
amount
;
/**
* 冻结总金额(单位元)
*/
private
Double
frozen
;
/**
* 现金总金额(单位元)
*/
private
Double
cash
;
/**
* 赠款总金额(单位元)
*/
private
Double
grant
;
/**
* 返货总金额(单位元)
*/
private
Double
returnGoods
;
/**
* 交易流水号
*/
private
Double
transactionSeq
;
/**
* 付款方,即广告主id
*/
private
Long
remitter
;
/**
* 收款方,即广告主id
*/
private
Long
payee
;
}
src/main/java/io/better/toutiao/dto/account/A
gent
DTO.java
→
src/main/java/io/better/toutiao/dto/account/A
dvertiser
DTO.java
View file @
9ea91eeb
package
io
.
better
.
toutiao
.
dto
.
account
;
package
io
.
better
.
toutiao
.
dto
.
account
;
import
io.better.toutiao.dto.BaseDTO
;
import
io.better.toutiao.dto.PageDTO
;
import
io.better.toutiao.dto.PageDTO
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.List
;
import
java.util.List
;
...
@@ -9,7 +11,8 @@ import java.util.List;
...
@@ -9,7 +11,8 @@ import java.util.List;
* @author better create in 2019-05-07 16:07
* @author better create in 2019-05-07 16:07
*/
*/
@Data
@Data
public
class
AgentDTO
{
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
AdvertiserDTO
extends
BaseDTO
{
/**
/**
* 广告主ID列表
* 广告主ID列表
...
@@ -21,7 +24,6 @@ public class AgentDTO {
...
@@ -21,7 +24,6 @@ public class AgentDTO {
*/
*/
private
PageDTO
page
;
private
PageDTO
page
;
/**
/**
* 二级代理商ID集合
* 二级代理商ID集合
*/
*/
...
...
src/main/java/io/better/toutiao/dto/account/FundFlowCallBackDTO.java
0 → 100644
View file @
9ea91eeb
package
io
.
better
.
toutiao
.
dto
.
account
;
import
lombok.Data
;
import
java.util.List
;
/**
* 资金流水返回DTO
*
* @author better create in 2019-05-07 17:21
*/
@Data
public
class
FundFlowCallBackDTO
{
/**
* 账号资金流水明细信息集合
*/
private
List
<
AccountFundFlowDetailDTO
>
list
;
}
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