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
ee9435be
Commit
ee9435be
authored
Mar 12, 2025
by
fanjiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码初始化
parent
6ce14981
Pipeline
#71440
passed with stages
in 1 minute 13 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
17 deletions
+20
-17
WebConfig.java
...netease/yanxuan/wx/store/sharer/biz/config/WebConfig.java
+1
-1
AuthInterceptor.java
...xuan/wx/store/sharer/biz/interceptor/AuthInterceptor.java
+1
-0
IProductService.java
.../yanxuan/wx/store/sharer/biz/service/IProductService.java
+1
-1
ProductServiceImpl.java
.../wx/store/sharer/biz/service/impl/ProductServiceImpl.java
+14
-12
ProductController.java
...uan/wx/store/sharer/web/controller/ProductController.java
+3
-3
No files found.
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/config/WebConfig.java
View file @
ee9435be
...
@@ -19,7 +19,7 @@ import java.util.Collections;
...
@@ -19,7 +19,7 @@ import java.util.Collections;
public
class
WebConfig
implements
WebMvcConfigurer
{
public
class
WebConfig
implements
WebMvcConfigurer
{
private
final
AuthInterceptor
authInterceptor
;
private
final
AuthInterceptor
authInterceptor
;
private
static
final
String
[]
EXCLUDE_URLS
=
{
"/open/**"
,
"/
product/page/list"
,
"/user/login
"
};
private
static
final
String
[]
EXCLUDE_URLS
=
{
"/open/**"
,
"/
user/login"
,
"/product/page/list
"
};
@Override
@Override
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
...
...
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/interceptor/AuthInterceptor.java
View file @
ee9435be
...
@@ -30,6 +30,7 @@ public class AuthInterceptor implements HandlerInterceptor {
...
@@ -30,6 +30,7 @@ public class AuthInterceptor implements HandlerInterceptor {
@Override
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
{
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
{
log
.
info
(
"AuthInterceptor preHandle execute, url:{}"
,
request
.
getRequestURI
());
String
token
=
request
.
getHeader
(
CoreConstant
.
AUTH_HEADER_TOKEN_KEY
);
String
token
=
request
.
getHeader
(
CoreConstant
.
AUTH_HEADER_TOKEN_KEY
);
if
(
StringUtils
.
isEmpty
(
token
))
{
if
(
StringUtils
.
isEmpty
(
token
))
{
throw
new
NoAuthException
(
"用户认证失败"
);
throw
new
NoAuthException
(
"用户认证失败"
);
...
...
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/service/IProductService.java
View file @
ee9435be
...
@@ -14,5 +14,5 @@ public interface IProductService {
...
@@ -14,5 +14,5 @@ public interface IProductService {
/**
/**
* 获取商品分页列表
* 获取商品分页列表
*/
*/
PageVO
<
ProductListVO
>
getPageList
(
PageQuery
pageQuery
,
String
keyword
);
PageVO
<
ProductListVO
>
getP
roductP
ageList
(
PageQuery
pageQuery
,
String
keyword
);
}
}
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/service/impl/ProductServiceImpl.java
View file @
ee9435be
package
com
.
netease
.
yanxuan
.
wx
.
store
.
sharer
.
biz
.
service
.
impl
;
package
com
.
netease
.
yanxuan
.
wx
.
store
.
sharer
.
biz
.
service
.
impl
;
import
com.netease.yanxuan.wx.store.sharer.biz.config.DrmSharerConfig
;
import
com.netease.yanxuan.wx.store.sharer.biz.core.LoginUserContextHolder
;
import
com.netease.yanxuan.wx.store.sharer.biz.core.LoginUserContextHolder
;
import
com.netease.yanxuan.wx.store.sharer.biz.core.LoginUserInfo
;
import
com.netease.yanxuan.wx.store.sharer.biz.core.LoginUserInfo
;
import
com.netease.yanxuan.wx.store.sharer.biz.meta.model.vo.ProductListVO
;
import
com.netease.yanxuan.wx.store.sharer.biz.meta.model.vo.ProductListVO
;
import
com.netease.yanxuan.wx.store.sharer.biz.meta.page.PageQuery
;
import
com.netease.yanxuan.wx.store.sharer.biz.meta.page.PageQuery
;
import
com.netease.yanxuan.wx.store.sharer.biz.meta.page.PageVO
;
import
com.netease.yanxuan.wx.store.sharer.biz.meta.page.PageVO
;
import
com.netease.yanxuan.wx.store.sharer.biz.service.IProductService
;
import
com.netease.yanxuan.wx.store.sharer.biz.service.IProductService
;
import
com.netease.yanxuan.wx.store.sharer.common.exception.NoAuthException
;
import
com.netease.yanxuan.wx.store.sharer.integration.handler.impl.WeChatPromoteProductDetailRequest
;
import
com.netease.yanxuan.wx.store.sharer.integration.handler.impl.WeChatPromoteProductDetailRequest
;
import
com.netease.yanxuan.wx.store.sharer.integration.handler.impl.WeChatPromoteProductLinkRequest
;
import
com.netease.yanxuan.wx.store.sharer.integration.handler.impl.WeChatPromoteProductLinkRequest
;
import
com.netease.yanxuan.wx.store.sharer.integration.handler.impl.WeChatPromoteProductListRequest
;
import
com.netease.yanxuan.wx.store.sharer.integration.handler.impl.WeChatPromoteProductListRequest
;
...
@@ -14,6 +14,7 @@ import com.netease.yanxuan.wx.store.sharer.integration.handler.impl.WeChatSharer
...
@@ -14,6 +14,7 @@ import com.netease.yanxuan.wx.store.sharer.integration.handler.impl.WeChatSharer
import
com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.*
;
import
com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.*
;
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.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
...
@@ -38,13 +39,10 @@ public class ProductServiceImpl implements IProductService {
...
@@ -38,13 +39,10 @@ public class ProductServiceImpl implements IProductService {
private
final
WeChatPromoteProductDetailRequest
weChatPromoteProductDetailRequest
;
private
final
WeChatPromoteProductDetailRequest
weChatPromoteProductDetailRequest
;
private
final
WeChatPromoteProductLinkRequest
weChatPromoteProductLinkRequest
;
private
final
WeChatPromoteProductLinkRequest
weChatPromoteProductLinkRequest
;
private
final
WeChatSharerListRequest
weChatSharerListRequest
;
private
final
WeChatSharerListRequest
weChatSharerListRequest
;
private
final
DrmSharerConfig
drmSharerConfig
;
@Override
@Override
public
PageVO
<
ProductListVO
>
getPageList
(
PageQuery
pageQuery
,
String
keyword
)
{
public
PageVO
<
ProductListVO
>
getProductPageList
(
PageQuery
pageQuery
,
String
keyword
)
{
LoginUserInfo
loginUserInfo
=
LoginUserContextHolder
.
get
();
if
(
null
==
loginUserInfo
)
{
throw
new
NoAuthException
(
"用户登录状态过期"
);
}
PageVO
<
ProductListVO
>
pageVO
=
new
PageVO
<>();
PageVO
<
ProductListVO
>
pageVO
=
new
PageVO
<>();
WeChatPromoteProductListVO
productListVO
=
weChatPromoteProductListRequest
.
handle
(
keyword
,
WeChatPromoteProductListVO
productListVO
=
weChatPromoteProductListRequest
.
handle
(
keyword
,
pageQuery
.
getNextKey
(),
pageQuery
.
getPageSize
());
pageQuery
.
getNextKey
(),
pageQuery
.
getPageSize
());
...
@@ -79,12 +77,16 @@ public class ProductServiceImpl implements IProductService {
...
@@ -79,12 +77,16 @@ public class ProductServiceImpl implements IProductService {
listVO
.
setPrice
(
price
);
listVO
.
setPrice
(
price
);
// 推客分佣比例
// 推客分佣比例
BigDecimal
commissionRatio
=
null
;
BigDecimal
commissionRatio
=
drmSharerConfig
.
getDefaultCommissionRatio
();
WeChatSharerListVO
sharerListVO
=
weChatSharerListRequest
.
handle
(
loginUserInfo
.
getOpenId
(),
""
,
1
);
// 获取用户信息
if
(
null
!=
sharerListVO
&&
!
CollectionUtils
.
isEmpty
(
sharerListVO
.
getSharer_info_list
()))
{
LoginUserInfo
loginUserInfo
=
LoginUserContextHolder
.
get
();
WeChatSharerInfoVO
sharerInfoVO
=
sharerListVO
.
getSharer_info_list
().
get
(
0
);
if
(
null
!=
loginUserInfo
&&
StringUtils
.
isNotBlank
(
loginUserInfo
.
getOpenId
())){
if
(
null
!=
sharerInfoVO
&&
null
!=
sharerInfoVO
.
getCommission_ratio
())
{
WeChatSharerListVO
sharerListVO
=
weChatSharerListRequest
.
handle
(
loginUserInfo
.
getOpenId
(),
""
,
1
);
commissionRatio
=
sharerInfoVO
.
getCommission_ratio
();
if
(
null
!=
sharerListVO
&&
!
CollectionUtils
.
isEmpty
(
sharerListVO
.
getSharer_info_list
()))
{
WeChatSharerInfoVO
sharerInfoVO
=
sharerListVO
.
getSharer_info_list
().
get
(
0
);
if
(
null
!=
sharerInfoVO
&&
null
!=
sharerInfoVO
.
getCommission_ratio
())
{
commissionRatio
=
sharerInfoVO
.
getCommission_ratio
();
}
}
}
}
}
WeChatPromoteProductDetailVO
.
WeChatPromoteProductVO
.
WeChatPromoteProductCommissionInfoVO
commissionInfo
=
product
.
getCommission_info
();
WeChatPromoteProductDetailVO
.
WeChatPromoteProductVO
.
WeChatPromoteProductCommissionInfoVO
commissionInfo
=
product
.
getCommission_info
();
...
...
yanxuan-wx-store-sharer-web/src/main/java/com/netease/yanxuan/wx/store/sharer/web/controller/ProductController.java
View file @
ee9435be
...
@@ -27,9 +27,9 @@ public class ProductController extends BaseController {
...
@@ -27,9 +27,9 @@ public class ProductController extends BaseController {
* 商品分页列表
* 商品分页列表
*/
*/
@GetMapping
(
"/page/list"
)
@GetMapping
(
"/page/list"
)
public
Result
<
PageVO
>
get
UserInfo
(
PageQuery
pageQuery
,
public
Result
<
PageVO
>
get
ProductPageList
(
PageQuery
pageQuery
,
@RequestParam
(
value
=
"keyword"
,
required
=
false
)
String
keyword
)
{
@RequestParam
(
value
=
"keyword"
,
required
=
false
)
String
keyword
)
{
PageVO
<
ProductListVO
>
pageList
=
iProductService
.
getPageList
(
pageQuery
,
keyword
);
PageVO
<
ProductListVO
>
pageList
=
iProductService
.
getP
roductP
ageList
(
pageQuery
,
keyword
);
return
Result
.
ok
(
pageList
);
return
Result
.
ok
(
pageList
);
}
}
...
...
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