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
b983f57e
Commit
b983f57e
authored
Sep 24, 2024
by
许润龙
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-activity-faw' into 'uat'
Dev activity faw See merge request
!52
parents
8386005f
741e015b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
135 additions
and
15 deletions
+135
-15
Constant.java
...n/java/com/afanticar/afantiopenapi/constant/Constant.java
+32
-0
DwdKuaishouAuthorInfoMapper.java
...car/afantiopenapi/mapper/DwdKuaishouAuthorInfoMapper.java
+12
-8
ActivityVO.java
...java/com/afanticar/afantiopenapi/model/vo/ActivityVO.java
+21
-0
HongqiActivityAwemeVO.java
...anticar/afantiopenapi/model/vo/HongqiActivityAwemeVO.java
+3
-3
HongqiActivityBaseVO.java
...fanticar/afantiopenapi/model/vo/HongqiActivityBaseVO.java
+17
-0
HongqiActivityLiveVO.java
...fanticar/afantiopenapi/model/vo/HongqiActivityLiveVO.java
+3
-4
FawOpenService.java
...a/com/afanticar/afantiopenapi/service/FawOpenService.java
+5
-0
BaseUtils.java
...ain/java/com/afanticar/afantiopenapi/utils/BaseUtils.java
+42
-0
No files found.
src/main/java/com/afanticar/afantiopenapi/constant/Constant.java
View file @
b983f57e
package
com
.
afanticar
.
afantiopenapi
.
constant
;
package
com
.
afanticar
.
afantiopenapi
.
constant
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
/**
* @author chin
* @author chin
* @contact chenyan@afanticar.com
* @contact chenyan@afanticar.com
...
@@ -9,4 +12,33 @@ public class Constant {
...
@@ -9,4 +12,33 @@ public class Constant {
public
static
final
String
SUCCESS_CODE
=
"200"
;
public
static
final
String
SUCCESS_CODE
=
"200"
;
// key=车系name,value=车系code
public
static
Map
<
String
,
String
>
seriesMap
=
new
HashMap
();
static
{
seriesMap
.
put
(
"E-001"
,
"E-001"
);
seriesMap
.
put
(
"EH7"
,
"EH7"
);
seriesMap
.
put
(
"E-HS3"
,
"E-HS3"
);
seriesMap
.
put
(
"EHS7"
,
"EHS7"
);
seriesMap
.
put
(
"E-HS9"
,
"E-HS9"
);
seriesMap
.
put
(
"E-QM5"
,
"E-QM5"
);
seriesMap
.
put
(
"H5"
,
"H5"
);
seriesMap
.
put
(
"H5-2"
,
"H5-2"
);
seriesMap
.
put
(
"H6"
,
"H6"
);
seriesMap
.
put
(
"H7"
,
"H7"
);
seriesMap
.
put
(
"H9"
,
"H9"
);
seriesMap
.
put
(
"H9+"
,
"H9+"
);
seriesMap
.
put
(
"HQ9"
,
"HQ9"
);
seriesMap
.
put
(
"HS3"
,
"HS3"
);
seriesMap
.
put
(
"HS5"
,
"HS5"
);
seriesMap
.
put
(
"HS7"
,
"HS7"
);
seriesMap
.
put
(
"HS7-2"
,
"HS7-2"
);
seriesMap
.
put
(
"L1"
,
"L1"
);
seriesMap
.
put
(
"L5"
,
"L5"
);
seriesMap
.
put
(
"红旗国礼"
,
"红旗国礼"
);
seriesMap
.
put
(
"红旗国雅"
,
"红旗国雅"
);
seriesMap
.
put
(
"红旗国耀"
,
"红旗国耀"
);
seriesMap
.
put
(
"红旗国悦"
,
"红旗国悦"
);
seriesMap
.
put
(
"盛世"
,
"盛世"
);
}
}
}
src/main/java/com/afanticar/afantiopenapi/mapper/DwdKuaishouAuthorInfoMapper.java
View file @
b983f57e
...
@@ -25,6 +25,7 @@ public interface DwdKuaishouAuthorInfoMapper extends BaseMapper<DwdDouyinAuthorI
...
@@ -25,6 +25,7 @@ public interface DwdKuaishouAuthorInfoMapper extends BaseMapper<DwdDouyinAuthorI
@Select
(
"<script>select "
+
@Select
(
"<script>select "
+
" t1.aweme_id, "
+
" t1.aweme_id, "
+
" t1.author_id , "
+
" t1.aweme_title , "
+
" t1.aweme_title , "
+
" 'douyin' as platform, "
+
" 'douyin' as platform, "
+
" t3.dealer_area_names area_name, "
+
" t3.dealer_area_names area_name, "
+
...
@@ -39,12 +40,12 @@ public interface DwdKuaishouAuthorInfoMapper extends BaseMapper<DwdDouyinAuthorI
...
@@ -39,12 +40,12 @@ public interface DwdKuaishouAuthorInfoMapper extends BaseMapper<DwdDouyinAuthorI
" t1.share_count , "
+
" t1.share_count , "
+
" t1.share_url , "
+
" t1.share_url , "
+
" t1.data_update_time , "
+
" t1.data_update_time , "
+
" t2.activity_i
d_list
"
+
" t2.activity_i
nfo
"
+
"from ( "
+
"from ( "
+
" select * from dwd_douyin_aweme_info "
+
" select * from dwd_douyin_aweme_info "
+
" where publish_time >= #{dto.start} and publish_time <= #{dto.end} "
+
" where publish_time >= #{dto.start} and publish_time <= #{dto.end} "
+
") t1 left join ( "
+
") t1 left join ( "
+
" select aweme_id,collect_set(
activity_id) as activity_id_list
"
+
" select aweme_id,collect_set(
json_object('activity_id',activity_id,'match_keywords',match_keywords)) as activity_info
"
+
" from dwd_fhl_activity_douyin_aweme_info "
+
" from dwd_fhl_activity_douyin_aweme_info "
+
" where "
+
" where "
+
" publish_time >= #{dto.start} "
+
" publish_time >= #{dto.start} "
+
...
@@ -70,6 +71,7 @@ public interface DwdKuaishouAuthorInfoMapper extends BaseMapper<DwdDouyinAuthorI
...
@@ -70,6 +71,7 @@ public interface DwdKuaishouAuthorInfoMapper extends BaseMapper<DwdDouyinAuthorI
@Select
(
"<script>select "
+
@Select
(
"<script>select "
+
" t1.aweme_id, "
+
" t1.aweme_id, "
+
" t1.author_id, "
+
" t1.aweme_title , "
+
" t1.aweme_title , "
+
" 'kuaishou' as platform, "
+
" 'kuaishou' as platform, "
+
" t3.dealer_area_names area_name, "
+
" t3.dealer_area_names area_name, "
+
...
@@ -84,12 +86,12 @@ public interface DwdKuaishouAuthorInfoMapper extends BaseMapper<DwdDouyinAuthorI
...
@@ -84,12 +86,12 @@ public interface DwdKuaishouAuthorInfoMapper extends BaseMapper<DwdDouyinAuthorI
" t1.share_count , "
+
" t1.share_count , "
+
" t1.share_url , "
+
" t1.share_url , "
+
" t1.data_update_time , "
+
" t1.data_update_time , "
+
" t2.activity_i
d_list
"
+
" t2.activity_i
nfo
"
+
"from ( "
+
"from ( "
+
" select * from dwd_kuaishou_aweme_info "
+
" select * from dwd_kuaishou_aweme_info "
+
" where publish_time >= #{dto.start} and publish_time <= #{dto.end} "
+
" where publish_time >= #{dto.start} and publish_time <= #{dto.end} "
+
") t1 left join ( "
+
") t1 left join ( "
+
" select aweme_id,collect_set(
activity_id) as activity_id_list
"
+
" select aweme_id,collect_set(
json_object('activity_id',activity_id,'match_keywords',match_keywords)) as activity_info
"
+
" from dwd_fhl_activity_kuaishou_aweme_info "
+
" from dwd_fhl_activity_kuaishou_aweme_info "
+
" where "
+
" where "
+
" publish_time >= #{dto.start} "
+
" publish_time >= #{dto.start} "
+
...
@@ -115,6 +117,7 @@ public interface DwdKuaishouAuthorInfoMapper extends BaseMapper<DwdDouyinAuthorI
...
@@ -115,6 +117,7 @@ public interface DwdKuaishouAuthorInfoMapper extends BaseMapper<DwdDouyinAuthorI
@Select
(
"<script>select "
+
@Select
(
"<script>select "
+
" t1.room_id, "
+
" t1.room_id, "
+
" t3.author_id , "
+
" t1.title, "
+
" t1.title, "
+
" 'douyin' as platform, "
+
" 'douyin' as platform, "
+
" t3.dealer_area_names area_name, "
+
" t3.dealer_area_names area_name, "
+
...
@@ -130,12 +133,12 @@ public interface DwdKuaishouAuthorInfoMapper extends BaseMapper<DwdDouyinAuthorI
...
@@ -130,12 +133,12 @@ public interface DwdKuaishouAuthorInfoMapper extends BaseMapper<DwdDouyinAuthorI
" t1.statistics_total_gift_count gift_cnt, "
+
" t1.statistics_total_gift_count gift_cnt, "
+
" t1.statistics_fans_add , "
+
" t1.statistics_fans_add , "
+
" t1.data_update_time , "
+
" t1.data_update_time , "
+
" t2.activity_i
d_list
"
+
" t2.activity_i
nfo
"
+
"from ( "
+
"from ( "
+
" select * from dwd_douyin_live_info "
+
" select * from dwd_douyin_live_info "
+
" where publish_time >= #{dto.start} and publish_time <= #{dto.end} "
+
" where publish_time >= #{dto.start} and publish_time <= #{dto.end} "
+
") t1 left join ( "
+
") t1 left join ( "
+
" select room_id,collect_set(
activity_id) as activity_id_list
"
+
" select room_id,collect_set(
json_object('activity_id',activity_id,'match_keywords',match_keywords)) as activity_info
"
+
" from dwd_fhl_activity_douyin_live_info "
+
" from dwd_fhl_activity_douyin_live_info "
+
" where publish_time >= #{dto.start} and publish_time <= #{dto.end} "
+
" where publish_time >= #{dto.start} and publish_time <= #{dto.end} "
+
" and "
+
" and "
+
...
@@ -165,6 +168,7 @@ public interface DwdKuaishouAuthorInfoMapper extends BaseMapper<DwdDouyinAuthorI
...
@@ -165,6 +168,7 @@ public interface DwdKuaishouAuthorInfoMapper extends BaseMapper<DwdDouyinAuthorI
" t3.dealer_store_code dealer_code, "
+
" t3.dealer_store_code dealer_code, "
+
" t3.dealer_name , "
+
" t3.dealer_name , "
+
" t3.nickname , "
+
" t3.nickname , "
+
" t3.author_id , "
+
" t1.publish_time , "
+
" t1.publish_time , "
+
" t1.statistics_total_watch_user_count , "
+
" t1.statistics_total_watch_user_count , "
+
" round(t1.statistics_live_time/60, 2) statistics_live_time, "
+
" round(t1.statistics_live_time/60, 2) statistics_live_time, "
+
...
@@ -174,12 +178,12 @@ public interface DwdKuaishouAuthorInfoMapper extends BaseMapper<DwdDouyinAuthorI
...
@@ -174,12 +178,12 @@ public interface DwdKuaishouAuthorInfoMapper extends BaseMapper<DwdDouyinAuthorI
" t1.statistics_total_gift_count gift_cnt, "
+
" t1.statistics_total_gift_count gift_cnt, "
+
" t1.statistics_fans_add , "
+
" t1.statistics_fans_add , "
+
" t1.data_update_time , "
+
" t1.data_update_time , "
+
" t2.activity_i
d_list
"
+
" t2.activity_i
nfo
"
+
"from ( "
+
"from ( "
+
" select * from dwd_kuaishou_live_info "
+
" select * from dwd_kuaishou_live_info "
+
" where publish_time >= #{dto.start} and publish_time <= #{dto.end} "
+
" where publish_time >= #{dto.start} and publish_time <= #{dto.end} "
+
") t1 left join ( "
+
") t1 left join ( "
+
" select room_id,collect_set(
activity_id) as activity_id_list
"
+
" select room_id,collect_set(
json_object('activity_id',activity_id,'match_keywords',match_keywords)) as activity_info
"
+
" from dwd_fhl_activity_kuaishou_live_info "
+
" from dwd_fhl_activity_kuaishou_live_info "
+
" where publish_time >= #{dto.start} and publish_time <= #{dto.end} "
+
" where publish_time >= #{dto.start} and publish_time <= #{dto.end} "
+
" and "
+
" and "
+
...
...
src/main/java/com/afanticar/afantiopenapi/model/vo/ActivityVO.java
0 → 100644
View file @
b983f57e
package
com
.
afanticar
.
afantiopenapi
.
model
.
vo
;
import
com.alibaba.fastjson.annotation.JSONType
;
import
com.fasterxml.jackson.databind.annotation.JsonNaming
;
import
lombok.Data
;
/**
* @author chin
* @contact chenyan@afanticar.com
* @since 2024/9/23/023
*/
@Data
@JsonNaming
(
value
=
com
.
fasterxml
.
jackson
.
databind
.
PropertyNamingStrategy
.
SnakeCaseStrategy
.
class
)
@JSONType
(
naming
=
com
.
alibaba
.
fastjson
.
PropertyNamingStrategy
.
SnakeCase
)
public
class
ActivityVO
{
private
String
activityId
;
private
String
matchKeywords
;
private
String
seriesCode
;
}
src/main/java/com/afanticar/afantiopenapi/model/vo/HongqiActivityAwemeVO.java
View file @
b983f57e
package
com
.
afanticar
.
afantiopenapi
.
model
.
vo
;
package
com
.
afanticar
.
afantiopenapi
.
model
.
vo
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.annotation.JSONType
;
import
com.alibaba.fastjson.annotation.JSONType
;
import
com.fasterxml.jackson.databind.annotation.JsonNaming
;
import
com.fasterxml.jackson.databind.annotation.JsonNaming
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -15,9 +16,10 @@ import java.util.List;
...
@@ -15,9 +16,10 @@ import java.util.List;
@Data
@Data
@JsonNaming
(
value
=
com
.
fasterxml
.
jackson
.
databind
.
PropertyNamingStrategy
.
SnakeCaseStrategy
.
class
)
@JsonNaming
(
value
=
com
.
fasterxml
.
jackson
.
databind
.
PropertyNamingStrategy
.
SnakeCaseStrategy
.
class
)
@JSONType
(
naming
=
com
.
alibaba
.
fastjson
.
PropertyNamingStrategy
.
SnakeCase
)
@JSONType
(
naming
=
com
.
alibaba
.
fastjson
.
PropertyNamingStrategy
.
SnakeCase
)
public
class
HongqiActivityAwemeVO
{
public
class
HongqiActivityAwemeVO
extends
HongqiActivityBaseVO
{
private
String
awemeId
;
private
String
awemeId
;
private
String
authorId
;
private
String
awemeTitle
;
private
String
awemeTitle
;
private
String
platform
;
private
String
platform
;
private
String
areaName
;
private
String
areaName
;
...
@@ -32,7 +34,5 @@ public class HongqiActivityAwemeVO {
...
@@ -32,7 +34,5 @@ public class HongqiActivityAwemeVO {
private
Integer
shareCount
;
private
Integer
shareCount
;
private
String
shareUrl
;
private
String
shareUrl
;
private
Date
dataUpdateTime
;
private
Date
dataUpdateTime
;
private
List
<
String
>
activityIdList
;
private
List
<
String
>
keywordList
;
}
}
src/main/java/com/afanticar/afantiopenapi/model/vo/HongqiActivityBaseVO.java
0 → 100644
View file @
b983f57e
package
com
.
afanticar
.
afantiopenapi
.
model
.
vo
;
import
com.alibaba.fastjson.annotation.JSONType
;
import
com.fasterxml.jackson.databind.annotation.JsonNaming
;
import
lombok.Data
;
import
java.util.List
;
@Data
@JsonNaming
(
value
=
com
.
fasterxml
.
jackson
.
databind
.
PropertyNamingStrategy
.
SnakeCaseStrategy
.
class
)
@JSONType
(
naming
=
com
.
alibaba
.
fastjson
.
PropertyNamingStrategy
.
SnakeCase
)
public
class
HongqiActivityBaseVO
{
private
List
<
ActivityVO
>
activityList
;
private
String
activityInfo
;
}
src/main/java/com/afanticar/afantiopenapi/model/vo/HongqiActivityLiveVO.java
View file @
b983f57e
...
@@ -15,9 +15,10 @@ import java.util.List;
...
@@ -15,9 +15,10 @@ import java.util.List;
@Data
@Data
@JsonNaming
(
value
=
com
.
fasterxml
.
jackson
.
databind
.
PropertyNamingStrategy
.
SnakeCaseStrategy
.
class
)
@JsonNaming
(
value
=
com
.
fasterxml
.
jackson
.
databind
.
PropertyNamingStrategy
.
SnakeCaseStrategy
.
class
)
@JSONType
(
naming
=
com
.
alibaba
.
fastjson
.
PropertyNamingStrategy
.
SnakeCase
)
@JSONType
(
naming
=
com
.
alibaba
.
fastjson
.
PropertyNamingStrategy
.
SnakeCase
)
public
class
HongqiActivityLiveVO
{
public
class
HongqiActivityLiveVO
extends
HongqiActivityBaseVO
{
private
String
roomId
;
private
String
roomId
;
private
String
authorId
;
private
String
title
;
private
String
title
;
private
String
platform
;
private
String
platform
;
private
String
areaName
;
private
String
areaName
;
...
@@ -32,7 +33,5 @@ public class HongqiActivityLiveVO {
...
@@ -32,7 +33,5 @@ public class HongqiActivityLiveVO {
private
Integer
commentCnt
;
private
Integer
commentCnt
;
private
Integer
giftCnt
;
private
Integer
giftCnt
;
private
Integer
statisticsFansAdd
;
private
Integer
statisticsFansAdd
;
private
List
<
String
>
activityIdList
;
private
List
<
String
>
keywordList
;
}
}
src/main/java/com/afanticar/afantiopenapi/service/FawOpenService.java
View file @
b983f57e
...
@@ -9,6 +9,7 @@ import com.afanticar.afantiopenapi.model.entity.HongqiAwemeIncentiveQuarter;
...
@@ -9,6 +9,7 @@ import com.afanticar.afantiopenapi.model.entity.HongqiAwemeIncentiveQuarter;
import
com.afanticar.afantiopenapi.model.entity.HongqiLiveIncentiveMonthly
;
import
com.afanticar.afantiopenapi.model.entity.HongqiLiveIncentiveMonthly
;
import
com.afanticar.afantiopenapi.model.entity.HongqiLiveIncentiveQuarter
;
import
com.afanticar.afantiopenapi.model.entity.HongqiLiveIncentiveQuarter
;
import
com.afanticar.afantiopenapi.model.vo.*
;
import
com.afanticar.afantiopenapi.model.vo.*
;
import
com.afanticar.afantiopenapi.utils.BaseUtils
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
@@ -106,6 +107,7 @@ public class FawOpenService {
...
@@ -106,6 +107,7 @@ public class FawOpenService {
PageHelper
.
orderBy
(
" publish_time DESC "
);
PageHelper
.
orderBy
(
" publish_time DESC "
);
IPage
<
HongqiActivityAwemeVO
>
page
=
new
Page
<>(
dto
.
getPageNum
(),
dto
.
getPageSize
());
IPage
<
HongqiActivityAwemeVO
>
page
=
new
Page
<>(
dto
.
getPageNum
(),
dto
.
getPageSize
());
IPage
<
HongqiActivityAwemeVO
>
awemePage
=
dwdKuaishouAuthorInfoMapper
.
douyinActivityAwemes
(
page
,
dto
);
IPage
<
HongqiActivityAwemeVO
>
awemePage
=
dwdKuaishouAuthorInfoMapper
.
douyinActivityAwemes
(
page
,
dto
);
BaseUtils
.
parseSeries
(
awemePage
.
getRecords
());
return
BasePageVO
.
restPage
(
dto
.
getPageNum
(),
(
int
)
awemePage
.
getSize
(),
(
int
)
awemePage
.
getTotal
(),
(
int
)
awemePage
.
getPages
(),
awemePage
.
getRecords
());
return
BasePageVO
.
restPage
(
dto
.
getPageNum
(),
(
int
)
awemePage
.
getSize
(),
(
int
)
awemePage
.
getTotal
(),
(
int
)
awemePage
.
getPages
(),
awemePage
.
getRecords
());
}
}
...
@@ -113,6 +115,7 @@ public class FawOpenService {
...
@@ -113,6 +115,7 @@ public class FawOpenService {
PageHelper
.
orderBy
(
" publish_time DESC "
);
PageHelper
.
orderBy
(
" publish_time DESC "
);
IPage
<
HongqiActivityLiveVO
>
page
=
new
Page
<>(
dto
.
getPageNum
(),
dto
.
getPageSize
());
IPage
<
HongqiActivityLiveVO
>
page
=
new
Page
<>(
dto
.
getPageNum
(),
dto
.
getPageSize
());
IPage
<
HongqiActivityLiveVO
>
livePage
=
dwdKuaishouAuthorInfoMapper
.
douyinActivityLives
(
page
,
dto
);
IPage
<
HongqiActivityLiveVO
>
livePage
=
dwdKuaishouAuthorInfoMapper
.
douyinActivityLives
(
page
,
dto
);
BaseUtils
.
parseSeries
(
livePage
.
getRecords
());
return
BasePageVO
.
restPage
(
dto
.
getPageNum
(),
(
int
)
livePage
.
getSize
(),
(
int
)
livePage
.
getTotal
(),
(
int
)
livePage
.
getPages
(),
livePage
.
getRecords
());
return
BasePageVO
.
restPage
(
dto
.
getPageNum
(),
(
int
)
livePage
.
getSize
(),
(
int
)
livePage
.
getTotal
(),
(
int
)
livePage
.
getPages
(),
livePage
.
getRecords
());
}
}
...
@@ -121,6 +124,7 @@ public class FawOpenService {
...
@@ -121,6 +124,7 @@ public class FawOpenService {
PageHelper
.
orderBy
(
" publish_time DESC "
);
PageHelper
.
orderBy
(
" publish_time DESC "
);
IPage
<
HongqiActivityAwemeVO
>
page
=
new
Page
<>(
dto
.
getPageNum
(),
dto
.
getPageSize
());
IPage
<
HongqiActivityAwemeVO
>
page
=
new
Page
<>(
dto
.
getPageNum
(),
dto
.
getPageSize
());
IPage
<
HongqiActivityAwemeVO
>
awemePage
=
dwdKuaishouAuthorInfoMapper
.
kuaishouActivityAwemes
(
page
,
dto
);
IPage
<
HongqiActivityAwemeVO
>
awemePage
=
dwdKuaishouAuthorInfoMapper
.
kuaishouActivityAwemes
(
page
,
dto
);
BaseUtils
.
parseSeries
(
awemePage
.
getRecords
());
return
BasePageVO
.
restPage
(
dto
.
getPageNum
(),
(
int
)
awemePage
.
getSize
(),
(
int
)
awemePage
.
getTotal
(),
(
int
)
awemePage
.
getPages
(),
awemePage
.
getRecords
());
return
BasePageVO
.
restPage
(
dto
.
getPageNum
(),
(
int
)
awemePage
.
getSize
(),
(
int
)
awemePage
.
getTotal
(),
(
int
)
awemePage
.
getPages
(),
awemePage
.
getRecords
());
}
}
...
@@ -128,6 +132,7 @@ public class FawOpenService {
...
@@ -128,6 +132,7 @@ public class FawOpenService {
PageHelper
.
orderBy
(
" publish_time DESC "
);
PageHelper
.
orderBy
(
" publish_time DESC "
);
IPage
<
HongqiActivityLiveVO
>
page
=
new
Page
<>(
dto
.
getPageNum
(),
dto
.
getPageSize
());
IPage
<
HongqiActivityLiveVO
>
page
=
new
Page
<>(
dto
.
getPageNum
(),
dto
.
getPageSize
());
IPage
<
HongqiActivityLiveVO
>
livePage
=
dwdKuaishouAuthorInfoMapper
.
kuaishouActivityLives
(
page
,
dto
);
IPage
<
HongqiActivityLiveVO
>
livePage
=
dwdKuaishouAuthorInfoMapper
.
kuaishouActivityLives
(
page
,
dto
);
BaseUtils
.
parseSeries
(
livePage
.
getRecords
());
return
BasePageVO
.
restPage
(
dto
.
getPageNum
(),
(
int
)
livePage
.
getSize
(),
(
int
)
livePage
.
getTotal
(),
(
int
)
livePage
.
getPages
(),
livePage
.
getRecords
());
return
BasePageVO
.
restPage
(
dto
.
getPageNum
(),
(
int
)
livePage
.
getSize
(),
(
int
)
livePage
.
getTotal
(),
(
int
)
livePage
.
getPages
(),
livePage
.
getRecords
());
}
}
...
...
src/main/java/com/afanticar/afantiopenapi/utils/BaseUtils.java
0 → 100644
View file @
b983f57e
package
com
.
afanticar
.
afantiopenapi
.
utils
;
import
com.afanticar.afantiopenapi.constant.Constant
;
import
com.afanticar.afantiopenapi.model.vo.ActivityVO
;
import
com.afanticar.afantiopenapi.model.vo.HongqiActivityAwemeVO
;
import
com.afanticar.afantiopenapi.model.vo.HongqiActivityBaseVO
;
import
com.alibaba.fastjson.JSONObject
;
import
com.auth0.jwt.JWT
;
import
com.auth0.jwt.interfaces.DecodedJWT
;
import
org.apache.commons.lang3.StringUtils
;
import
java.util.ArrayList
;
import
java.util.Base64
;
import
java.util.List
;
public
class
BaseUtils
{
public
static
<
T
extends
HongqiActivityBaseVO
>
void
parseSeries
(
List
<
T
>
list
)
{
for
(
HongqiActivityBaseVO
awemeVO:
list
)
{
List
<
ActivityVO
>
activityVOList
=
new
ArrayList
<>();
List
<
String
>
objects
=
JSONObject
.
parseArray
(
awemeVO
.
getActivityInfo
(),
String
.
class
);
for
(
String
object
:
objects
)
{
ActivityVO
activityVO
=
JSONObject
.
parseObject
(
object
,
ActivityVO
.
class
);
if
(
StringUtils
.
isEmpty
(
activityVO
.
getMatchKeywords
()))
{
continue
;
}
StringBuffer
seriesCode
=
new
StringBuffer
();
String
[]
names
=
activityVO
.
getMatchKeywords
().
split
(
","
);
for
(
String
name
:
names
)
{
String
code
=
Constant
.
seriesMap
.
get
(
name
);
if
(
StringUtils
.
isEmpty
(
code
))
{
continue
;
}
seriesCode
.
append
(
code
).
append
(
","
);
}
activityVO
.
setSeriesCode
(
seriesCode
.
substring
(
0
,
seriesCode
.
length
()
-
1
));
activityVOList
.
add
(
activityVO
);
}
awemeVO
.
setActivityList
(
activityVOList
);
}
}
}
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