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
b14c1076
Commit
b14c1076
authored
Mar 17, 2025
by
fanjiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新加入获取用户分佣比例接口
parent
68721f58
Pipeline
#71675
passed with stages
in 1 minute 6 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
9 deletions
+55
-9
IProductService.java
.../yanxuan/wx/store/sharer/biz/service/IProductService.java
+12
-0
ProductServiceImpl.java
.../wx/store/sharer/biz/service/impl/ProductServiceImpl.java
+22
-9
ProductController.java
...uan/wx/store/sharer/web/controller/ProductController.java
+21
-0
No files found.
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/service/IProductService.java
View file @
b14c1076
...
...
@@ -4,6 +4,8 @@ import com.netease.yanxuan.wx.store.sharer.biz.meta.model.vo.ProductListVO;
import
com.netease.yanxuan.wx.store.sharer.biz.meta.model.vo.ProductPromotionLinkVO
;
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.integration.meta.model.vo.WeChatGetSharerProductCommissionVO
;
import
com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatSharerListVO
;
/**
* @Description 商品-业务层
...
...
@@ -21,4 +23,14 @@ public interface IProductService {
* 商品分享短链
*/
ProductPromotionLinkVO
getProductPromotionLink
(
String
sharerAppid
,
String
productId
);
/**
* 获取获取机构绑定的推客信息
*/
WeChatSharerListVO
getBindSharerList
(
String
sharerOpenid
);
/**
* 获取推客的某个商品的推广分佣比例
*/
WeChatGetSharerProductCommissionVO
getSharerProductCommissionInfo
(
String
sharerAppid
,
String
productId
);
}
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/service/impl/ProductServiceImpl.java
View file @
b14c1076
...
...
@@ -14,10 +14,7 @@ import com.netease.yanxuan.wx.store.sharer.common.exception.NoBindSharerExceptio
import
com.netease.yanxuan.wx.store.sharer.common.handler.RedisClient
;
import
com.netease.yanxuan.wx.store.sharer.common.util.AsyncUtils
;
import
com.netease.yanxuan.wx.store.sharer.integration.constant.WeChatApi
;
import
com.netease.yanxuan.wx.store.sharer.integration.handler.impl.WeChatShopPromoteProductDetailRequest
;
import
com.netease.yanxuan.wx.store.sharer.integration.handler.impl.WeChatShopPromoteProductLinkRequest
;
import
com.netease.yanxuan.wx.store.sharer.integration.handler.impl.WeChatShopPromoteProductListRequest
;
import
com.netease.yanxuan.wx.store.sharer.integration.handler.impl.WeChatShopSharerListRequest
;
import
com.netease.yanxuan.wx.store.sharer.integration.handler.impl.*
;
import
com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.*
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -27,7 +24,10 @@ import org.springframework.util.CollectionUtils;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Optional
;
import
java.util.concurrent.Executor
;
import
java.util.stream.Collectors
;
...
...
@@ -40,13 +40,15 @@ import java.util.stream.Collectors;
@RequiredArgsConstructor
@Service
public
class
ProductServiceImpl
implements
IProductService
{
private
final
RedisClient
redisClient
;
private
final
DrmSharerConfig
drmSharerConfig
;
private
final
Executor
asyncProductListServiceExecutor
;
private
final
WeChatShopPromoteProductListRequest
weChatShopPromoteProductListRequest
;
private
final
WeChatShopPromoteProductDetailRequest
weChatShopPromoteProductDetailRequest
;
private
final
WeChatShopPromoteProductLinkRequest
weChatShopPromoteProductLinkRequest
;
private
final
WeChatShopSharerListRequest
weChatShopSharerListRequest
;
private
final
DrmSharerConfig
drmSharerConfig
;
private
final
RedisClient
redisClient
;
private
final
Executor
asyncProductListServiceExecutor
;
private
final
WeChatShopGetSharerProductCommissionRequest
weChatShopGetSharerProductCommissionRequest
;
@Override
...
...
@@ -65,7 +67,7 @@ public class ProductServiceImpl implements IProductService {
// 使用异步多线程处理
productList
=
AsyncUtils
.
processListAsync
(
productListVO
.
getProduct_list
(),
item
->
{
WeChatPromoteProductDetailVO
detailVO
=
getProductDetailCache
(
item
.
getShop_appid
(),
item
.
getProduct_id
());
if
(
null
==
detailVO
)
{
if
(
null
==
detailVO
)
{
return
null
;
}
WeChatPromoteProductDetailVO
.
WeChatPromoteProductVO
product
=
detailVO
.
getProduct
();
...
...
@@ -159,6 +161,17 @@ public class ProductServiceImpl implements IProductService {
return
null
;
}
@Override
public
WeChatSharerListVO
getBindSharerList
(
String
sharerOpenid
)
{
return
weChatShopSharerListRequest
.
handle
(
sharerOpenid
,
""
,
1
);
}
@Override
public
WeChatGetSharerProductCommissionVO
getSharerProductCommissionInfo
(
String
sharerAppid
,
String
productId
)
{
return
weChatShopGetSharerProductCommissionRequest
.
handle
(
sharerAppid
,
Long
.
valueOf
(
productId
));
}
/**
* 获取商品详情,并缓存到redis中
*/
...
...
yanxuan-wx-store-sharer-web/src/main/java/com/netease/yanxuan/wx/store/sharer/web/controller/ProductController.java
View file @
b14c1076
...
...
@@ -6,6 +6,8 @@ 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.service.IProductService
;
import
com.netease.yanxuan.wx.store.sharer.common.core.Result
;
import
com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatGetSharerProductCommissionVO
;
import
com.netease.yanxuan.wx.store.sharer.integration.meta.model.vo.WeChatSharerListVO
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -44,4 +46,23 @@ public class ProductController extends BaseController {
ProductPromotionLinkVO
promotionLink
=
iProductService
.
getProductPromotionLink
(
shopAppid
,
productId
);
return
Result
.
ok
(
promotionLink
);
}
/**
* 获取获取机构绑定的推客信息
*/
@GetMapping
(
"/bind/sharer/list"
)
public
Result
<
WeChatSharerListVO
>
getBindSharerList
(
@RequestParam
(
"sharerOpenid"
)
String
sharerOpenid
)
{
WeChatSharerListVO
result
=
iProductService
.
getBindSharerList
(
sharerOpenid
);
return
Result
.
ok
(
result
);
}
/**
* 获取推客的某个商品的推广分佣比例
*/
@GetMapping
(
"/sharer/product/commission"
)
public
Result
<
WeChatGetSharerProductCommissionVO
>
getSharerProductCommissionInfo
(
@RequestParam
(
"sharerAppid"
)
String
sharerAppid
,
@RequestParam
(
"productId"
)
String
productId
)
{
WeChatGetSharerProductCommissionVO
result
=
iProductService
.
getSharerProductCommissionInfo
(
sharerAppid
,
productId
);
return
Result
.
ok
(
result
);
}
}
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