Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yanxuan-wx-store-sharer
Overview
Overview
Details
Activity
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
wx
yanxuan-wx-store-sharer
Commits
4af94a9a
Commit
4af94a9a
authored
Mar 20, 2025
by
fanjiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绑定分佣比例加入日志
parent
5b0cf5bc
Pipeline
#71941
passed with stages
in 1 minute 1 second
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
17 deletions
+21
-17
LoginUserHelper.java
...ase/yanxuan/wx/store/sharer/biz/core/LoginUserHelper.java
+7
-0
UserInterceptor.java
...xuan/wx/store/sharer/biz/interceptor/UserInterceptor.java
+5
-0
UserServiceImpl.java
...uan/wx/store/sharer/biz/service/impl/UserServiceImpl.java
+7
-9
TestController.java
...anxuan/wx/store/sharer/web/controller/TestController.java
+2
-8
No files found.
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/core/LoginUserHelper.java
View file @
4af94a9a
...
@@ -54,4 +54,11 @@ public class LoginUserHelper {
...
@@ -54,4 +54,11 @@ public class LoginUserHelper {
redisClient
.
setStr
(
CoreConstant
.
REDIS_TOKEN_USER_KEY
+
token
,
redisClient
.
setStr
(
CoreConstant
.
REDIS_TOKEN_USER_KEY
+
token
,
JSON
.
toJSONString
(
loginUserInfo
),
CoreConstant
.
REDIS_TOKEN_EXPIRE_SECONDS
);
JSON
.
toJSONString
(
loginUserInfo
),
CoreConstant
.
REDIS_TOKEN_EXPIRE_SECONDS
);
}
}
/**
* 删除用户认证信息
*/
public
void
removeLoginUserInfo
(
String
token
)
{
redisClient
.
delete
(
CoreConstant
.
REDIS_TOKEN_USER_KEY
+
token
);
}
}
}
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/interceptor/UserInterceptor.java
View file @
4af94a9a
...
@@ -6,6 +6,7 @@ import com.netease.yanxuan.wx.store.sharer.biz.core.LoginUserInfo;
...
@@ -6,6 +6,7 @@ import com.netease.yanxuan.wx.store.sharer.biz.core.LoginUserInfo;
import
com.netease.yanxuan.wx.store.sharer.common.constant.CoreConstant
;
import
com.netease.yanxuan.wx.store.sharer.common.constant.CoreConstant
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.servlet.HandlerInterceptor
;
import
org.springframework.web.servlet.HandlerInterceptor
;
...
@@ -29,6 +30,10 @@ public class UserInterceptor implements HandlerInterceptor {
...
@@ -29,6 +30,10 @@ public class UserInterceptor implements HandlerInterceptor {
String
token
=
request
.
getHeader
(
CoreConstant
.
AUTH_HEADER_TOKEN_KEY
);
String
token
=
request
.
getHeader
(
CoreConstant
.
AUTH_HEADER_TOKEN_KEY
);
LoginUserInfo
loginUserInfo
=
loginUserHelper
.
getLoginUserInfo
(
token
);
LoginUserInfo
loginUserInfo
=
loginUserHelper
.
getLoginUserInfo
(
token
);
if
(
null
!=
loginUserInfo
)
{
if
(
null
!=
loginUserInfo
)
{
if
(
StringUtils
.
isBlank
(
loginUserInfo
.
getUnionId
())){
loginUserHelper
.
removeLoginUserInfo
(
token
);
return
true
;
}
// 刷新缓存
// 刷新缓存
loginUserHelper
.
setLoginUserInfo
(
token
,
loginUserInfo
);
loginUserHelper
.
setLoginUserInfo
(
token
,
loginUserInfo
);
LoginUserContextHolder
.
set
(
loginUserInfo
);
LoginUserContextHolder
.
set
(
loginUserInfo
);
...
...
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/service/impl/UserServiceImpl.java
View file @
4af94a9a
package
com
.
netease
.
yanxuan
.
wx
.
store
.
sharer
.
biz
.
service
.
impl
;
package
com
.
netease
.
yanxuan
.
wx
.
store
.
sharer
.
biz
.
service
.
impl
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.Date
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.netease.yanxuan.wx.store.sharer.biz.config.DrmSharerConfig
;
import
com.netease.yanxuan.wx.store.sharer.biz.config.DrmSharerConfig
;
...
@@ -33,9 +25,15 @@ import com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatShare
...
@@ -33,9 +25,15 @@ import com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatShare
import
com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatSharerListVO
;
import
com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatSharerListVO
;
import
com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatSharerRegisterBindVO
;
import
com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatSharerRegisterBindVO
;
import
com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatUserInfoVO
;
import
com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatUserInfoVO
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.Date
;
/**
/**
...
...
yanxuan-wx-store-sharer-web/src/main/java/com/netease/yanxuan/wx/store/sharer/web/controller/TestController.java
View file @
4af94a9a
...
@@ -6,8 +6,7 @@
...
@@ -6,8 +6,7 @@
*/
*/
package
com
.
netease
.
yanxuan
.
wx
.
store
.
sharer
.
web
.
controller
;
package
com
.
netease
.
yanxuan
.
wx
.
store
.
sharer
.
web
.
controller
;
import
com.netease.yanxuan.wx.store.sharer.common.core.Result
;
import
com.netease.yanxuan.wx.store.sharer.biz.core.LoginUserHelper
;
import
com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatUserInfoVO
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -19,10 +18,6 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -19,10 +18,6 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping
(
"/sharer/test"
)
@RequestMapping
(
"/sharer/test"
)
@RequiredArgsConstructor
@RequiredArgsConstructor
public
class
TestController
{
public
class
TestController
{
private
final
LoginUserHelper
loginUserHelper
;
@RequestMapping
(
"/token"
)
public
Result
<
WeChatUserInfoVO
>
token
()
{
return
Result
.
ok
();
}
}
}
\ No newline at end of file
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