Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
afanti-open-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
java-ms
afanti-open-api
Commits
acbd1d9e
Commit
acbd1d9e
authored
Jan 23, 2024
by
陈炎
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-V11.15.0' into 'develop'
Dev v11.15.0 See merge request
!40
parents
0a2280a4
30f84155
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
1109 additions
and
10 deletions
+1109
-10
AionOpenController.java
...fanticar/afantiopenapi/controller/AionOpenController.java
+159
-0
DwdDouyinAuthorInfoMapper.java
...r/afantiopenapi/mapper/adb/DwdDouyinAuthorInfoMapper.java
+16
-0
DwdDouyinAwemeInfoMapper.java
...ar/afantiopenapi/mapper/adb/DwdDouyinAwemeInfoMapper.java
+21
-0
DwdDouyinLiveInfoMapper.java
...car/afantiopenapi/mapper/adb/DwdDouyinLiveInfoMapper.java
+21
-0
DwsFhlMkmsAuthorActionDayMapper.java
...tiopenapi/mapper/adb/DwsFhlMkmsAuthorActionDayMapper.java
+22
-0
DwdDouyinAuthorInfo.java
...r/afantiopenapi/model/entity/adb/DwdDouyinAuthorInfo.java
+139
-0
DwdDouyinAwemeInfo.java
...ar/afantiopenapi/model/entity/adb/DwdDouyinAwemeInfo.java
+71
-0
DwdDouyinLiveInfo.java
...car/afantiopenapi/model/entity/adb/DwdDouyinLiveInfo.java
+82
-0
DwsFhlMkmsAuthorActionDay.java
...tiopenapi/model/entity/adb/DwsFhlMkmsAuthorActionDay.java
+55
-0
AionOpenService.java
.../com/afanticar/afantiopenapi/service/AionOpenService.java
+70
-0
DateUtils.java
...ain/java/com/afanticar/afantiopenapi/utils/DateUtils.java
+370
-0
bootstrap.yml
src/main/resources/bootstrap.yml
+4
-10
DwdDouyinAwemeInfoMapper.xml
src/main/resources/mapper/DwdDouyinAwemeInfoMapper.xml
+29
-0
DwdDouyinLiveInfoMapper.xml
src/main/resources/mapper/DwdDouyinLiveInfoMapper.xml
+28
-0
DwsFhlMkmsAuthorActionDayMapper.xml
...main/resources/mapper/DwsFhlMkmsAuthorActionDayMapper.xml
+22
-0
No files found.
src/main/java/com/afanticar/afantiopenapi/controller/AionOpenController.java
0 → 100644
View file @
acbd1d9e
package
com
.
afanticar
.
afantiopenapi
.
controller
;
import
cn.hutool.core.date.DateException
;
import
cn.hutool.core.date.DateUtil
;
import
com.afanticar.afantiopenapi.model.BaseResponse
;
import
com.afanticar.afantiopenapi.model.entity.adb.DwdDouyinAuthorInfo
;
import
com.afanticar.afantiopenapi.model.entity.adb.DwdDouyinAwemeInfo
;
import
com.afanticar.afantiopenapi.model.entity.adb.DwdDouyinLiveInfo
;
import
com.afanticar.afantiopenapi.model.entity.adb.DwsFhlMkmsAuthorActionDay
;
import
com.afanticar.afantiopenapi.model.vo.BasePageVO
;
import
com.afanticar.afantiopenapi.service.AionOpenService
;
import
com.afanticar.afantiopenapi.service.BaseService
;
import
com.afanticar.afantiopenapi.utils.DateUtils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.validation.constraints.Max
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author chin
* @contact chenyan@afanticar.com
* @since 2024/1/23/023
*/
@Api
(
"埃安数据接口"
)
@RestController
@RequestMapping
(
"/aion"
)
@Slf4j
@Validated
public
class
AionOpenController
extends
BaseController
{
@Autowired
AionOpenService
aionOpenService
;
@Autowired
BaseService
baseService
;
@Value
(
"${aion.client}"
)
String
client
;
@Value
(
"${aion.limit.period:60}"
)
Integer
limitPeriod
;
@Value
(
"${aion.limit.threshold:3}"
)
Integer
limit
;
static
String
dataType
=
"aion"
;
@ApiOperation
(
value
=
"主播数据信息"
,
notes
=
"主播数据"
,
produces
=
"application/json"
)
@GetMapping
(
"/douyin/author"
)
public
BaseResponse
<
List
<
DwdDouyinAuthorInfo
>>
getAuthorData
(
HttpServletRequest
request
)
{
BaseResponse
check
=
baseService
.
baseValidator
(
request
,
client
,
dataType
,
limit
,
limitPeriod
);
if
(
check
!=
null
)
{
return
check
;
}
return
success
(
aionOpenService
.
douyinAuthorInfo
());
}
@ApiOperation
(
value
=
"视频数据信息"
,
notes
=
"视频数据"
,
produces
=
"application/json"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"publish_date_end"
,
value
=
"结束时间,格式:2023-03-01 00:00:00"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"Date"
),
@ApiImplicitParam
(
name
=
"days"
,
value
=
"时间跨度"
,
paramType
=
"path"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"current_page"
,
value
=
"页码"
,
paramType
=
"path"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"page_size"
,
value
=
"页数"
,
paramType
=
"path"
,
dataType
=
"Integer"
),
})
@GetMapping
(
"/douyin/aweme"
)
public
BaseResponse
<
BasePageVO
<
DwdDouyinAwemeInfo
>>
getAwemeData
(
HttpServletRequest
request
,
@Max
(
value
=
5000
,
message
=
"单页数据page_size过大"
)
@RequestParam
(
name
=
"page_size"
,
defaultValue
=
"5000"
,
required
=
false
)
Integer
pageSize
,
@RequestParam
(
name
=
"current_page"
,
defaultValue
=
"1"
,
required
=
false
)
Integer
pageNum
,
@RequestParam
(
name
=
"publish_date_end"
,
required
=
false
)
String
publishDateEndStr
,
@RequestParam
(
name
=
"days"
,
defaultValue
=
"30"
,
required
=
false
)
Integer
days
)
{
BaseResponse
check
=
baseService
.
baseValidator
(
request
,
client
,
dataType
,
limit
,
limitPeriod
);
if
(
check
!=
null
)
{
return
check
;
}
Date
publishDateEnd
;
if
(
publishDateEndStr
!=
null
)
{
publishDateEnd
=
parseDate
(
publishDateEndStr
);
}
else
{
publishDateEnd
=
DateUtils
.
getZeroDate
(
new
Date
());
}
String
publishDateEndString
=
DateUtils
.
format
(
DateUtils
.
addDays
(
publishDateEnd
,
1
));
String
publishDateStartString
=
DateUtils
.
format
(
DateUtils
.
addDays
(
publishDateEnd
,
-
days
));
return
success
(
aionOpenService
.
douyinAwemeInfo
(
publishDateStartString
,
publishDateEndString
,
pageNum
,
pageSize
));
}
@ApiOperation
(
value
=
"直播数据信息"
,
notes
=
"直播数据"
,
produces
=
"application/json"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"publish_date_end"
,
value
=
"结束时间,格式:2023-03-01 00:00:00"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"Date"
),
@ApiImplicitParam
(
name
=
"days"
,
value
=
"时间跨度"
,
paramType
=
"path"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"current_page"
,
value
=
"页码"
,
paramType
=
"path"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"page_size"
,
value
=
"页数"
,
paramType
=
"path"
,
dataType
=
"Integer"
),
})
@GetMapping
(
"/douyin/live"
)
public
BaseResponse
<
BasePageVO
<
DwdDouyinLiveInfo
>>
getLiveData
(
HttpServletRequest
request
,
@Max
(
value
=
5000
,
message
=
"单页数据page_size过大"
)
@RequestParam
(
name
=
"page_size"
,
defaultValue
=
"5000"
,
required
=
false
)
Integer
pageSize
,
@RequestParam
(
name
=
"current_page"
,
defaultValue
=
"1"
,
required
=
false
)
Integer
pageNum
,
@RequestParam
(
name
=
"publish_date_end"
,
required
=
false
)
String
publishDateEndStr
,
@RequestParam
(
name
=
"days"
,
defaultValue
=
"2"
,
required
=
false
)
Integer
days
)
{
BaseResponse
check
=
baseService
.
baseValidator
(
request
,
client
,
dataType
,
limit
,
limitPeriod
);
if
(
check
!=
null
)
{
return
check
;
}
Date
publishDateEnd
;
if
(
publishDateEndStr
!=
null
)
{
publishDateEnd
=
parseDate
(
publishDateEndStr
);
}
else
{
publishDateEnd
=
DateUtils
.
getZeroDate
(
new
Date
());
}
String
publishDateEndString
=
DateUtils
.
format
(
DateUtils
.
addDays
(
publishDateEnd
,
1
));
String
publishDateStartString
=
DateUtils
.
format
(
DateUtils
.
addDays
(
publishDateEnd
,
-
days
));
return
success
(
aionOpenService
.
douyinLiveInfo
(
publishDateStartString
,
publishDateEndString
,
pageNum
,
pageSize
));
}
@ApiOperation
(
value
=
"直播数据信息"
,
notes
=
"直播数据"
,
produces
=
"application/json"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"statistics_date"
,
value
=
"统计时间,格式:2023-02-01"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"Date"
),
@ApiImplicitParam
(
name
=
"current_page"
,
value
=
"页码"
,
paramType
=
"path"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"page_size"
,
value
=
"页数"
,
paramType
=
"path"
,
dataType
=
"Integer"
),
})
@GetMapping
(
"/douyin/author/private/chat"
)
public
BaseResponse
<
BasePageVO
<
DwsFhlMkmsAuthorActionDay
>>
getLiveData
(
HttpServletRequest
request
,
@Max
(
value
=
5000
,
message
=
"单页数据page_size过大"
)
@RequestParam
(
name
=
"page_size"
,
defaultValue
=
"5000"
,
required
=
false
)
Integer
pageSize
,
@RequestParam
(
name
=
"current_page"
,
defaultValue
=
"1"
,
required
=
false
)
Integer
pageNum
,
@RequestParam
(
name
=
"statistics_date"
,
required
=
false
)
String
statisticsDateStr
)
{
BaseResponse
check
=
baseService
.
baseValidator
(
request
,
client
,
dataType
,
limit
,
limitPeriod
);
if
(
check
!=
null
)
{
return
check
;
}
Date
publishDateEnd
;
if
(
statisticsDateStr
!=
null
)
{
publishDateEnd
=
parseDate
(
statisticsDateStr
);
}
else
{
publishDateEnd
=
DateUtils
.
getZeroDate
(
new
Date
());
}
String
publishDateStartString
=
DateUtils
.
format
(
DateUtils
.
addDays
(
publishDateEnd
,
-
1
));
String
publishDateEndString
=
DateUtils
.
format
(
publishDateEnd
);
return
success
(
aionOpenService
.
douyinFhlMkmsAuthorInfo
(
publishDateStartString
,
publishDateEndString
,
pageNum
,
pageSize
));
}
private
static
Date
parseDate
(
String
publishDateStr
)
{
Date
publishDate
=
null
;
try
{
publishDate
=
DateUtil
.
parse
(
publishDateStr
,
"yyyy-MM-dd"
);
}
catch
(
DateException
ignore
)
{
}
return
publishDate
;
}
}
src/main/java/com/afanticar/afantiopenapi/mapper/adb/DwdDouyinAuthorInfoMapper.java
0 → 100644
View file @
acbd1d9e
package
com
.
afanticar
.
afantiopenapi
.
mapper
.
adb
;
import
com.afanticar.afantiopenapi.model.entity.adb.DwdDouyinAuthorInfo
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* @author chin
* @contact chenyan@afanticar.com
* @since 2023/4/26/026
*/
@Mapper
@DS
(
"afanti-bi-app"
)
public
interface
DwdDouyinAuthorInfoMapper
extends
BaseMapper
<
DwdDouyinAuthorInfo
>
{
}
src/main/java/com/afanticar/afantiopenapi/mapper/adb/DwdDouyinAwemeInfoMapper.java
0 → 100644
View file @
acbd1d9e
package
com
.
afanticar
.
afantiopenapi
.
mapper
.
adb
;
import
com.afanticar.afantiopenapi.model.entity.adb.DwdDouyinAwemeInfo
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
/**
* @author chin
* @contact chenyan@afanticar.com
* @since 2023/4/26/026
*/
@Mapper
@DS
(
"afanti-bi-app"
)
public
interface
DwdDouyinAwemeInfoMapper
extends
BaseMapper
<
DwdDouyinAwemeInfo
>
{
IPage
<
DwdDouyinAwemeInfo
>
getPage
(
IPage
<
DwdDouyinAwemeInfo
>
page
,
@Param
(
"principalId"
)
String
principalId
,
@Param
(
"publishTimeGte"
)
String
publishTimeGte
,
@Param
(
"publishTimeLt"
)
String
publishTimeLt
);
}
src/main/java/com/afanticar/afantiopenapi/mapper/adb/DwdDouyinLiveInfoMapper.java
0 → 100644
View file @
acbd1d9e
package
com
.
afanticar
.
afantiopenapi
.
mapper
.
adb
;
import
com.afanticar.afantiopenapi.model.entity.adb.DwdDouyinLiveInfo
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
/**
* @author chin
* @contact chenyan@afanticar.com
* @since 2023/4/26/026
*/
@Mapper
@DS
(
"afanti-bi-app"
)
public
interface
DwdDouyinLiveInfoMapper
extends
BaseMapper
<
DwdDouyinLiveInfo
>
{
IPage
<
DwdDouyinLiveInfo
>
getPage
(
IPage
<
DwdDouyinLiveInfo
>
page
,
@Param
(
"principalId"
)
String
principalId
,
@Param
(
"publishTimeGte"
)
String
publishTimeGte
,
@Param
(
"publishTimeLt"
)
String
publishTimeLt
);
}
src/main/java/com/afanticar/afantiopenapi/mapper/adb/DwsFhlMkmsAuthorActionDayMapper.java
0 → 100644
View file @
acbd1d9e
package
com
.
afanticar
.
afantiopenapi
.
mapper
.
adb
;
import
com.afanticar.afantiopenapi.model.entity.adb.DwsFhlMkmsAuthorActionDay
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
/**
* @author chin
* @contact chenyan@afanticar.com
* @since 2023/4/26/026
*/
@Mapper
@DS
(
"afanti-bi-app"
)
public
interface
DwsFhlMkmsAuthorActionDayMapper
extends
BaseMapper
<
DwsFhlMkmsAuthorActionDay
>
{
IPage
<
DwsFhlMkmsAuthorActionDay
>
getPage
(
IPage
<
DwsFhlMkmsAuthorActionDay
>
page
,
@Param
(
"principalId"
)
String
principalId
,
@Param
(
"statisticsGte"
)
String
statisticsGte
,
@Param
(
"statisticsLt"
)
String
statisticsLt
);
}
src/main/java/com/afanticar/afantiopenapi/model/entity/adb/DwdDouyinAuthorInfo.java
0 → 100644
View file @
acbd1d9e
package
com
.
afanticar
.
afantiopenapi
.
model
.
entity
.
adb
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
* 抖音主播信息
* </p>
*
* @author Wsr
* @since 2023-02-09
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName
(
"dwd_douyin_author_info"
)
@ApiModel
(
value
=
"DwdDouyinAuthorInfo对象"
,
description
=
"抖音主播信息"
)
public
class
DwdDouyinAuthorInfo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"主播ID"
)
@TableId
(
"author_id"
)
private
String
authorId
;
@ApiModelProperty
(
"主播抖音号"
)
@TableField
(
"code"
)
private
String
code
;
@ApiModelProperty
(
"主播性别"
)
@TableField
(
"gender"
)
private
Integer
gender
;
@ApiModelProperty
(
"主播签名"
)
@TableField
(
"signature"
)
private
String
signature
;
@ApiModelProperty
(
"主播认证名称"
)
@TableField
(
"verify_name"
)
private
String
verifyName
;
@ApiModelProperty
(
"主播昵称"
)
@TableField
(
"nickname"
)
private
String
nickname
;
@ApiModelProperty
(
"抖音主播认证类型"
)
@TableField
(
"verification_type"
)
private
String
verificationType
;
@ApiModelProperty
(
"抖音主播认证名称"
)
@TableField
(
"verification_name"
)
private
String
verificationName
;
@ApiModelProperty
(
"主播头像"
)
@TableField
(
"avatar"
)
private
String
avatar
;
@ApiModelProperty
(
"经销商id"
)
@TableField
(
"dealer_id"
)
private
String
dealerId
;
@ApiModelProperty
(
"经销商名称"
)
@TableField
(
"dealer_name"
)
private
String
dealerName
;
@ApiModelProperty
(
"经销商城市code"
)
@TableField
(
"dealer_city_code"
)
private
Long
dealerCityCode
;
@ApiModelProperty
(
"经销商城市名称"
)
@TableField
(
"dealer_city_name"
)
private
String
dealerCityName
;
@ApiModelProperty
(
"经销商地区code"
)
@TableField
(
"dealer_county_code"
)
private
Long
dealerCountyCode
;
@ApiModelProperty
(
"经销商地区名称"
)
@TableField
(
"dealer_county_name"
)
private
String
dealerCountyName
;
@ApiModelProperty
(
"经销商省份code"
)
@TableField
(
"dealer_province_code"
)
private
Long
dealerProvinceCode
;
@ApiModelProperty
(
"经销商省份名称"
)
@TableField
(
"dealer_province_name"
)
private
String
dealerProvinceName
;
@ApiModelProperty
(
"主播总点赞数"
)
@TableField
(
"like_count_total"
)
private
Integer
likeCountTotal
;
@ApiModelProperty
(
"主播总视频数"
)
@TableField
(
"aweme_count_total"
)
private
Integer
awemeCountTotal
;
@ApiModelProperty
(
"主播总粉丝数"
)
@TableField
(
"fans_count_total"
)
private
Integer
fansCountTotal
;
@ApiModelProperty
(
"主播抖音粉丝数"
)
@TableField
(
"fans_dy_count"
)
private
Integer
fansDyCount
;
@ApiModelProperty
(
"主播头条粉丝数"
)
@TableField
(
"fans_tt_count"
)
private
Integer
fansTtCount
;
@ApiModelProperty
(
"主播火山粉丝数"
)
@TableField
(
"fans_hs_count"
)
private
Integer
fansHsCount
;
@ApiModelProperty
(
"更新时间"
)
@TableField
(
value
=
"mtime"
,
fill
=
FieldFill
.
INSERT_UPDATE
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
mtime
;
@ApiModelProperty
(
"账号类型:10经销商未分类,11经销商官号,12经销商个人号,13经销商营销号;20主机厂号未分类;21主机厂官号,22主机厂营销号;41汽车KOL,14:经销商售后,15:经销商二手车,30:经销商大区号 ; NULL 既不是品牌主播号,也不是经销商主播号,又不是汽车分类主播号的主播号"
)
@TableField
(
"account_type"
)
private
Integer
accountType
;
@ApiModelProperty
(
"主播状态, 0正常;1删除"
)
@TableField
(
"author_status"
)
private
Integer
authorStatus
;
}
src/main/java/com/afanticar/afantiopenapi/model/entity/adb/DwdDouyinAwemeInfo.java
0 → 100644
View file @
acbd1d9e
package
com
.
afanticar
.
afantiopenapi
.
model
.
entity
.
adb
;
import
com.alibaba.fastjson.PropertyNamingStrategy
;
import
com.alibaba.fastjson.annotation.JSONType
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
java.util.Date
;
@Data
@TableName
(
"dwd_douyin_aweme_info"
)
@JSONType
(
naming
=
PropertyNamingStrategy
.
SnakeCase
)
public
class
DwdDouyinAwemeInfo
{
/**
* 视频id
*/
private
String
awemeId
;
/**
* 主播id
*/
private
String
authorId
;
/**
* 视频标题
*/
private
String
awemeTitle
;
/**
* 视频状态
*/
private
Integer
awemeStatus
;
/**
* 视频地址
*/
private
String
awemeUrl
;
/**
* 视频标签
*/
private
String
awemeTopic
;
/**
* 视频总播放量
*/
private
Integer
playVolume
;
/**
* 总评论数
*/
private
Integer
commentCount
;
/**
* 总分享数
*/
private
Integer
shareCount
;
/**
* 总点赞数
*/
private
Integer
diggCount
;
/**
* 视频时长(毫秒)
*/
private
Integer
duration
;
/**
* 视频发布时间
*/
private
Date
publishTime
;
/**
* 系统更新时间
*/
private
Date
mtime
;
/**
* 数据同步更新的时间点
*/
private
Date
dataUpdateTime
;
}
src/main/java/com/afanticar/afantiopenapi/model/entity/adb/DwdDouyinLiveInfo.java
0 → 100644
View file @
acbd1d9e
package
com
.
afanticar
.
afantiopenapi
.
model
.
entity
.
adb
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
* 抖音直播间信息
* </p>
*
* @author Wsr
* @since 2023-02-09
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName
(
"dwd_douyin_live_info"
)
@ApiModel
(
value
=
"DwdDouyinLiveInfo对象"
,
description
=
"抖音直播间信息"
)
public
class
DwdDouyinLiveInfo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
"room_id"
)
private
String
roomId
;
@ApiModelProperty
(
"主播ID"
)
@TableField
(
"author_id"
)
private
String
authorId
;
@ApiModelProperty
(
"直播标题"
)
@TableField
(
"title"
)
private
String
title
;
@ApiModelProperty
(
"视频封面"
)
@TableField
(
"cover"
)
private
String
cover
;
@ApiModelProperty
(
"直播开始时间"
)
@TableField
(
"publish_time"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
publishTime
;
@ApiModelProperty
(
"直播结束时间"
)
@TableField
(
"finish_time"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
finishTime
;
@ApiModelProperty
(
"本场直播总观看人数(去重,需自己统计)"
)
@TableField
(
"statistics_total_watch_user_count"
)
private
Integer
statisticsTotalWatchUserCount
;
@ApiModelProperty
(
"本场直播总观看人次(没去重,对标直播间报告中的watch_cnt)"
)
@TableField
(
"statistics_total_watch_user_time"
)
private
Integer
statisticsTotalWatchUserTime
;
@ApiModelProperty
(
"本场最高在线人数(取直播报告事件中user_count或直播进入房间人员信息事件中user_count最高的值)"
)
@TableField
(
"statistics_max_online_user"
)
private
Integer
statisticsMaxOnlineUser
;
@ApiModelProperty
(
"本场直播总点赞数"
)
@TableField
(
"statistics_total_like_count"
)
private
Integer
statisticsTotalLikeCount
;
@ApiModelProperty
(
"本场直播时长"
)
@TableField
(
"statistics_live_time"
)
private
Integer
statisticsLiveTime
;
@ApiModelProperty
(
"本场直播新增粉丝数"
)
@TableField
(
"statistics_fans_add"
)
private
Integer
statisticsFansAdd
;
}
src/main/java/com/afanticar/afantiopenapi/model/entity/adb/DwsFhlMkmsAuthorActionDay.java
0 → 100644
View file @
acbd1d9e
package
com
.
afanticar
.
afantiopenapi
.
model
.
entity
.
adb
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
/**
* <p>
* 抖音主播信息
* </p>
*
* @author Wsr
* @since 2023-02-09
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName
(
"dws_fhl_mkms_author_action_day"
)
@ApiModel
(
value
=
"DwsFhlMkmsAuthorActionDay对象"
,
description
=
"主播线索信息"
)
public
class
DwsFhlMkmsAuthorActionDay
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"进入私信人数"
)
@TableField
(
"session_entered_count"
)
private
Integer
sessionEnteredCount
;
@ApiModelProperty
(
"开口数"
)
@TableField
(
"user_speak_count"
)
private
Integer
userSpeakCount
;
@ApiModelProperty
(
"开口率"
)
@TableField
(
"user_speak_rate"
)
private
BigDecimal
userSpeakRate
;
@ApiModelProperty
(
"留电话人数"
)
@TableField
(
"pp_leads_count"
)
private
Integer
ppLeadsCount
;
@ApiModelProperty
(
"私信线索数"
)
@TableField
(
"message_leads_count"
)
private
Integer
messageLeadsCount
;
@ApiModelProperty
(
"3分钟回复率"
)
@TableField
(
"reply_within_3min_rate"
)
private
String
replyWithin3minRate
;
}
src/main/java/com/afanticar/afantiopenapi/service/AionOpenService.java
0 → 100644
View file @
acbd1d9e
package
com
.
afanticar
.
afantiopenapi
.
service
;
import
com.afanticar.afantiopenapi.mapper.adb.DwdDouyinAuthorInfoMapper
;
import
com.afanticar.afantiopenapi.mapper.adb.DwdDouyinAwemeInfoMapper
;
import
com.afanticar.afantiopenapi.mapper.adb.DwdDouyinLiveInfoMapper
;
import
com.afanticar.afantiopenapi.mapper.adb.DwsFhlMkmsAuthorActionDayMapper
;
import
com.afanticar.afantiopenapi.model.entity.adb.DwdDouyinAuthorInfo
;
import
com.afanticar.afantiopenapi.model.entity.adb.DwdDouyinAwemeInfo
;
import
com.afanticar.afantiopenapi.model.entity.adb.DwdDouyinLiveInfo
;
import
com.afanticar.afantiopenapi.model.entity.adb.DwsFhlMkmsAuthorActionDay
;
import
com.afanticar.afantiopenapi.model.vo.BasePageVO
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.github.pagehelper.PageHelper
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* @author chin
* @contact chenyan@afanticar.com
* @since 2024/1/22/022
*/
@Service
public
class
AionOpenService
{
private
final
String
principalId
=
"869753082057052160"
;
@Resource
DwdDouyinAuthorInfoMapper
dwdDouyinAuthorInfoMapper
;
@Resource
DwdDouyinAwemeInfoMapper
dwdDouyinAwemeInfoMapper
;
@Resource
DwdDouyinLiveInfoMapper
dwdDouyinLiveInfoMapper
;
@Resource
DwsFhlMkmsAuthorActionDayMapper
dwsFhlMkmsAuthorActionDayMapper
;
public
List
<
DwdDouyinAuthorInfo
>
douyinAuthorInfo
()
{
QueryWrapper
<
DwdDouyinAuthorInfo
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"principal_ids"
,
principalId
).
eq
(
"author_status"
,
0
);
return
dwdDouyinAuthorInfoMapper
.
selectList
(
queryWrapper
);
}
public
BasePageVO
<
DwdDouyinAwemeInfo
>
douyinAwemeInfo
(
String
publishTimeGte
,
String
publishTimeLt
,
Integer
pageNum
,
Integer
pageSize
)
{
PageHelper
.
orderBy
(
" publish_time DESC "
);
IPage
<
DwdDouyinAwemeInfo
>
page
=
new
Page
<>(
pageNum
,
pageSize
);
IPage
<
DwdDouyinAwemeInfo
>
awemePage
=
dwdDouyinAwemeInfoMapper
.
getPage
(
page
,
principalId
,
publishTimeGte
,
publishTimeLt
);
return
BasePageVO
.
restPage
(
pageNum
,
(
int
)
awemePage
.
getSize
(),
(
int
)
awemePage
.
getTotal
(),
(
int
)
awemePage
.
getPages
(),
awemePage
.
getRecords
());
}
public
BasePageVO
<
DwdDouyinLiveInfo
>
douyinLiveInfo
(
String
publishTimeGte
,
String
publishTimeLt
,
Integer
pageNum
,
Integer
pageSize
)
{
PageHelper
.
orderBy
(
" publish_time DESC "
);
IPage
<
DwdDouyinLiveInfo
>
page
=
new
Page
<>(
pageNum
,
pageSize
);
IPage
<
DwdDouyinLiveInfo
>
awemePage
=
dwdDouyinLiveInfoMapper
.
getPage
(
page
,
principalId
,
publishTimeGte
,
publishTimeLt
);
return
BasePageVO
.
restPage
(
pageNum
,
(
int
)
awemePage
.
getSize
(),
(
int
)
awemePage
.
getTotal
(),
(
int
)
awemePage
.
getPages
(),
awemePage
.
getRecords
());
}
public
BasePageVO
<
DwsFhlMkmsAuthorActionDay
>
douyinFhlMkmsAuthorInfo
(
String
statisticsGte
,
String
statisticsLt
,
Integer
pageNum
,
Integer
pageSize
)
{
PageHelper
.
orderBy
(
" ctime DESC "
);
IPage
<
DwsFhlMkmsAuthorActionDay
>
page
=
new
Page
<>(
pageNum
,
pageSize
);
IPage
<
DwsFhlMkmsAuthorActionDay
>
awemePage
=
dwsFhlMkmsAuthorActionDayMapper
.
getPage
(
page
,
principalId
,
statisticsGte
,
statisticsLt
);
return
BasePageVO
.
restPage
(
pageNum
,
(
int
)
awemePage
.
getSize
(),
(
int
)
awemePage
.
getTotal
(),
(
int
)
awemePage
.
getPages
(),
awemePage
.
getRecords
());
}
}
src/main/java/com/afanticar/afantiopenapi/utils/DateUtils.java
0 → 100644
View file @
acbd1d9e
package
com
.
afanticar
.
afantiopenapi
.
utils
;
import
org.apache.commons.lang3.time.DateFormatUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Date
;
/**
* 日期处理类
*SimpleDateFormat 不是线程安全的,多线程时可能会抛出
* java.lang.NumberFormatException: multiple points
*/
public
class
DateUtils
extends
org
.
apache
.
commons
.
lang3
.
time
.
DateUtils
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
DateUtils
.
class
);
private
static
String
today
;
/** default date format */
public
final
static
SimpleDateFormat
SDF_YYYY_MM_DD_HH_MM_SS
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
public
final
static
SimpleDateFormat
SDF_YYYY_MM_DD_HH_MM
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
public
final
static
SimpleDateFormat
SDF_YYYY_MM_DD
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
public
final
static
SimpleDateFormat
SDF_YYYY_MM
=
new
SimpleDateFormat
(
"yyyy-MM"
);
public
final
static
SimpleDateFormat
SDF_MM_DD
=
new
SimpleDateFormat
(
"MM-dd"
);
public
final
static
SimpleDateFormat
SDF_YYYY_MM_DD_CN
=
new
SimpleDateFormat
(
"yyyy年MM月dd日"
);
public
final
static
SimpleDateFormat
SDF_YYYY_MM_DD_HH_MM_SS_CN
=
new
SimpleDateFormat
(
"yyyy年MM月dd日 HH:mm:ss"
);
public
final
static
SimpleDateFormat
SDF_YYYY_MM_CN
=
new
SimpleDateFormat
(
"yyyy年MM月"
);
public
final
static
SimpleDateFormat
SDF_MM_DD_CN
=
new
SimpleDateFormat
(
"MM月dd日"
);
public
final
static
SimpleDateFormat
SDF_HH_MM_SS
=
new
SimpleDateFormat
(
"HH:mm:ss"
);
public
final
static
SimpleDateFormat
SDF_YYYYMMDDHHMMSS
=
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
);
public
static
String
format
(
Date
date
)
{
return
DateFormatUtils
.
format
(
date
,
"yyyy-MM-dd HH:mm:ss"
);
/*String dateStr = null;
synchronized(SDF_YYYY_MM_DD_HH_MM_SS) {
dateStr = SDF_YYYY_MM_DD_HH_MM_SS.format(date);
}
return dateStr;*/
}
public
static
String
format
(
Date
date
,
SimpleDateFormat
sdf
)
{
String
dateStr
=
null
;
synchronized
(
sdf
)
{
dateStr
=
sdf
.
format
(
date
);
}
return
dateStr
;
}
public
static
String
format
(
Long
date
)
{
return
DateFormatUtils
.
format
(
date
,
"yyyy-MM-dd HH:mm:ss"
);
}
public
static
Date
parse
(
String
dateStr
)
{
Date
date
=
null
;
synchronized
(
SDF_YYYY_MM_DD_HH_MM_SS
)
{
try
{
date
=
SDF_YYYY_MM_DD_HH_MM_SS
.
parse
(
dateStr
);
}
catch
(
ParseException
e
)
{
LOGGER
.
warn
(
"Date parse error. dateStr = {}"
,
dateStr
);
}
}
return
date
;
}
public
static
Date
parseDate
(
String
dateStr
){
try
{
return
org
.
apache
.
commons
.
lang3
.
time
.
DateUtils
.
parseDate
(
dateStr
,
"yyyy-MM-dd HH:mm:ss"
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
public
static
Date
parseDate
(
String
dateStr
,
String
...
parsePatterns
){
try
{
return
org
.
apache
.
commons
.
lang3
.
time
.
DateUtils
.
parseDate
(
dateStr
,
parsePatterns
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
public
static
Date
parse
(
String
dateStr
,
SimpleDateFormat
sdf
)
{
Date
date
=
null
;
synchronized
(
sdf
)
{
try
{
date
=
sdf
.
parse
(
dateStr
);
}
catch
(
ParseException
e
)
{
LOGGER
.
warn
(
"Date parse error. dateStr = {}"
,
dateStr
);
}
}
return
date
;
}
public
static
Date
getLastDay
()
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
new
Date
());
calendar
.
add
(
Calendar
.
DATE
,
-
1
);
return
calendar
.
getTime
();
}
/**
* 今天日期 yyyy-MM-dd
* @return
*/
public
static
String
getToday
()
{
// if (today == null) {
// today = format(new Date(), SDF_YYYY_MM_DD);
// }
return
format
(
new
Date
(),
SDF_YYYY_MM_DD
);
}
public
static
void
setToday
(
String
today
)
{
DateUtils
.
today
=
today
;
}
public
static
String
getCurrentTime
()
{
return
format
(
new
Date
());
}
/**
* 获取偏移天数后的日期,零时正点
* @param offset
* @return
*/
public
static
Date
getDay
(
int
offset
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
new
Date
());
calendar
.
add
(
Calendar
.
DATE
,
offset
);
return
parse
(
format
(
calendar
.
getTime
(),
SDF_YYYY_MM_DD
),
SDF_YYYY_MM_DD
);
}
public
static
Date
getDay
(
int
offsetType
,
int
offset
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
add
(
offsetType
,
offset
);
return
calendar
.
getTime
();
}
public
static
Date
getDay
(
Date
date
,
int
offsetType
,
int
offset
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
date
);
calendar
.
add
(
offsetType
,
offset
);
return
calendar
.
getTime
();
}
public
static
String
getDayStr
(
int
offset
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
new
Date
());
calendar
.
add
(
Calendar
.
DATE
,
offset
);
return
format
(
calendar
.
getTime
(),
SDF_YYYY_MM_DD
);
}
public
static
String
getDayStr
(
int
offsetType
,
int
offset
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
add
(
offsetType
,
offset
);
return
DateFormatUtils
.
format
(
calendar
.
getTime
(),
"yyyy-MM-dd"
);
}
public
static
String
getDayStr
(
Date
date
,
int
offsetType
,
int
offset
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
date
);
calendar
.
add
(
offsetType
,
offset
);
return
DateFormatUtils
.
format
(
calendar
.
getTime
(),
"yyyy-MM-dd"
);
}
public
static
Date
getDayTime
(
int
offset
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
new
Date
());
calendar
.
add
(
Calendar
.
DATE
,
offset
);
return
parse
(
format
(
calendar
.
getTime
(),
SDF_YYYY_MM_DD_HH_MM_SS
),
SDF_YYYY_MM_DD_HH_MM_SS
);
}
public
static
String
getDayTimeStr
(
int
offset
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
new
Date
());
calendar
.
add
(
Calendar
.
DATE
,
offset
);
return
format
(
calendar
.
getTime
(),
SDF_YYYY_MM_DD_HH_MM_SS
);
}
public
static
int
compare
(
Date
currentDate
,
Date
compareDate
,
int
calendarType
)
{
Calendar
current
=
DateUtils
.
toCalendar
(
currentDate
);
Calendar
compare
=
DateUtils
.
toCalendar
(
compareDate
);
long
gap
=
current
.
getTimeInMillis
()
-
compare
.
getTimeInMillis
();
long
dividend
=
1000
;
switch
(
calendarType
){
case
Calendar
.
YEAR
:
{
return
current
.
get
(
calendarType
)
-
compare
.
get
(
calendarType
);
}
case
Calendar
.
MONTH
:
{
int
year
=
current
.
get
(
Calendar
.
YEAR
)
-
compare
.
get
(
Calendar
.
YEAR
);
return
year
*
12
+
current
.
get
(
calendarType
)
-
compare
.
get
(
calendarType
);
}
case
Calendar
.
DAY_OF_YEAR
:
{
dividend
*=
60
*
60
*
24
;
break
;
}
case
Calendar
.
HOUR
:
{
dividend
*=
60
*
60
;
break
;
}
case
Calendar
.
MINUTE
:
{
dividend
*=
60
;
break
;
}
case
Calendar
.
SECOND
:
{
break
;
}
default
:{
throw
new
RuntimeException
(
"尚未维护该类型对比值"
);
}
}
//向上取整
return
(
int
)(
gap
/
dividend
);
}
/**
* 时间差
* @param endDate
* @param nowDate
* @return
*/
public
static
String
getTimeDifferenceDHMS
(
Date
endDate
,
Date
nowDate
)
{
long
nd
=
1000
*
24
*
60
*
60
;
long
nh
=
1000
*
60
*
60
;
long
nm
=
1000
*
60
;
long
diff
=
endDate
.
getTime
()
-
nowDate
.
getTime
();
long
day
=
diff
/
nd
;
long
hour
=
diff
%
nd
/
nh
;
long
min
=
diff
%
nd
%
nh
/
nm
;
long
seconds
=
diff
%
nd
%
nh
%
nm
/
1000
;
return
day
+
"天"
+
hour
+
"小时"
+
min
+
"分钟"
+
seconds
+
"秒"
;
}
public
static
String
getTimeDifferenceHMS
(
Date
endDate
,
Date
nowDate
)
{
long
nd
=
1000
*
24
*
60
*
60
;
long
nh
=
1000
*
60
*
60
;
long
nm
=
1000
*
60
;
long
diff
=
endDate
.
getTime
()
-
nowDate
.
getTime
();
long
hour
=
diff
%
nd
/
nh
;
long
min
=
diff
%
nd
%
nh
/
nm
;
long
seconds
=
diff
%
nd
%
nh
%
nm
/
1000
;
return
hour
+
"小时"
+
min
+
"分钟"
+
seconds
+
"秒"
;
}
/**
* 上月的第一天
* @return
*/
public
static
String
getBeforeMonthFirstDay
(){
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Calendar
c
=
Calendar
.
getInstance
();
c
.
add
(
Calendar
.
MONTH
,
-
1
);
c
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
return
format
.
format
(
c
.
getTime
())
+
" "
+
"00:00:00"
;
}
/**
* 上月最后一天
* @return
*/
public
static
String
getBeforeMonthLastDay
(){
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Calendar
c
=
Calendar
.
getInstance
();
c
.
set
(
Calendar
.
DAY_OF_MONTH
,
0
);
//设置为1号,当前日期既为本月第一天
return
format
.
format
(
c
.
getTime
())
+
" "
+
"00:00:00"
;
}
/**
* 当前月第一天
* @return
*/
public
static
String
getCurrentMonthFirstDay
(){
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Calendar
c
=
Calendar
.
getInstance
();
c
.
add
(
Calendar
.
MONTH
,
0
);
c
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
return
format
.
format
(
c
.
getTime
())
+
" "
+
"00:00:00"
;
}
public
static
String
getFirstDayOfTheMonth
(
Date
date
){
return
getFirstDayOfMonth
(
date
,
0
);
}
public
static
String
getFirstDayOfMonth
(
Date
date
,
int
month
){
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Calendar
c
=
Calendar
.
getInstance
();
c
.
setTime
(
date
);
c
.
add
(
Calendar
.
MONTH
,
month
);
c
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
return
format
.
format
(
c
.
getTime
())
+
" "
+
"00:00:00"
;
}
/**
* 当前月第一天
* @return
*/
public
static
String
getCurrentMonthLastDay
(){
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Calendar
c
=
Calendar
.
getInstance
();
c
.
set
(
Calendar
.
DAY_OF_MONTH
,
c
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
));
return
format
.
format
(
c
.
getTime
())
+
" "
+
"00:00:00"
;
}
/**
* 获取传入时间的零点
*/
public
static
Date
getZeroDate
(
Date
date
)
{
Calendar
c
=
Calendar
.
getInstance
();
c
.
setTime
(
date
);
c
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
c
.
set
(
Calendar
.
MINUTE
,
0
);
c
.
set
(
Calendar
.
SECOND
,
0
);
c
.
set
(
Calendar
.
MILLISECOND
,
0
);
return
c
.
getTime
();
}
public
static
Date
geLastWeekMonday
()
{
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
getThisWeekMonday
());
cal
.
add
(
Calendar
.
DATE
,
-
7
);
return
cal
.
getTime
();
}
public
static
Date
getThisWeekMonday
()
{
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
DateUtils
.
getDay
(
0
));
// 获得当前日期是一个星期的第几天
int
dayWeek
=
cal
.
get
(
Calendar
.
DAY_OF_WEEK
);
if
(
1
==
dayWeek
)
{
cal
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
1
);
}
// 设置一个星期的第一天,按中国的习惯一个星期的第一天是星期一
cal
.
setFirstDayOfWeek
(
Calendar
.
MONDAY
);
// 获得当前日期是一个星期的第几天
int
day
=
cal
.
get
(
Calendar
.
DAY_OF_WEEK
);
// 根据日历的规则,给当前日期减去星期几与一个星期第一天的差值
cal
.
add
(
Calendar
.
DATE
,
cal
.
getFirstDayOfWeek
()
-
day
);
return
cal
.
getTime
();
}
public
static
Date
getLastMonthFirstDay
(){
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
DateUtils
.
getDay
(
0
));
cal
.
add
(
Calendar
.
MONTH
,
-
1
);
cal
.
set
(
Calendar
.
DAY_OF_MONTH
,
cal
.
getActualMinimum
(
Calendar
.
DAY_OF_MONTH
));
return
cal
.
getTime
();
}
public
static
Date
getThisMonthFirstDay
(){
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
DateUtils
.
getDay
(
0
));
cal
.
set
(
Calendar
.
DAY_OF_MONTH
,
cal
.
getActualMinimum
(
Calendar
.
DAY_OF_MONTH
));
return
cal
.
getTime
();
}
}
src/main/resources/bootstrap.yml
View file @
acbd1d9e
...
...
@@ -14,6 +14,7 @@ spring:
ext-config
:
-
data-id
:
dynamic-db-afanti-vault.yml
-
data-id
:
dynamic-db-afanti-tmp-vault.yml
-
data-id
:
dynamic-db-afanti-bi-app-vault.yml
-
data-id
:
common-redis.yml
-
data-id
:
afanti-open-api.yml
vault
:
...
...
@@ -25,17 +26,9 @@ spring:
config
:
lifecycle
:
enabled
:
true
# 阿里云accesskey
aws
:
enabled
:
true
role
:
MqFullAccess
backend
:
alicloud
access-key-property
:
spring.rocket-mq.accessKey
secret-key-property
:
spring.rocket-mq.secretKey
# adb链接
kv
:
enabled
:
fals
e
enabled
:
tru
e
backend
:
${spring.profiles.active}
default-context
:
etladb
databases
:
...
...
@@ -87,6 +80,7 @@ mybatis-plus:
-
classpath*:mapper/*.xml
# configuration:
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
logging
:
level
:
com.afanticar.datacenter.http.mapper.*
:
debug
\ No newline at end of file
com.afanticar.afantiopenapi.mapper.*
:
debug
\ No newline at end of file
src/main/resources/mapper/DwdDouyinAwemeInfoMapper.xml
0 → 100644
View file @
acbd1d9e
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.afanticar.afantiopenapi.mapper.adb.DwdDouyinAwemeInfoMapper"
>
<select
id=
"getPage"
resultType=
"com.afanticar.afantiopenapi.model.entity.adb.DwdDouyinAwemeInfo"
>
SELECT
aweme_id,
author_id,
aweme_title,
aweme_status,
aweme_url,
aweme_topic,
play_volume,
comment_count,
share_count,
digg_count,
duration,
publish_time,
mtime,
data_update_time
FROM
dwd_douyin_aweme_info
WHERE
publish_time
>
= #{publishTimeGte}
AND publish_time
<
#{publishTimeLt}
AND author_id IN ( SELECT author_id FROM dwd_douyin_author_info WHERE principal_ids = #{principalId} AND author_status = 0 )
</select>
</mapper>
src/main/resources/mapper/DwdDouyinLiveInfoMapper.xml
0 → 100644
View file @
acbd1d9e
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.afanticar.afantiopenapi.mapper.adb.DwdDouyinLiveInfoMapper"
>
<select
id=
"getPage"
resultType=
"com.afanticar.afantiopenapi.model.entity.adb.DwdDouyinLiveInfo"
>
SELECT
room_id,
author_id,
title,
cover,
publish_time,
finish_time,
statistics_total_watch_user_count,
statistics_total_watch_user_time,
statistics_max_online_user,
statistics_total_like_count,
statistics_total_comment_count,
statistics_live_time,
statistics_fans_add
FROM
dwd_douyin_live_info
WHERE
publish_time
>
= #{publishTimeGte}
AND publish_time
<
#{publishTimeLt}
AND author_id IN ( SELECT author_id FROM dwd_douyin_author_info WHERE principal_ids = #{principalId} AND author_status = 0 )
</select>
</mapper>
src/main/resources/mapper/DwsFhlMkmsAuthorActionDayMapper.xml
0 → 100644
View file @
acbd1d9e
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.afanticar.afantiopenapi.mapper.adb.DwsFhlMkmsAuthorActionDayMapper"
>
<select
id=
"getPage"
resultType=
"com.afanticar.afantiopenapi.model.entity.adb.DwsFhlMkmsAuthorActionDay"
>
SELECT
session_entered_count,
user_speak_count,
cast( user_speak_count / session_entered_count AS DECIMAL(100, 5) ) user_speak_rate,
pp_leads_count,
message_leads_count,
reply_within_3min_rate
FROM
dws_fhl_mkms_author_action_day
WHERE
statistics_day
>
= #{statisticsGte}
AND statistics_day
<
#{statisticsLt}
AND platform = 1
AND author_id IN ( SELECT author_id FROM dwd_douyin_author_info WHERE principal_ids = #{principalId} AND author_status = 0 )
</select>
</mapper>
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