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
9b504cc6
...
9b504cc6e80a7a6e05f955841689f8060ecc32ca
authored
2022-02-21 19:30:27 +0800
by
xianghan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1.添加H5保存redis日志
1 parent
40c05cc7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
7 deletions
member-service-impl/src/main/java/com/topdraw/MemberServiceApplication.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/impl/UserOperationServiceImpl.java
member-service.iml
member-service-impl/src/main/java/com/topdraw/MemberServiceApplication.java
View file @
9b504cc
package
com
.
topdraw
;
import
com.topdraw.config.RedisKeyUtil
;
import
com.topdraw.utils.RedisUtils
;
import
com.topdraw.utils.SpringContextHolder
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
...
...
@@ -16,7 +13,6 @@ import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import
org.springframework.retry.annotation.EnableRetry
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.springframework.web.bind.annotation.CrossOrigin
;
/**
* @author XiangHan
...
...
@@ -43,6 +39,7 @@ public class MemberServiceApplication extends SpringBootServletInitializer {
public
SpringContextHolder
springContextHolder
()
{
return
new
SpringContextHolder
();
}
}
...
...
member-service-impl/src/main/java/com/topdraw/business/process/rest/UserOperationController.java
View file @
9b504cc
...
...
@@ -2,6 +2,7 @@ package com.topdraw.business.process.rest;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.topdraw.annotation.AnonymousAccess
;
import
com.topdraw.business.module.member.profile.domain.MemberProfile
;
...
...
@@ -34,6 +35,8 @@ import io.swagger.annotations.ApiOperation;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.util.Assert
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -235,6 +238,9 @@ public class UserOperationController {
@AnonymousAccess
public
ResultInfo
subscribe
(
@Validated
@RequestBody
SubscribeBeanEvent
data
)
throws
IOException
{
String
content
=
data
.
getContent
();
log
.
info
(
"subscribe content ==>> [{}]"
,
content
);
SubscribeBean
subscribeBean
=
JSONUtil
.
parseMsg2Object
(
content
,
SubscribeBean
.
class
);
this
.
parseSubscribe
(
subscribeBean
);
boolean
result
=
this
.
userTvOperationService
.
subscribe
(
subscribeBean
);
...
...
@@ -323,7 +329,7 @@ public class UserOperationController {
@AnonymousAccess
public
ResultInfo
unsubscribe
(
@Validated
@RequestBody
SubscribeBeanEvent
data
)
{
String
content
=
data
.
getContent
();
log
.
info
(
"content ==>> [{}]"
,
content
);
log
.
info
(
"
unsubscribe
content ==>> [{}]"
,
content
);
SubscribeBean
subscribeBean
=
JSONUtil
.
parseMsg2Object
(
content
,
SubscribeBean
.
class
);
boolean
result
=
this
.
userTvOperationService
.
unsubscribe
(
subscribeBean
);
...
...
@@ -346,6 +352,7 @@ public class UserOperationController {
@AnonymousAccess
public
ResultInfo
saveUserInfo
(
@RequestBody
String
data
)
{
log
.
info
(
"保存大屏侧信息 ===>>> content ==>> [{}]"
,
data
);
Assert
.
notNull
(
data
,
"用户数据不可为空"
);
JSONObject
json
=
JSONObject
.
parseObject
(
data
);
...
...
@@ -367,7 +374,6 @@ public class UserOperationController {
}
}
...
...
member-service-impl/src/main/java/com/topdraw/business/process/service/impl/UserOperationServiceImpl.java
View file @
9b504cc
...
...
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.http.HttpUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.topdraw.aspect.AsyncMqSend
;
import
com.topdraw.business.module.member.domain.Member
;
...
...
@@ -351,6 +352,8 @@ public class UserOperationServiceImpl implements UserOperationService {
@Override
public
String
saveUserInfo
(
String
data
)
{
log
.
info
(
"result ====>> [{}]"
,
data
);
JSONObject
json
=
JSONObject
.
parseObject
(
data
);
String
unionId
=
json
.
getString
(
"unionid"
);
String
result
=
""
;
...
...
@@ -361,6 +364,9 @@ public class UserOperationServiceImpl implements UserOperationService {
// 过期时间300S
this
.
redisUtils
.
set
(
RedisKeyUtil
.
genSeSuSubscribeKey
(
unionId
),
data
,
300
);
Object
o
=
this
.
redisUtils
.
get
(
RedisKeyUtil
.
genSeSuSubscribeKey
(
unionId
));
String
contentJsonStr
=
JSON
.
toJSONString
(
o
);
log
.
info
(
"H5 save in redis contentJsonStr ====>> [{}]"
,
contentJsonStr
);
// 若未传dyAppId。不走下面的流程
if
(
StrUtil
.
isNotBlank
(
appId
))
...
...
@@ -684,6 +690,14 @@ public class UserOperationServiceImpl implements UserOperationService {
userWeixin
.
setAuthTime
(
TimestampUtil
.
now
());
userWeixin
.
setMemberCode
(
memberDTO
.
getCode
());
userWeixin
=
this
.
userWeixinService
.
create
(
userWeixin
);
}
// 避免账户存在但会员不存在的情况
if
(
Objects
.
nonNull
(
userWeixin
.
getId
())
&&
Objects
.
isNull
(
userWeixin
.
getMemberId
())
&&
Objects
.
nonNull
(
userWeixin
.
getUnionid
()))
{
userWeixin
.
setMemberId
(
memberId
);
this
.
userWeixinService
.
update
(
userWeixin
);
}
BeanUtils
.
copyProperties
(
userWeixin
,
userWeixinDTO
);
...
...
@@ -1406,6 +1420,15 @@ public class UserOperationServiceImpl implements UserOperationService {
String
appId
=
resources
.
getAppid
();
String
openId
=
resources
.
getOpenid
();
// if (org.apache.commons.lang3.StringUtils.isBlank(unionId)) {
// TODO 需要商量是否需要创建微信账户
/*UserWeixinDTO userWeixinDTO = this.findUserWeiXinByOpenIdAndAppId(appId, openId);
if (ObjectUtil.isNotEmpty(userWeixinDTO))
return userWeixinDTO;*/
// }
// 小屏账户
UserWeixinDTO
userWeixinDTO
=
this
.
findFirstByUnionIdAndAppIdAndOpenId
(
unionId
,
appId
,
openId
);
...
...
member-service.iml
0 → 100644
View file @
9b504cc
<?xml version="1.0" encoding="UTF-8"?>
<module
org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule=
"true"
type=
"JAVA_MODULE"
version=
"4"
>
<component
name=
"NewModuleRootManager"
LANGUAGE_LEVEL=
"JDK_1_8"
>
<output
url=
"file://$MODULE_DIR$/target/classes"
/>
<output-test
url=
"file://$MODULE_DIR$/target/test-classes"
/>
<content
url=
"file://$MODULE_DIR$"
>
<excludeFolder
url=
"file://$MODULE_DIR$/target"
/>
</content>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
</module>
\ No newline at end of file
Please
register
or
sign in
to post a comment