记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
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
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
303c3969
Commit
303c3969
authored
Jun 29, 2026
by
姜秀龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
艺人合并需求-迁移部分
parent
0146c258
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
216 additions
and
226 deletions
+216
-226
zhengzai-V1.5-20260304.sql
docu/zhengzai-V1.5-20260304.sql
+1
-0
ISweetArtistsService.java
...liquidnet/service/sweet/service/ISweetArtistsService.java
+1
-12
KylinArtistServiceImpl.java
...n/zhengzai/kylin/service/impl/KylinArtistServiceImpl.java
+8
-0
SweetArtistCacheUtils.java
...ent/admin/zhengzai/kylin/utils/SweetArtistCacheUtils.java
+86
-0
KylinArtist.java
.../java/com/liquidnet/service/kylin/entity/KylinArtist.java
+5
-0
SweetManualArtistsFiveMapper.xml
...net.service.sweet.mapper/SweetManualArtistsFiveMapper.xml
+9
-9
SweetManualArtistsMapper.xml
...quidnet.service.sweet.mapper/SweetManualArtistsMapper.xml
+15
-15
SweetManualArtistsMdskMapper.xml
...net.service.sweet.mapper/SweetManualArtistsMdskMapper.xml
+9
-9
SweetManualArtistsTfcMapper.xml
...dnet.service.sweet.mapper/SweetManualArtistsTfcMapper.xml
+9
-9
pom.xml
liquidnet-bus-service/liquidnet-service-sweet/pom.xml
+6
-0
SweetArtistsController.java
...dnet/service/sweet/controller/SweetArtistsController.java
+1
-46
SweetArtistsServiceImpl.java
...t/service/sweet/service/impl/SweetArtistsServiceImpl.java
+48
-124
RedisDataUtils.java
...ava/com/liquidnet/service/sweet/utils/RedisDataUtils.java
+18
-2
No files found.
docu/zhengzai-V1.5-20260304.sql
View file @
303c3969
...
...
@@ -6,6 +6,7 @@ CREATE TABLE `kylin_artist` (
`mid`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键ID'
,
`artist_id`
varchar
(
64
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
NOT
NULL
COMMENT
'艺人ID'
,
`artist_name`
varchar
(
50
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
NOT
NULL
COMMENT
'艺人名称'
,
`pinyin`
varchar
(
200
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
NOT
NULL
DEFAULT
''
COMMENT
'姓名拼音'
,
`artist_type`
tinyint
(
4
)
NOT
NULL
COMMENT
'艺人类型 1音乐人 2艺术家 3厂牌 4品牌方'
,
`avatar_url`
varchar
(
500
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
NOT
NULL
COMMENT
'艺人头像'
,
`introduction`
text
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
NOT
NULL
COMMENT
'艺人简介'
,
...
...
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/service/ISweetArtistsService.java
View file @
303c3969
...
...
@@ -4,16 +4,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.sweet.entity.SweetArtists
;
import
com.liquidnet.service.sweet.entity.SweetArtistsList
;
import
com.liquidnet.service.sweet.entity.SweetArtistsUrl
;
import
com.liquidnet.service.sweet.param.SweetArtistsListParam
;
import
com.liquidnet.service.sweet.vo.SweetArtistsVo
;
import
java.util.List
;
/**
* <p>
* 艺人表 服务类
* 艺人表 服务类
(读 kylin_artist,写已迁移至 admin)
* </p>
*
* @author liquidnet
...
...
@@ -23,12 +18,6 @@ public interface ISweetArtistsService extends IService<SweetArtists> {
ResponseDto
<
PageInfo
<
SweetArtists
>>
getList
(
int
page
,
int
size
,
String
name
);
ResponseDto
<
Boolean
>
add
(
SweetArtistsListParam
sweetArtistsList
);
ResponseDto
<
SweetArtistsVo
>
detail
(
String
artistsId
);
ResponseDto
<
Boolean
>
change
(
String
artistsId
,
SweetArtistsListParam
sweetArtistsList
);
ResponseDto
<
SweetArtists
>
del
(
String
artistsId
);
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/service/impl/KylinArtistServiceImpl.java
View file @
303c3969
...
...
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.client.admin.zhengzai.kylin.utils.DataUtils
;
import
com.liquidnet.client.admin.zhengzai.kylin.utils.SweetArtistCacheUtils
;
import
com.liquidnet.commons.lang.util.BeanUtil
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
...
...
@@ -59,6 +60,9 @@ public class KylinArtistServiceImpl extends ServiceImpl<KylinArtistMapper, Kylin
@Autowired
private
DataUtils
dataUtils
;
@Autowired
private
SweetArtistCacheUtils
sweetArtistCacheUtils
;
/**
* 创建艺人
*/
...
...
@@ -147,6 +151,7 @@ public class KylinArtistServiceImpl extends ServiceImpl<KylinArtistMapper, Kylin
dataUtils
.
delPerformanceArtists
(
p
);
}
}
sweetArtistCacheUtils
.
invalidateByArtistId
(
artistId
);
return
true
;
}
catch
(
Exception
e
)
{
log
.
error
(
"修改艺人失败"
,
e
);
...
...
@@ -293,6 +298,9 @@ public class KylinArtistServiceImpl extends ServiceImpl<KylinArtistMapper, Kylin
dataUtils
.
delPerformanceArtists
(
p
);
}
}
for
(
String
artistId
:
artistIds
)
{
sweetArtistCacheUtils
.
invalidateByArtistId
(
artistId
);
}
return
true
;
}
catch
(
Exception
e
)
{
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/utils/SweetArtistCacheUtils.java
0 → 100644
View file @
303c3969
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
kylin
.
utils
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.liquidnet.common.cache.redis.util.RedisDataSourceUtil
;
import
com.liquidnet.service.sweet.constant.SweetConstant
;
import
com.liquidnet.service.sweet.entity.SweetManualArtists
;
import
com.liquidnet.service.sweet.entity.SweetManualArtistsFive
;
import
com.liquidnet.service.sweet.entity.SweetManualArtistsMdsk
;
import
com.liquidnet.service.sweet.entity.SweetManualArtistsTfc
;
import
com.liquidnet.service.sweet.mapper.SweetManualArtistsFiveMapper
;
import
com.liquidnet.service.sweet.mapper.SweetManualArtistsMapper
;
import
com.liquidnet.service.sweet.mapper.SweetManualArtistsMdskMapper
;
import
com.liquidnet.service.sweet.mapper.SweetManualArtistsTfcMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.HashSet
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
* admin 修改 kylin 艺人后,失效 sweet 小程序相关 Redis 缓存
*/
@Slf4j
@Component
public
class
SweetArtistCacheUtils
{
@Autowired
private
RedisDataSourceUtil
redisDataSourceUtil
;
@Autowired
private
SweetManualArtistsMapper
sweetManualArtistsMapper
;
@Autowired
private
SweetManualArtistsMdskMapper
sweetManualArtistsMdskMapper
;
@Autowired
private
SweetManualArtistsTfcMapper
sweetManualArtistsTfcMapper
;
@Autowired
private
SweetManualArtistsFiveMapper
sweetManualArtistsFiveMapper
;
public
void
invalidateByArtistId
(
String
artistId
)
{
if
(
artistId
==
null
||
artistId
.
isEmpty
())
{
return
;
}
try
{
redisDataSourceUtil
.
getRedisSweetUtil
().
del
(
SweetConstant
.
REDIS_KEY_SWEET_ARTISTS_DETAILS
.
concat
(
artistId
));
invalidateManualTimeList
(
sweetManualArtistsMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetManualArtists
.
class
).
eq
(
SweetManualArtists:
:
getArtistsId
,
artistId
)
).
stream
().
map
(
SweetManualArtists:
:
getManualId
).
collect
(
Collectors
.
toSet
()),
SweetConstant
.
REDIS_KEY_SWEET_MANUAL_TIME_LIST
);
invalidateManualTimeList
(
sweetManualArtistsMdskMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetManualArtistsMdsk
.
class
).
eq
(
SweetManualArtistsMdsk:
:
getArtistsId
,
artistId
)
).
stream
().
map
(
SweetManualArtistsMdsk:
:
getManualId
).
collect
(
Collectors
.
toSet
()),
SweetConstant
.
REDIS_KEY_SWEET_MDSK_MANUAL_TIME_LIST
);
invalidateManualTimeList
(
sweetManualArtistsTfcMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetManualArtistsTfc
.
class
).
eq
(
SweetManualArtistsTfc:
:
getArtistsId
,
artistId
)
).
stream
().
map
(
SweetManualArtistsTfc:
:
getManualId
).
collect
(
Collectors
.
toSet
()),
SweetConstant
.
REDIS_KEY_SWEET_TFC_MANUAL_TIME_LIST
);
invalidateManualTimeList
(
sweetManualArtistsFiveMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetManualArtistsFive
.
class
).
eq
(
SweetManualArtistsFive:
:
getArtistsId
,
artistId
)
).
stream
().
map
(
SweetManualArtistsFive:
:
getManualId
).
collect
(
Collectors
.
toSet
()),
SweetConstant
.
REDIS_KEY_SWEET_FIVE_MANUAL_TIME_LIST
);
}
catch
(
Exception
e
)
{
log
.
error
(
"invalidate sweet artist cache failed, artistId={}"
,
artistId
,
e
);
}
}
private
void
invalidateManualTimeList
(
Set
<
String
>
manualIds
,
String
keyPrefix
)
{
if
(
manualIds
==
null
||
manualIds
.
isEmpty
())
{
return
;
}
for
(
String
manualId
:
new
HashSet
<>(
manualIds
))
{
if
(
manualId
!=
null
&&
!
manualId
.
isEmpty
())
{
redisDataSourceUtil
.
getRedisSweetUtil
().
del
(
keyPrefix
.
concat
(
manualId
));
}
}
}
}
liquidnet-bus-do/liquidnet-service-kylin-do/src/main/java/com/liquidnet/service/kylin/entity/KylinArtist.java
View file @
303c3969
...
...
@@ -36,6 +36,11 @@ public class KylinArtist implements Serializable, Cloneable {
*/
private
String
artistName
;
/**
* 姓名拼音
*/
private
String
pinyin
;
/**
* 艺人类型 1音乐人 2艺术家 3厂牌 4品牌方
*/
...
...
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/resources/com.liquidnet.service.sweet.mapper/SweetManualArtistsFiveMapper.xml
View file @
303c3969
...
...
@@ -23,11 +23,11 @@
<select
id=
"getManualList"
parameterType=
"java.util.Map"
resultMap=
"getManualListResult"
>
select manual_relation_id,
sa.`artist
s_id`
,
sa.`
name`
,
sa.`artist
_id` as artists_id
,
sa.`
artist_name` as name
,
sa.pinyin,
sa.describes,
sa.pic_url,
sa.
introduction as
describes,
sa.
avatar_url as
pic_url,
ss.stage_id,
ss.title,
performance_start,
...
...
@@ -35,7 +35,7 @@
signature_start,
signature_end
from sweet_manual_artists_Five as sma
left join
sweet_artists as sa on sa.artists
_id = sma.artists_id
left join
kylin_artist as sa on sa.artist
_id = sma.artists_id
left join sweet_stage as ss on ss.stage_id = sma.stage_id
<where>
sma.status = 1 and manual_id = #{manualId}
...
...
@@ -45,8 +45,8 @@
<select
id=
"getManualDetails"
parameterType=
"java.util.Map"
resultMap=
"getManualListResult"
>
select manual_relation_id,
sa.`
name`
,
sa.`artist
s_id`
,
sa.`
artist_name` as name
,
sa.`artist
_id` as artists_id
,
ss.title,
ss.stage_id,
performance_start,
...
...
@@ -54,7 +54,7 @@
signature_start,
signature_end
from sweet_manual_artists_Five as sma
left join
sweet_artists as sa on sa.artists
_id = sma.artists_id
left join
kylin_artist as sa on sa.artist
_id = sma.artists_id
left join sweet_stage as ss on ss.stage_id = sma.stage_id
where manual_relation_id = #{manualRelationId}
</select>
...
...
@@ -62,7 +62,7 @@
<select
id=
"getStageNameList"
parameterType=
"java.util.Map"
resultMap=
"getStageNameListResult"
>
select ss.title
from sweet_manual_artists_Five as sma
left join
sweet_artists as sa on sa.artists
_id = sma.artists_id
left join
kylin_artist as sa on sa.artist
_id = sma.artists_id
left join sweet_stage as ss on ss.stage_id = sma.stage_id
where sma.status = 1
and manual_id = #{manualId}
...
...
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/resources/com.liquidnet.service.sweet.mapper/SweetManualArtistsMapper.xml
View file @
303c3969
...
...
@@ -23,11 +23,11 @@
<select
id=
"getManualList"
parameterType=
"java.util.Map"
resultMap=
"getManualListResult"
>
select manual_relation_id,
sa.`artist
s_id`
,
sa.`
name`
,
sa.`artist
_id` as artists_id
,
sa.`
artist_name` as name
,
sa.pinyin,
sa.describes,
sa.pic_url,
sa.
introduction as
describes,
sa.
avatar_url as
pic_url,
ss.stage_id,
ss.title,
performance_start,
...
...
@@ -35,7 +35,7 @@
signature_start,
signature_end
from sweet_manual_artists as sma
left join
sweet_artists as sa on sa.artists
_id = sma.artists_id
left join
kylin_artist as sa on sa.artist
_id = sma.artists_id
left join sweet_stage as ss on ss.stage_id = sma.stage_id
<where>
sma.status = 1 and manual_id = #{manualId}
...
...
@@ -45,8 +45,8 @@
<select
id=
"getManualDetails"
parameterType=
"java.util.Map"
resultMap=
"getManualListResult"
>
select manual_relation_id,
sa.`
name`
,
sa.`artist
s_id`
,
sa.`
artist_name` as name
,
sa.`artist
_id` as artists_id
,
ss.title,
ss.stage_id,
performance_start,
...
...
@@ -54,7 +54,7 @@
signature_start,
signature_end
from sweet_manual_artists as sma
left join
sweet_artists as sa on sa.artists
_id = sma.artists_id
left join
kylin_artist as sa on sa.artist
_id = sma.artists_id
left join sweet_stage as ss on ss.stage_id = sma.stage_id
where manual_relation_id = #{manualRelationId}
</select>
...
...
@@ -62,7 +62,7 @@
<select
id=
"getStageNameList"
parameterType=
"java.util.Map"
resultMap=
"getStageNameListResult"
>
select ss.title
from sweet_manual_artists as sma
left join
sweet_artists as sa on sa.artists
_id = sma.artists_id
left join
kylin_artist as sa on sa.artist
_id = sma.artists_id
left join sweet_stage as ss on ss.stage_id = sma.stage_id
where sma.status = 1
and manual_id = #{manualId}
...
...
@@ -74,7 +74,7 @@
select ss.title, ss.stage_id
from sweet_manual_artists as sma
join sweet_manual as sm on sm.manual_id = sma.manual_id
left join
sweet_artists as sa on sa.artists
_id = sma.artists_id
left join
kylin_artist as sa on sa.artist
_id = sma.artists_id
left join sweet_stage as ss on ss.stage_id = sma.stage_id
where sma.status = 1
and sm.performance_id = #{performanceId}
...
...
@@ -82,11 +82,11 @@
</select>
<select
id=
"getManualListAr"
resultType=
"com.liquidnet.service.sweet.dto.SweetManualArtistListArDto"
>
select manual_relation_id,
sa.`artist
s_id`
,
sa.`
name`
,
sa.`artist
_id` as artists_id
,
sa.`
artist_name` as name
,
sa.pinyin,
sa.describes,
sa.pic_url,
sa.
introduction as
describes,
sa.
avatar_url as
pic_url,
ss.stage_id,
ss.title,
performance_start,
...
...
@@ -95,7 +95,7 @@
signature_end
from sweet_manual_artists as sma
join sweet_manual as sm on sm.manual_id = sma.manual_id
left join
sweet_artists as sa on sa.artists
_id = sma.artists_id
left join
kylin_artist as sa on sa.artist
_id = sma.artists_id
left join sweet_stage as ss on ss.stage_id = sma.stage_id
<where>
sma.status = 1 and sm.performance_id = #{performanceId}
...
...
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/resources/com.liquidnet.service.sweet.mapper/SweetManualArtistsMdskMapper.xml
View file @
303c3969
...
...
@@ -23,11 +23,11 @@
<select
id=
"getManualList"
parameterType=
"java.util.Map"
resultMap=
"getManualListResult"
>
select manual_relation_id,
sa.`artist
s_id`
,
sa.`
name`
,
sa.`artist
_id` as artists_id
,
sa.`
artist_name` as name
,
sa.pinyin,
sa.describes,
sa.pic_url,
sa.
introduction as
describes,
sa.
avatar_url as
pic_url,
ss.stage_id,
ss.title,
performance_start,
...
...
@@ -35,7 +35,7 @@
signature_start,
signature_end
from sweet_manual_artists_mdsk as sma
left join
sweet_artists as sa on sa.artists
_id = sma.artists_id
left join
kylin_artist as sa on sa.artist
_id = sma.artists_id
left join sweet_stage as ss on ss.stage_id = sma.stage_id
<where>
sma.status = 1 and manual_id = #{manualId}
...
...
@@ -45,8 +45,8 @@
<select
id=
"getManualDetails"
parameterType=
"java.util.Map"
resultMap=
"getManualListResult"
>
select manual_relation_id,
sa.`
name`
,
sa.`artist
s_id`
,
sa.`
artist_name` as name
,
sa.`artist
_id` as artists_id
,
ss.title,
ss.stage_id,
performance_start,
...
...
@@ -54,7 +54,7 @@
signature_start,
signature_end
from sweet_manual_artists_mdsk as sma
left join
sweet_artists as sa on sa.artists
_id = sma.artists_id
left join
kylin_artist as sa on sa.artist
_id = sma.artists_id
left join sweet_stage as ss on ss.stage_id = sma.stage_id
where manual_relation_id = #{manualRelationId}
</select>
...
...
@@ -62,7 +62,7 @@
<select
id=
"getStageNameList"
parameterType=
"java.util.Map"
resultMap=
"getStageNameListResult"
>
select ss.title
from sweet_manual_artists_mdsk as sma
left join
sweet_artists as sa on sa.artists
_id = sma.artists_id
left join
kylin_artist as sa on sa.artist
_id = sma.artists_id
left join sweet_stage as ss on ss.stage_id = sma.stage_id
where sma.status = 1
and manual_id = #{manualId}
...
...
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/resources/com.liquidnet.service.sweet.mapper/SweetManualArtistsTfcMapper.xml
View file @
303c3969
...
...
@@ -23,11 +23,11 @@
<select
id=
"getManualList"
parameterType=
"java.util.Map"
resultMap=
"getManualListResult"
>
select manual_relation_id,
sa.`artist
s_id`
,
sa.`
name`
,
sa.`artist
_id` as artists_id
,
sa.`
artist_name` as name
,
sa.pinyin,
sa.describes,
sa.pic_url,
sa.
introduction as
describes,
sa.
avatar_url as
pic_url,
ss.stage_id,
ss.title,
performance_start,
...
...
@@ -35,7 +35,7 @@
signature_start,
signature_end
from sweet_manual_artists_tfc as sma
left join
sweet_artists as sa on sa.artists
_id = sma.artists_id
left join
kylin_artist as sa on sa.artist
_id = sma.artists_id
left join sweet_stage as ss on ss.stage_id = sma.stage_id
<where>
sma.status = 1 and manual_id = #{manualId}
...
...
@@ -45,8 +45,8 @@
<select
id=
"getManualDetails"
parameterType=
"java.util.Map"
resultMap=
"getManualListResult"
>
select manual_relation_id,
sa.`
name`
,
sa.`artist
s_id`
,
sa.`
artist_name` as name
,
sa.`artist
_id` as artists_id
,
ss.title,
ss.stage_id,
performance_start,
...
...
@@ -54,7 +54,7 @@
signature_start,
signature_end
from sweet_manual_artists_tfc as sma
left join
sweet_artists as sa on sa.artists
_id = sma.artists_id
left join
kylin_artist as sa on sa.artist
_id = sma.artists_id
left join sweet_stage as ss on ss.stage_id = sma.stage_id
where manual_relation_id = #{manualRelationId}
</select>
...
...
@@ -62,7 +62,7 @@
<select
id=
"getStageNameList"
parameterType=
"java.util.Map"
resultMap=
"getStageNameListResult"
>
select ss.title
from sweet_manual_artists_tfc as sma
left join
sweet_artists as sa on sa.artists
_id = sma.artists_id
left join
kylin_artist as sa on sa.artist
_id = sma.artists_id
left join sweet_stage as ss on ss.stage_id = sma.stage_id
where sma.status = 1
and manual_id = #{manualId}
...
...
liquidnet-bus-service/liquidnet-service-sweet/pom.xml
View file @
303c3969
...
...
@@ -85,6 +85,12 @@
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
com.liquidnet
</groupId>
<artifactId>
liquidnet-service-kylin-do
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.data
</groupId>
<artifactId>
spring-data-mongodb
</artifactId>
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/controller/SweetArtistsController.java
View file @
303c3969
...
...
@@ -4,12 +4,7 @@ package com.liquidnet.service.sweet.controller;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.sweet.entity.SweetArtists
;
import
com.liquidnet.service.sweet.entity.SweetArtistsList
;
import
com.liquidnet.service.sweet.entity.SweetArtistsUrl
;
import
com.liquidnet.service.sweet.entity.SweetStage
;
import
com.liquidnet.service.sweet.param.SweetArtistsListParam
;
import
com.liquidnet.service.sweet.service.ISweetArtistsService
;
import
com.liquidnet.service.sweet.service.ISweetStageService
;
import
com.liquidnet.service.sweet.vo.SweetArtistsVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
...
...
@@ -18,11 +13,9 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* <p>
* 艺人表 前端控制器
* 艺人表 前端控制器
(读 kylin_artist,写已迁移至 admin /kylin/artist)
* </p>
*
* @author liquidnet
...
...
@@ -49,20 +42,6 @@ public class SweetArtistsController {
return
sweetArtistsService
.
getList
(
page
,
size
,
name
);
}
@PostMapping
(
"add"
)
@ApiOperation
(
"添加艺人"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"picUrl"
,
value
=
"封面图片"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"name"
,
value
=
"艺人姓名"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"pinyin"
,
value
=
"姓名拼音"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"describes"
,
value
=
"艺人简介"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String[]"
,
name
=
"picArray"
,
value
=
"图片数组"
,
required
=
false
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String[]"
,
name
=
"videoArray"
,
value
=
"视频数组"
,
required
=
false
)
})
public
ResponseDto
<
Boolean
>
add
(
SweetArtistsListParam
sweetArtistsList
)
{
return
sweetArtistsService
.
add
(
sweetArtistsList
);
}
@GetMapping
(
"detail"
)
@ApiOperation
(
"艺人详情"
)
@ApiImplicitParams
({
...
...
@@ -71,28 +50,4 @@ public class SweetArtistsController {
public
ResponseDto
<
SweetArtistsVo
>
detail
(
@RequestParam
()
String
artistsId
)
{
return
sweetArtistsService
.
detail
(
artistsId
);
}
@PostMapping
(
"change"
)
@ApiOperation
(
"修改艺人"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"picUrl"
,
value
=
"封面图片"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"artistsId"
,
value
=
"艺人Id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"name"
,
value
=
"艺人姓名"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"pinyin"
,
value
=
"姓名拼音"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"describes"
,
value
=
"艺人简介"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String[]"
,
name
=
"picArray"
,
value
=
"图片数组"
,
required
=
false
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String[]"
,
name
=
"videoArray"
,
value
=
"视频数组"
,
required
=
false
)
})
public
ResponseDto
<
Boolean
>
change
(
@RequestParam
()
String
artistsId
,
SweetArtistsListParam
sweetArtistsList
)
{
return
sweetArtistsService
.
change
(
artistsId
,
sweetArtistsList
);
}
@GetMapping
(
"del"
)
@ApiOperation
(
"删除艺人"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"artistsId"
,
value
=
"艺人Id"
,
required
=
true
),
})
public
ResponseDto
<
SweetArtists
>
del
(
@RequestParam
()
String
artistsId
)
{
return
sweetArtistsService
.
del
(
artistsId
);
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/SweetArtistsServiceImpl.java
View file @
303c3969
package
com
.
liquidnet
.
service
.
sweet
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.commons.lang.util.BeanUtil
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.
sweet.dto.SweetManualArtistList2Dto
;
import
com.liquidnet.service.
sweet.dto.SweetManualArtistListDto
;
import
com.liquidnet.service.sweet.
dto.SweetManualArtistStageListDto
;
import
com.liquidnet.service.sweet.entity.
*
;
import
com.liquidnet.service.
kylin.entity.KylinArtist
;
import
com.liquidnet.service.
kylin.mapper.KylinArtistMapper
;
import
com.liquidnet.service.sweet.
entity.SweetArtists
;
import
com.liquidnet.service.sweet.entity.
SweetArtistsUrl
;
import
com.liquidnet.service.sweet.mapper.SweetArtistsMapper
;
import
com.liquidnet.service.sweet.mapper.SweetArtistsUrlMapper
;
import
com.liquidnet.service.sweet.mapper.SweetManualArtistsMapper
;
import
com.liquidnet.service.sweet.mapper.SweetStageMapper
;
import
com.liquidnet.service.sweet.param.SweetArtistsListParam
;
import
com.liquidnet.service.sweet.service.ISweetArtistsService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.liquidnet.service.sweet.utils.RedisDataUtils
;
import
com.liquidnet.service.sweet.vo.SweetArtistsVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* <p>
* 艺人表 服务实现类
* 艺人表 服务实现类
(读 kylin_artist,写已迁移至 admin)
* </p>
*
* @author liquidnet
...
...
@@ -43,142 +34,75 @@ import java.util.List;
public
class
SweetArtistsServiceImpl
extends
ServiceImpl
<
SweetArtistsMapper
,
SweetArtists
>
implements
ISweetArtistsService
{
@Autowired
private
SweetArtistsMapper
sweetArtistsMapper
;
@Autowired
private
SweetManualArtistsMapper
sweetManualArtistsMapper
;
@Autowired
private
RedisDataUtils
redisDataUtils
;
private
KylinArtistMapper
kylinArtistMapper
;
@Autowired
private
SweetArtistsUrlMapper
sweetArtistsUrlMapper
;
@Override
public
ResponseDto
<
PageInfo
<
SweetArtists
>>
getList
(
int
page
,
int
size
,
String
name
)
{
PageInfo
<
SweetArtists
>
pageInfo
=
null
;
try
{
List
<
SweetArtists
>
data
;
PageHelper
.
startPage
(
page
,
size
);
if
(
name
!=
null
)
{
data
=
sweetArtistsMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetArtists
.
class
).
like
(
SweetArtists:
:
getName
,
name
));
List
<
KylinArtist
>
kylinList
;
if
(
name
!=
null
&&
!
name
.
isEmpty
())
{
kylinList
=
kylinArtistMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
KylinArtist
.
class
)
.
like
(
KylinArtist:
:
getArtistName
,
name
)
.
eq
(
KylinArtist:
:
getStatus
,
1
)
.
orderByDesc
(
KylinArtist:
:
getSort
)
.
orderByDesc
(
KylinArtist:
:
getCreatedAt
)
);
}
else
{
data
=
sweetArtistsMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetArtists
.
class
));
}
kylinList
=
kylinArtistMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
KylinArtist
.
class
)
.
eq
(
KylinArtist:
:
getStatus
,
1
)
.
orderByDesc
(
KylinArtist:
:
getSort
)
.
orderByDesc
(
KylinArtist:
:
getCreatedAt
)
);
}
List
<
SweetArtists
>
data
=
kylinList
.
stream
().
map
(
this
::
toSweetArtists
).
collect
(
Collectors
.
toList
());
pageInfo
=
new
PageInfo
(
data
);
return
ResponseDto
.
success
(
pageInfo
);
}
catch
(
Exception
e
)
{
log
.
error
(
"getList error"
,
e
);
return
ResponseDto
.
success
(
pageInfo
);
}
}
@Override
@Transactional
public
ResponseDto
<
Boolean
>
add
(
SweetArtistsListParam
sweetArtistsList
)
{
try
{
String
mid
=
IDGenerator
.
nextSnowId
();
LocalDateTime
time
=
LocalDateTime
.
now
();
SweetArtistsUrl
sweetArtistsUrl
=
SweetArtistsUrl
.
getNew
();
SweetArtists
sweetArtists
=
SweetArtists
.
getNew
();
sweetArtists
.
setArtistsId
(
mid
);
sweetArtists
.
setName
(
sweetArtistsList
.
getName
());
sweetArtists
.
setPinyin
(
sweetArtistsList
.
getPinyin
());
sweetArtists
.
setDescribes
(
sweetArtistsList
.
getDescribes
());
sweetArtists
.
setPicUrl
(
sweetArtistsList
.
getPicUrl
());
sweetArtists
.
setCreatedAt
(
time
);
sweetArtists
.
setUpdatdAt
(
time
);
sweetArtistsMapper
.
insert
(
sweetArtists
);
sweetArtistsUrl
.
setArtistsId
(
mid
);
sweetArtistsUrl
.
setCreatedAt
(
time
);
if
(
sweetArtistsList
.
getPicArray
()
!=
null
)
{
for
(
String
img
:
sweetArtistsList
.
getPicArray
())
{
sweetArtistsUrl
.
setUrl
(
img
);
sweetArtistsUrl
.
setType
(
"1"
);
sweetArtistsUrlMapper
.
insert
(
sweetArtistsUrl
);
}
}
if
(
sweetArtistsList
.
getVideoArray
()
!=
null
)
{
for
(
String
video
:
sweetArtistsList
.
getVideoArray
())
{
sweetArtistsUrl
.
setUrl
(
video
);
sweetArtistsUrl
.
setType
(
"2"
);
sweetArtistsUrlMapper
.
insert
(
sweetArtistsUrl
);
}
}
return
ResponseDto
.
success
();
}
catch
(
Exception
e
)
{
return
ResponseDto
.
failure
();
}
}
@Override
public
ResponseDto
<
SweetArtistsVo
>
detail
(
String
artistsId
)
{
try
{
SweetArtistsVo
vo
=
SweetArtistsVo
.
getNew
();
SweetArtists
sweetArtists
=
sweetArtistsMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
SweetArtists
.
class
).
eq
(
SweetArtists:
:
getArtistsId
,
artistsId
));
BeanUtils
.
copyProperties
(
sweetArtists
,
vo
);
List
<
SweetArtistsUrl
>
sweetArtistsUrl
=
sweetArtistsUrlMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetArtistsUrl
.
class
).
eq
(
SweetArtistsUrl:
:
getArtistsId
,
artistsId
));
KylinArtist
kylinArtist
=
kylinArtistMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
KylinArtist
.
class
)
.
eq
(
KylinArtist:
:
getArtistId
,
artistsId
)
.
eq
(
KylinArtist:
:
getStatus
,
1
)
);
if
(
kylinArtist
==
null
)
{
return
ResponseDto
.
failure
();
}
BeanUtils
.
copyProperties
(
toSweetArtists
(
kylinArtist
),
vo
);
List
<
SweetArtistsUrl
>
sweetArtistsUrl
=
sweetArtistsUrlMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetArtistsUrl
.
class
).
eq
(
SweetArtistsUrl:
:
getArtistsId
,
artistsId
)
);
vo
.
setSweetArtistsUrl
(
sweetArtistsUrl
);
return
ResponseDto
.
success
(
vo
);
}
catch
(
Exception
e
)
{
log
.
error
(
"
==
"
,
e
);
log
.
error
(
"
detail error
"
,
e
);
return
ResponseDto
.
failure
();
}
}
@Override
@Transactional
public
ResponseDto
<
Boolean
>
change
(
String
artistsId
,
SweetArtistsListParam
sweetArtistsList
)
{
try
{
LocalDateTime
time
=
LocalDateTime
.
now
();
private
SweetArtists
toSweetArtists
(
KylinArtist
kylinArtist
)
{
SweetArtists
sweetArtists
=
SweetArtists
.
getNew
();
sweetArtists
.
setName
(
sweetArtistsList
.
getName
());
sweetArtists
.
setPinyin
(
sweetArtistsList
.
getPinyin
());
sweetArtists
.
setPicUrl
(
sweetArtistsList
.
getPicUrl
());
sweetArtists
.
setDescribes
(
sweetArtistsList
.
getDescribes
());
sweetArtists
.
setUpdatdAt
(
time
);
SweetArtistsUrl
sweetArtistsUrl
=
SweetArtistsUrl
.
getNew
();
sweetArtistsUrl
.
setCreatedAt
(
time
);
sweetArtistsMapper
.
update
(
sweetArtists
,
Wrappers
.
lambdaUpdate
(
SweetArtists
.
class
).
eq
(
SweetArtists:
:
getArtistsId
,
artistsId
));
//更新关联表
sweetArtistsUrlMapper
.
delete
(
Wrappers
.
lambdaQuery
(
SweetArtistsUrl
.
class
).
eq
(
SweetArtistsUrl:
:
getArtistsId
,
artistsId
));
sweetArtistsUrl
.
setArtistsId
(
artistsId
);
sweetArtistsUrl
.
setCreatedAt
(
time
);
for
(
String
img
:
sweetArtistsList
.
getPicArray
())
{
sweetArtistsUrl
.
setUrl
(
img
);
sweetArtistsUrl
.
setType
(
"1"
);
sweetArtistsUrlMapper
.
insert
(
sweetArtistsUrl
);
}
String
[]
videoArray
=
sweetArtistsList
.
getVideoArray
();
if
(
null
!=
videoArray
&&
videoArray
.
length
>
0
)
{
for
(
String
video
:
sweetArtistsList
.
getVideoArray
())
{
sweetArtistsUrl
.
setUrl
(
video
);
sweetArtistsUrl
.
setType
(
"2"
);
sweetArtistsUrlMapper
.
insert
(
sweetArtistsUrl
);
}
}
List
<
SweetManualArtists
>
data
=
sweetManualArtistsMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetManualArtists
.
class
).
eq
(
SweetManualArtists:
:
getArtistsId
,
artistsId
));
for
(
SweetManualArtists
item
:
data
)
{
redisDataUtils
.
deleteTimeListRedisData
(
item
.
getManualId
());
}
return
ResponseDto
.
success
();
}
catch
(
Exception
e
)
{
log
.
error
(
"sweetArtistsChangeExc"
,
e
);
log
.
error
(
"sweetArtistsChangeE [e:{}]"
,
e
);
return
ResponseDto
.
failure
();
}
sweetArtists
.
setArtistsId
(
kylinArtist
.
getArtistId
());
sweetArtists
.
setName
(
kylinArtist
.
getArtistName
());
sweetArtists
.
setPinyin
(
kylinArtist
.
getPinyin
());
sweetArtists
.
setDescribes
(
kylinArtist
.
getIntroduction
());
sweetArtists
.
setPicUrl
(
kylinArtist
.
getAvatarUrl
());
sweetArtists
.
setStatus
(
kylinArtist
.
getStatus
());
sweetArtists
.
setCreatedAt
(
kylinArtist
.
getCreatedAt
());
sweetArtists
.
setUpdatdAt
(
kylinArtist
.
getUpdatedAt
());
return
sweetArtists
;
}
@Override
@Transactional
public
ResponseDto
<
SweetArtists
>
del
(
String
artistsId
)
{
try
{
sweetArtistsMapper
.
delete
(
Wrappers
.
lambdaQuery
(
SweetArtists
.
class
).
eq
(
SweetArtists:
:
getArtistsId
,
artistsId
));
sweetArtistsUrlMapper
.
delete
(
Wrappers
.
lambdaQuery
(
SweetArtistsUrl
.
class
).
eq
(
SweetArtistsUrl:
:
getArtistsId
,
artistsId
));
return
ResponseDto
.
success
();
}
catch
(
Exception
e
)
{
return
ResponseDto
.
failure
();
}
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/utils/RedisDataUtils.java
View file @
303c3969
...
...
@@ -15,6 +15,8 @@ import com.liquidnet.service.base.constant.MQConst;
import
com.liquidnet.service.base.constant.RedisKeyExpireConst
;
import
com.liquidnet.service.feign.slime.api.FeignSlimeApiClient
;
import
com.liquidnet.service.slime.dto.vo.SlimeFieldsDetailsVo
;
import
com.liquidnet.service.kylin.entity.KylinArtist
;
import
com.liquidnet.service.kylin.mapper.KylinArtistMapper
;
import
com.liquidnet.service.sweet.constant.SweetConstant
;
import
com.liquidnet.service.sweet.dto.*
;
import
com.liquidnet.service.sweet.dto.param.poster.SweetStrawberryParam
;
...
...
@@ -58,7 +60,7 @@ public class RedisDataUtils {
@Autowired
private
SweetManualShopMapper
sweetManualShopMapper
;
@Autowired
private
SweetArtistsMapper
sweetArtists
Mapper
;
private
KylinArtistMapper
kylinArtist
Mapper
;
@Autowired
private
SweetIntegralActivityDrawMapper
sweetIntegralActivityDrawMapper
;
@Autowired
...
...
@@ -405,7 +407,21 @@ public class RedisDataUtils {
// 艺人详情
public
SweetArtists
setArtistsDetails
(
String
artistsId
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_ARTISTS_DETAILS
.
concat
(
artistsId
);
SweetArtists
sweetArtists
=
sweetArtistsMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
SweetArtists
.
class
).
eq
(
SweetArtists:
:
getArtistsId
,
artistsId
).
eq
(
SweetArtists:
:
getStatus
,
1
));
KylinArtist
kylinArtist
=
kylinArtistMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
KylinArtist
.
class
).
eq
(
KylinArtist:
:
getArtistId
,
artistsId
).
eq
(
KylinArtist:
:
getStatus
,
1
)
);
SweetArtists
sweetArtists
=
null
;
if
(
kylinArtist
!=
null
)
{
sweetArtists
=
SweetArtists
.
getNew
();
sweetArtists
.
setArtistsId
(
kylinArtist
.
getArtistId
());
sweetArtists
.
setName
(
kylinArtist
.
getArtistName
());
sweetArtists
.
setPinyin
(
kylinArtist
.
getPinyin
());
sweetArtists
.
setDescribes
(
kylinArtist
.
getIntroduction
());
sweetArtists
.
setPicUrl
(
kylinArtist
.
getAvatarUrl
());
sweetArtists
.
setStatus
(
kylinArtist
.
getStatus
());
sweetArtists
.
setCreatedAt
(
kylinArtist
.
getCreatedAt
());
sweetArtists
.
setUpdatdAt
(
kylinArtist
.
getUpdatedAt
());
}
redisUtil
.
set
(
redisKey
,
sweetArtists
);
return
sweetArtists
;
}
...
...
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