Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
向汉
/
uc-engine
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
9585ccf4
...
9585ccf445ddd3afa1f22a7fe18775c2a56b943e
authored
2022-05-14 16:12:35 +0800
by
xianghan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1.优化
1 parent
e6e3d83d
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
199 additions
and
286 deletions
member-service-impl/pom.xml
member-service-impl/src/main/java/com/topdraw/business/module/member/rest/MemberController.java
member-service-impl/src/main/java/com/topdraw/business/module/rights/domain/Rights.java
member-service-impl/src/main/java/com/topdraw/business/module/rights/service/dto/RightsDTO.java
member-service-impl/src/main/java/com/topdraw/business/process/domian/weixin/UnbindGroup.java
member-service-impl/src/main/java/com/topdraw/business/process/domian/weixin/WeiXinUserBean.java
member-service-impl/src/main/java/com/topdraw/business/process/domian/weixin/WeixinUnBindBean.java
member-service-impl/src/main/java/com/topdraw/business/process/rest/UserOperationController.java
member-service-impl/src/main/java/com/topdraw/business/process/service/UserOperationService.java
member-service-impl/src/main/java/com/topdraw/business/process/service/impl/RightsOperationServiceImpl.java
member-service-impl/src/main/java/com/topdraw/business/process/service/impl/TaskOperationServiceImpl.java
member-service-impl/src/main/java/com/topdraw/business/process/service/impl/UserOperationServiceImpl.java
member-service-impl/src/main/java/com/topdraw/business/process/service/impl/member/MemberOperationServiceImpl.java
member-service-impl/src/main/java/com/topdraw/mq/config/RabbitMqConfig.java
member-service-impl/src/main/java/com/topdraw/mq/producer/MessageProducer.java
member-service-impl/src/main/resources/config/application-dev.yml
member-service-impl/src/main/resources/config/application-prod.yml
member-service-impl/src/main/resources/config/application-test.yml
member-service-impl/src/test/java/com/topdraw/test/business/process/rest/UserOperationControllerTest.java
member-service-impl/pom.xml
View file @
9585ccf
...
...
@@ -20,6 +20,11 @@
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-cache
</artifactId>
</dependency>
<!--api-->
<dependency>
<groupId>
com.topdraw
</groupId>
...
...
member-service-impl/src/main/java/com/topdraw/business/module/member/rest/MemberController.java
View file @
9585ccf
...
...
@@ -56,7 +56,6 @@ public class MemberController {
public
ResultInfo
doUpdateVipByCode
(
@Validated
(
value
=
{
UpdateGroup
.
class
})
@RequestBody
Member
resources
)
{
log
.
info
(
"member ==>> doUpdateVipByCode ==>> param ==>> [{}]"
,
resources
);
this
.
memberOperationService
.
update
(
resources
);
log
.
info
(
"member ==>> doUpdateVipByCode ==>> result ==>> [{}]"
,
resources
);
return
ResultInfo
.
success
();
}
...
...
@@ -68,7 +67,6 @@ public class MemberController {
log
.
info
(
"member ==>> update ==>> param ==>> [{}]"
,
resources
);
MemberDTO
memberDTO
=
this
.
memberOperationService
.
update
(
resources
);
log
.
info
(
"member ==>> update ==>> result ==>> [{}]"
,
resources
);
return
ResultInfo
.
success
(
memberDTO
);
}
...
...
member-service-impl/src/main/java/com/topdraw/business/module/rights/domain/Rights.java
View file @
9585ccf
...
...
@@ -59,7 +59,7 @@ public class Rights implements Serializable {
/** 失效时间,空为不失效,否则为获得权益后直到失效的毫秒数 */
@Column
(
name
=
"expire_time"
)
private
Timestamp
expireTime
;
private
Long
expireTime
;
/** 创建时间 */
@CreatedDate
...
...
member-service-impl/src/main/java/com/topdraw/business/module/rights/service/dto/RightsDTO.java
View file @
9585ccf
...
...
@@ -37,7 +37,7 @@ public class RightsDTO implements Serializable {
private
Timestamp
validTime
;
/** 失效时间,空为不失效,否则为获得权益后直到失效的毫秒数 */
private
Timestamp
expireTime
;
private
Long
expireTime
;
/** 创建时间 */
private
Timestamp
createTime
;
...
...
member-service-impl/src/main/java/com/topdraw/business/process/domian/weixin/UnbindGroup.java
0 → 100644
View file @
9585ccf
package
com
.
topdraw
.
business
.
process
.
domian
.
weixin
;
/**
* @author :
* @description:
* @function :
* @date :Created in 2022/3/20 16:43
* @version: :
* @modified By:
* @since : modified in 2022/3/20 16:43
*/
public
interface
UnbindGroup
{
}
member-service-impl/src/main/java/com/topdraw/business/process/domian/weixin/WeiXinUserBean.java
View file @
9585ccf
...
...
@@ -15,7 +15,7 @@ public class WeiXinUserBean {
private
Long
id
;
@NotNull
(
message
=
"unionid can't be null"
,
groups
=
{
BindGroup
.
class
})
//
@NotNull(message = "unionid can't be null" , groups = {BindGroup.class})
private
String
unionid
;
/** */
...
...
member-service-impl/src/main/java/com/topdraw/business/process/domian/weixin/WeixinUnBindBean.java
0 → 100644
View file @
9585ccf
package
com
.
topdraw
.
business
.
process
.
domian
.
weixin
;
import
lombok.Data
;
@Data
public
class
WeixinUnBindBean
extends
WeiXinUserBean
{
/** 是否自动设置主账号 true:是;false(默认):否 */
private
Boolean
autoModel
;
}
member-service-impl/src/main/java/com/topdraw/business/process/rest/UserOperationController.java
View file @
9585ccf
...
...
@@ -172,10 +172,10 @@ public class UserOperationController {
SubscribeBean
subscribeBean
=
JSONUtil
.
parseMsg2Object
(
data
.
getContent
(),
SubscribeBean
.
class
);
String
appId
=
subscribeBean
.
getApp
I
d
();
String
appId
=
subscribeBean
.
getApp
i
d
();
Assert
.
notNull
(
appId
,
GlobeExceptionMsg
.
APP_ID_IS_NULL
);
// openId
String
openId
=
subscribeBean
.
getOpen
I
d
();
String
openId
=
subscribeBean
.
getOpen
i
d
();
Assert
.
notNull
(
openId
,
GlobeExceptionMsg
.
OPEN_ID_IS_NULL
);
subscribeBean
.
setAppid
(
appId
);
...
...
@@ -200,10 +200,10 @@ public class UserOperationController {
@PostMapping
(
"/minaUnbind"
)
@ApiOperation
(
"小屏解绑"
)
@AnonymousAccess
public
ResultInfo
minaUnbind
(
@Validated
(
value
=
{
BindGroup
.
class
})
@RequestBody
TvUnBindBean
tv
UnBindBean
)
{
log
.
info
(
"UserOperationController ==>
appletBind ==>> param ==> [{}]"
,
tv
UnBindBean
);
public
ResultInfo
minaUnbind
(
@Validated
(
value
=
{
UnbindGroup
.
class
})
@RequestBody
WeixinUnBindBean
weixin
UnBindBean
)
{
log
.
info
(
"UserOperationController ==>
minaUnbind ==>> param ==> [{}]"
,
weixin
UnBindBean
);
this
.
userOperationService
.
minaUnbind
(
tv
UnBindBean
);
this
.
userOperationService
.
minaUnbind
(
weixin
UnBindBean
);
return
ResultInfo
.
success
();
}
...
...
member-service-impl/src/main/java/com/topdraw/business/process/service/UserOperationService.java
View file @
9585ccf
...
...
@@ -8,6 +8,7 @@ import com.topdraw.business.module.user.weixin.service.dto.UserWeixinDTO;
import
com.topdraw.business.process.domian.weixin.BindBean
;
import
com.topdraw.business.process.domian.weixin.SubscribeBean
;
import
com.topdraw.business.process.domian.weixin.TvUnBindBean
;
import
com.topdraw.business.process.domian.weixin.WeixinUnBindBean
;
public
interface
UserOperationService
{
...
...
@@ -142,7 +143,7 @@ public interface UserOperationService {
/**
* 小屏解绑
* @param
tv
UnBindBean
* @param
weixin
UnBindBean
*/
void
minaUnbind
(
TvUnBindBean
tv
UnBindBean
);
void
minaUnbind
(
WeixinUnBindBean
weixin
UnBindBean
);
}
...
...
member-service-impl/src/main/java/com/topdraw/business/process/service/impl/RightsOperationServiceImpl.java
View file @
9585ccf
...
...
@@ -230,7 +230,11 @@ public class RightsOperationServiceImpl implements RightsOperationService {
RightsDTO
rightsDTO
=
this
.
getRights
(
rightId
);
// 权益的实体类型 1:积分;2成长值;3优惠券
String
type
=
rightsDTO
.
getEntityType
();
Timestamp
expireTime
=
rightsDTO
.
getExpireTime
();
Long
expireTime1
=
rightsDTO
.
getExpireTime
();
Timestamp
expireTime
=
null
;
if
(
Objects
.
nonNull
(
expireTime1
)){
expireTime
=
TimestampUtil
.
long2Timestamp
(
expireTime1
);
}
switch
(
type
)
{
// 优惠券
...
...
member-service-impl/src/main/java/com/topdraw/business/process/service/impl/TaskOperationServiceImpl.java
View file @
9585ccf
...
...
@@ -345,9 +345,12 @@ public class TaskOperationServiceImpl implements TaskOperationService {
tempRights
.
setMemberId
(
memberId
);
tempRights
.
setMemberCode
(
memberCode
);
tempRights
.
setRightsAmount
(
rightsAmount
);
Timestamp
expireTime
=
rightsDTO
.
getExpireTime
();
if
(
Objects
.
nonNull
(
expireTime
))
tempRights
.
setExpireTime
(
expireTime
);
Long
expireTime1
=
rightsDTO
.
getExpireTime
();
if
(
Objects
.
nonNull
(
expireTime1
))
{
Timestamp
expireTime
=
TimestampUtil
.
long2Timestamp
(
expireTime1
);
if
(
Objects
.
nonNull
(
expireTime
))
tempRights
.
setExpireTime
(
expireTime
);
}
return
tempRights
;
}
...
...
member-service-impl/src/main/java/com/topdraw/business/process/service/impl/UserOperationServiceImpl.java
View file @
9585ccf
...
...
@@ -412,8 +412,7 @@ public class UserOperationServiceImpl implements UserOperationService {
UserTvDTO
userTvDTO
=
this
.
findByPlatformAccount
(
platformAccount
);
if
(
Objects
.
nonNull
(
userTvDTO
))
{
if
(
userTvDTO
.
getPriorityMemberCode
().
equalsIgnoreCase
(
memberCode
))
if
(
StringUtils
.
isNotBlank
(
userTvDTO
.
getPriorityMemberCode
())
&&
userTvDTO
.
getPriorityMemberCode
().
equalsIgnoreCase
(
memberCode
))
throw
new
BadRequestException
(
"会员已是主账户"
);
}
else
{
...
...
@@ -548,7 +547,7 @@ public class UserOperationServiceImpl implements UserOperationService {
public
boolean
addCollection
(
String
content
)
{
try
{
//处理接口调用 中文不显示问题
content
=
new
String
(
Base64
.
getDecoder
().
decode
(
content
.
getBytes
(
StandardCharsets
.
UTF_8
)));
//
content = new String(Base64.getDecoder().decode(content.getBytes(StandardCharsets.UTF_8)));
log
.
info
(
"receive UserCollection add message, content {}"
,
content
);
...
...
@@ -904,7 +903,7 @@ public class UserOperationServiceImpl implements UserOperationService {
* @param memberCode
* @param auto manual:手动 auto:自动
*/
private
UserTvDTO
bondPriorityMember
(
UserTvDTO
userTvDTO
,
String
memberCode
,
String
auto
)
{
private
UserTvDTO
bondPriorityMember
(
UserTvDTO
userTvDTO
,
String
memberCode
,
String
auto
)
{
if
(
auto
.
equalsIgnoreCase
(
"auto"
))
{
// 主账户
...
...
@@ -944,31 +943,39 @@ public class UserOperationServiceImpl implements UserOperationService {
if
(
Objects
.
nonNull
(
userTvDTO
))
{
if
(
autoModel
==
true
)
{
// 有其他绑定的小程序会员
List
<
MemberDTO
>
memberDTOList
=
this
.
memberService
.
findByUserIptvId
(
id
);
if
(
CollectionUtils
.
isNotEmpty
(
memberDTOList
))
{
// 过滤预解绑的会员
/*List<MemberDTO> memberDTOS = memberDTOList.stream().filter(memberDTO ->
!memberDTO.getCode().equalsIgnoreCase(memberCode)).collect(Collectors.toList());*/
// 按绑定时间倒排
memberDTOList
.
sort
(
new
Comparator
<
MemberDTO
>()
{
@Override
public
int
compare
(
MemberDTO
memberDTO
,
MemberDTO
t1
)
{
return
t1
.
getBindIptvTime
().
compareTo
(
memberDTO
.
getBindIptvTime
());
}
});
// if (CollectionUtils.isNotEmpty(memberDTOS)) {
// 绑定新的主账号
UserTvDTO
_userTvDTO
=
this
.
bondPriorityMember
(
userTvDTO
,
memberDTOList
.
get
(
0
).
getCode
(),
"manual"
);
// 按绑定时间倒排
memberDTOList
.
sort
(
new
Comparator
<
MemberDTO
>()
{
@Override
public
int
compare
(
MemberDTO
memberDTO
,
MemberDTO
t1
)
{
return
t1
.
getBindIptvTime
().
compareTo
(
memberDTO
.
getBindIptvTime
());
}
});
return
_userTvDTO
;
// 绑定新的主账号
UserTvDTO
_userTvDTO
=
this
.
bondPriorityMember
(
userTvDTO
,
memberDTOList
.
get
(
0
).
getCode
(),
"manual"
);
}
else
{
return
_userTvDTO
;
}
// 绑定新的主账号
UserTvDTO
_userTvDTO
=
this
.
bondPriorityMember
(
userTvDTO
,
null
,
"manual"
);
return
_userTvDTO
;
}
}
else
{
// 绑定新的主账号
UserTvDTO
_userTvDTO
=
this
.
bondPriorityMember
(
userTvDTO
,
null
,
"manual"
);
return
_userTvDTO
;
// }
}
}
...
...
@@ -1169,11 +1176,18 @@ public class UserOperationServiceImpl implements UserOperationService {
}
@Override
public
void
minaUnbind
(
TvUnBindBean
tv
UnBindBean
)
{
public
void
minaUnbind
(
WeixinUnBindBean
weixin
UnBindBean
)
{
Long
memberId
=
tv
UnBindBean
.
getMemberId
();
Long
memberId
=
weixin
UnBindBean
.
getMemberId
();
MemberDTO
memberDTO
=
this
.
memberService
.
findById
(
memberId
);
Assert
.
notNull
(
memberDTO
.
getUserIptvId
(),
GlobeExceptionMsg
.
IPTV_IS_NULL
);
UserTvDTO
userTvDTO
=
this
.
userTvService
.
findById
(
memberDTO
.
getUserIptvId
());
TvUnBindBean
tvUnBindBean
=
new
TvUnBindBean
();
tvUnBindBean
.
setMemberId
(
memberId
);
tvUnBindBean
.
setAutoModel
(
weixinUnBindBean
.
getAutoModel
());
String
platformAccount
=
userTvDTO
.
getPlatformAccount
();
tvUnBindBean
.
setPlatformAccount
(
platformAccount
);
this
.
tvUnbind
(
tvUnBindBean
);
...
...
member-service-impl/src/main/java/com/topdraw/business/process/service/impl/member/MemberOperationServiceImpl.java
View file @
9585ccf
...
...
@@ -21,6 +21,7 @@ import com.topdraw.util.TimestampUtil;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.annotation.CacheConfig
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.CachePut
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
...
...
@@ -33,7 +34,7 @@ import java.time.ZoneOffset;
import
java.util.Objects
;
@Service
@CacheConfig
(
cacheNames
=
"member"
)
//
@CacheConfig(cacheNames = "member")
public
class
MemberOperationServiceImpl
implements
MemberOperationService
{
@Autowired
...
...
@@ -109,7 +110,7 @@ public class MemberOperationServiceImpl implements MemberOperationService {
}
@AsyncMqSend
// @CachePut(key = "#resources.id")
// @CachePut(
value = "ucs::member",
key = "#resources.id")
@Override
public
MemberDTO
update
(
Member
resources
)
{
MemberDTO
memberDTO
=
this
.
memberService
.
update
(
resources
);
...
...
member-service-impl/src/main/java/com/topdraw/mq/config/RabbitMqConfig.java
View file @
9585ccf
package
com
.
topdraw
.
mq
.
config
;
import
com.topdraw.config.LocalConstants
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.amqp.core.*
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -11,41 +9,29 @@ import org.springframework.context.annotation.Configuration;
@Configuration
public
class
RabbitMqConfig
{
@Value
(
"${engine.platform}"
)
private
String
platform
;
@Value
(
"${engine.type}"
)
private
String
type
;
public
static
final
String
UCE_EXCHANGE
=
"uce.exchange"
;
public
static
final
String
UCE_QUEUE
=
"uce.queue"
;
@Value
(
"${
engin
e.mq.exchange}"
)
@Value
(
"${
servic
e.mq.exchange}"
)
private
String
exchange
;
@Value
(
"${
engine.mq.routingkey
}"
)
private
String
routingKey
;
@Value
(
"${
service.mq.queue
}"
)
private
String
queue
;
public
String
getExchange
(){
if
(
StringUtils
.
isEmpty
(
this
.
exchange
))
{
this
.
routingKey
=
"uc.direct"
;
this
.
exchange
=
UCE_EXCHANGE
;
}
return
this
.
exchange
;
}
public
String
getRoutingKey
()
{
if
(
StringUtils
.
isEmpty
(
this
.
routingKey
))
{
if
(
platform
.
equalsIgnoreCase
(
LocalConstants
.
PLATFORM_TYPE_SERVICE
))
{
if
(
StringUtils
.
isEmpty
(
this
.
type
))
{
this
.
type
=
LocalConstants
.
ENV_VIS
;
}
}
this
.
routingKey
=
"uc."
+
platform
+
"."
+
type
+
".direct"
;
public
String
getQueue
()
{
if
(
StringUtils
.
isEmpty
(
this
.
queue
))
{
this
.
queue
=
UCE_QUEUE
;
}
return
routingKey
;
return
this
.
queue
;
}
@Bean
...
...
@@ -54,13 +40,13 @@ public class RabbitMqConfig {
}
@Bean
Queue
queue
(){
return
new
Queue
(
get
RoutingKey
());
}
Queue
queue
(){
return
new
Queue
(
get
Queue
());
}
@Bean
Binding
binding
(
DirectExchange
directExchange
,
Queue
queue
)
{
BindingBuilder
.
DirectExchangeRoutingKeyConfigurer
directExchangeRoutingKeyConfigurer
=
BindingBuilder
.
bind
(
queue
).
to
(
directExchange
);
return
directExchangeRoutingKeyConfigurer
.
with
(
getRoutingKey
());
return
directExchangeRoutingKeyConfigurer
.
with
(
this
.
getQueue
());
}
}
...
...
member-service-impl/src/main/java/com/topdraw/mq/producer/MessageProducer.java
View file @
9585ccf
package
com
.
topdraw
.
mq
.
producer
;
import
com.topdraw.config.LocalConstants
;
import
com.topdraw.mq.config.RabbitMqConfig
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -18,41 +16,45 @@ public class MessageProducer {
@Autowired
private
AmqpTemplate
amqpTemplate
;
@Value
(
"#{rabbitMqConfig.get
RoutingKey
()}"
)
private
String
routingKey
;
@Value
(
"#{rabbitMqConfig.get
Exchange
()}"
)
private
String
exchange
;
@Value
(
"#{rabbitMqConfig.getQueue()}"
)
private
String
queue
;
public
void
sendMessage
(
String
msg
,
String
exchangeName
){
public
void
sendMessage
(
String
msg
){
this
.
sendMessage
(
msg
,
null
,
null
);
}
public
void
sendMessage
(
String
msg
,
String
queue
){
// 管理侧
if
(
StringUtils
.
isEmpty
(
exchangeNam
e
))
{
exchangeName
=
this
.
routingKey
;
if
(
StringUtils
.
isEmpty
(
queu
e
))
{
queue
=
this
.
queue
;
}
this
.
send
DirectMessage
(
msg
,
exchangeNam
e
);
this
.
send
Message
(
msg
,
null
,
queu
e
);
}
/**
* 直连
* @param msg
* @param queueName
* @author XiangHan
* @date 2021/9/7 11:10 上午
*/
private
void
sendDirectMessage
(
String
msg
,
String
queueName
)
{
amqpTemplate
.
convertAndSend
(
queueName
,
msg
);
log
.
info
(
"send sendMessage msg || routingkey: {} || msg:{} "
,
queueName
,
msg
);
public
void
sendMessage
(
String
msg
,
String
exchange
,
String
queue
){
if
(
StringUtils
.
isEmpty
(
exchange
))
{
exchange
=
this
.
exchange
;
}
if
(
StringUtils
.
isEmpty
(
queue
))
{
queue
=
this
.
queue
;
}
this
.
sendDirectMessage
(
msg
,
exchange
,
queue
);
}
/**
* 发送
* @param msg
* @author XiangHan
* @date 2021/9/7 11:10 上午
*/
public
void
sendMessage
(
String
msg
)
{
this
.
sendMessage
(
msg
,
null
);
private
void
sendDirectMessage
(
String
msg
,
String
exchange
,
String
queue
)
{
amqpTemplate
.
convertAndSend
(
exchange
,
queue
,
msg
);
log
.
info
(
"send sendMessage msg || exchange: {} || queue: {} || msg:{} "
,
exchange
,
queue
,
msg
);
}
}
...
...
member-service-impl/src/main/resources/config/application-dev.yml
View file @
9585ccf
...
...
@@ -105,14 +105,10 @@ file:
maxSize
:
100
avatarMaxSize
:
5
engine
:
platform
:
management
type
:
service
:
mq
:
exchange
:
uc.direct.management
# 管理侧
routingkey
:
uc.engine.service.direct
# 管理侧
# exchange: uc.direct # 服务侧
# routingkey: uc.engine.management.direct # 服务侧
exchange
:
uce.exchange
# 管理侧
queue
:
uce.queue
# 管理侧
weixin
:
list
:
...
...
member-service-impl/src/main/resources/config/application-prod.yml
deleted
100644 → 0
View file @
e6e3d83
#配置数据源
spring
:
datasource
:
# 测试/演示库
url
:
jdbc:log4jdbc:mysql://172.0.31.10:3306/tj_user?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
username
:
root
password
:
Tjlh@2021
driverClassName
:
net.sf.log4jdbc.sql.jdbcapi.DriverSpy
#Druid
type
:
com.alibaba.druid.pool.DruidDataSource
druid
:
# 初始化配置
initial-size
:
3
# 最小连接数
min-idle
:
3
# 最大连接数
max-active
:
15
# 获取连接超时时间
max-wait
:
5000
# 连接有效性检测时间
time-between-eviction-runs-millis
:
90000
# 最大空闲时间
min-evictable-idle-time-millis
:
1800000
test-while-idle
:
true
test-on-borrow
:
false
test-on-return
:
false
validation-query
:
select 1
# 配置监控统计拦截的filters
filters
:
stat
stat-view-servlet
:
url-pattern
:
/druid/*
reset-enable
:
false
web-stat-filter
:
url-pattern
:
/*
exclusions
:
"
*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"
#配置 Jpa
jpa
:
hibernate
:
# 生产环境设置成 none,避免程序运行时自动更新数据库结构
ddl-auto
:
none
servlet
:
multipart
:
file-size-threshold
:
2KB
max-file-size
:
100MB
max-request-size
:
200MB
redis
:
#数据库索引
database
:
0
host
:
127.0.0.1
port
:
6379
#连接超时时间
timeout
:
5000
rabbitmq
:
host
:
172.0.31.96
# rabbitmq的连接地址
#host: 139.196.192.242 # rabbitmq的连接地址
port
:
5672
# rabbitmq的连接端口号
#virtual-host: /member_center # rabbitmq的虚拟host
#username: member_center # rabbitmq的用户名
#password: Tjlh@2021 # rabbitmq的密码
virtual-host
:
member_center
# rabbitmq的虚拟host
username
:
admin
# rabbitmq的用户名
password
:
Tjlh@2021
# rabbitmq的密码
publisher-confirms
:
true
#如果对异步消息需要回调必须设置为true
#jwt。依赖的common中有需要jwt的部分属性。
jwt
:
header
:
Authorization
secret
:
mySecret
# token 过期时间/毫秒,6小时 1小时 = 3600000 毫秒
expiration
:
7200000
# 在线用户key
online
:
online-token
# 验证码
codeKey
:
code-key
# token 续期检查时间范围(60分钟,单位毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期
detect
:
3600000
# 续期时间,2小时,单位毫秒
renew
:
7200000
#是否允许生成代码,生产环境设置为false
generator
:
enabled
:
true
#是否开启 swagger-ui
swagger
:
enabled
:
true
member-service-impl/src/main/resources/config/application-test.yml
deleted
100644 → 0
View file @
e6e3d83
#配置数据源
spring
:
datasource
:
# 测试/演示库
url
:
jdbc:log4jdbc:mysql://139.196.192.242:3306/tj_user_0819?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
username
:
root
password
:
Tjlh@2017
# url: jdbc:log4jdbc:mysql://122.112.214.149:3306/tj_user?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
# url: jdbc:mysql://122.112.214.149:3306/tj_user?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
# username: root
# password: root
driverClassName
:
net.sf.log4jdbc.sql.jdbcapi.DriverSpy
#Druid
type
:
com.alibaba.druid.pool.DruidDataSource
druid
:
# 初始化配置
initial-size
:
3
# 最小连接数
min-idle
:
3
# 最大连接数
max-active
:
15
# 获取连接超时时间
max-wait
:
5000
# 连接有效性检测时间
time-between-eviction-runs-millis
:
90000
# 最大空闲时间
min-evictable-idle-time-millis
:
1800000
test-while-idle
:
true
test-on-borrow
:
false
test-on-return
:
false
validation-query
:
select 1
# 配置监控统计拦截的filters
filters
:
stat
stat-view-servlet
:
url-pattern
:
/druid/*
reset-enable
:
false
web-stat-filter
:
url-pattern
:
/*
exclusions
:
"
*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"
#配置 Jpa
jpa
:
hibernate
:
# 生产环境设置成 none,避免程序运行时自动更新数据库结构
ddl-auto
:
none
servlet
:
multipart
:
file-size-threshold
:
2KB
max-file-size
:
100MB
max-request-size
:
200MB
redis
:
#数据库索引
database
:
16
host
:
122.112.214.149
# host: 139.196.4.234
port
:
6379
password
:
redis123
# password:
#连接超时时间
timeout
:
5000
rabbitmq
:
host
:
139.196.145.150
# rabbitmq的连接地址
port
:
5672
# rabbitmq的连接端口号
virtual-host
:
member_center
# rabbitmq的虚拟host
username
:
admin
# rabbitmq的用户名
password
:
Topdraw1qaz
# rabbitmq的密码
publisher-confirms
:
true
#如果对异步消息需要回调必须设置为true
#jwt。依赖的common中有需要jwt的部分属性。
jwt
:
header
:
Authorization
secret
:
mySecret
# token 过期时间/毫秒,6小时 1小时 = 3600000 毫秒
expiration
:
7200000
# 在线用户key
online
:
online-token
# 验证码
codeKey
:
code-key
# token 续期检查时间范围(60分钟,单位毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期
detect
:
3600000
# 续期时间,2小时,单位毫秒
renew
:
7200000
#是否允许生成代码,生产环境设置为false
generator
:
enabled
:
true
#是否开启 swagger-ui
swagger
:
enabled
:
true
member-service-impl/src/test/java/com/topdraw/test/business/process/rest/UserOperationControllerTest.java
View file @
9585ccf
...
...
@@ -7,6 +7,7 @@ import com.topdraw.business.module.user.iptv.domain.UserTv;
import
com.topdraw.business.module.user.weixin.domain.UserWeixin
;
import
com.topdraw.business.process.domian.weixin.BindBean
;
import
com.topdraw.business.process.domian.weixin.TvUnBindBean
;
import
com.topdraw.business.process.domian.weixin.WeixinUnBindBean
;
import
com.topdraw.business.process.rest.TaskOperationController
;
import
com.topdraw.business.process.rest.UserOperationController
;
import
com.topdraw.business.process.service.dto.TaskOperationQueryCriteria
;
...
...
@@ -26,9 +27,71 @@ public class UserOperationControllerTest extends BaseTest {
private
UserOperationController
userOperationController
;
@Test
public
void
deleteCollection
()
{
try
{
String
a
=
"{\n"
+
"\t\"platformAccount\": \"topdraw\",\n"
+
"\t\"data\": \"[{\\\"appId\\\":\\\"57\\\",\\\"userId\\\":\\\"5\\\",\\\"type\\\":\\\"1\\\",\\\"name\\\":\\\"PersonalCollectionRecords\\\",\\\"count\\\":\\\"1\\\",\\\"images\\\":\\\"\\\",\\\"userCollectionId\\\":\\\"\\\",\\\"detailFolderCode\\\":\\\"\\\",\\\"detailType\\\":\\\"\\\"},\\\"detailId\\\":\\\"\\\",\\\"detailEpisodeId\\\":\\\"\\\",\\\"detailEpisodeCode\\\":\\\"\\\",\\\"detailName\\\":\\\"\\\",\\\"detailMark\\\":\\\"\\\",\\\"detailImg\\\":\\\"\\\",\\\"detailImg\\\":\\\"\\\",\\\"detailIndex\\\":\\\"\\\",\\\"detailTotalIndex\\\":\\\"\\\",\\\"detailPlayTime\\\":\\\"\\\",\\\"detailTotalTime\\\":\\\"\\\",\\\"detailSequence\\\":\\\"\\\",\\\"detailScore\\\":\\\"\\\",\\\"detailLike\\\":\\\"\\\",\\\"detailExtData\\\":\\\"\\\"}]\"\n"
+
"}"
;
ResultInfo
weixinUserAndMember
=
this
.
userOperationController
.
deleteCollection
(
a
);
System
.
out
.
println
(
weixinUserAndMember
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
@Test
public
void
deleteAllCollection
()
{
try
{
String
a
=
"{\n"
+
"\t\"platformAccount\": \"topdraw\",\n"
+
"\t\"collectionType\": \"1\"\n"
+
"}"
;
ResultInfo
weixinUserAndMember
=
this
.
userOperationController
.
deleteAllCollection
(
a
);
System
.
out
.
println
(
weixinUserAndMember
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
@Test
public
void
addCollection
()
{
try
{
String
a
=
"{\n"
+
"\t\"data\": [\n"
+
"\t{\n"
+
"\t\"app_id\": 57,\n"
+
"\t\"user_id\": 1,\n"
+
"\t\"type\": 1,\n"
+
"\t\"name\": \"PersonalCollectionRecords\",\n"
+
"\t\"count\": 22,\n"
+
"\t\"images\": \"{\\\"map\\\":{\\\"poster\\\":[0]},\\\"list\\\":[{\\\"id\\\":47422,\\\"type\\\":2,\\\"width\\\":222,\\\"height\\\":294,\\\"fileUrl\\\":\\\"upload/image/media/2020-07-30/9a8a02db-9444-4bff-ba54-ea784ae4f88c.jpg\\\",\\\"size\\\":104643}]}\",\n"
+
"\t\"id\": 756756,\n"
+
"\t\"user_collection_id\": 1,\n"
+
"\t\"detail_folder_code\": \"Default\",\n"
+
"\t\"detail_type\": \"MEDIA\",\n"
+
"\t\"detail_id\": 46532,\n"
+
"\t\"detail_code\": \"media_558bc45a-5480-46ec-be9a-c749ffdbdf49\",\n"
+
"\t\"detail_name\": \"熊出没之探险日记2\",\n"
+
"\t\"detail_total_index\": 40,\n"
+
"\t\"detail_sequence\": 1,\n"
+
"\t\"create_time\": 1644503167000,\n"
+
"\t\"update_time\": 1644503167000\n"
+
"\t}\n"
+
"\t],\n"
+
"\t\"platformAccount\": \"topdraw\"\n"
+
"}"
;
ResultInfo
weixinUserAndMember
=
this
.
userOperationController
.
addCollection
(
a
);
System
.
out
.
println
(
weixinUserAndMember
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
@Test
public
void
minaUnbind
()
{
try
{
TvUnBindBean
bindBean
=
new
Tv
UnBindBean
();
WeixinUnBindBean
bindBean
=
new
Weixin
UnBindBean
();
// 小屏会员
bindBean
.
setMemberId
(
4L
);
bindBean
.
setAutoModel
(
true
);
...
...
Please
register
or
sign in
to post a comment