Browse Source

增加根据店铺获取店铺图标(存的是二维码),

dev
wangfukang 2 years ago
parent
commit
d622e9ec72
  1. 10
      hiver-admin/src/main/resources/application.yml
  2. 16
      hiver-admin/test-output/test-report.html
  3. 50
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopController.java

10
hiver-admin/src/main/resources/application.yml

@ -25,8 +25,8 @@ spring:
timeout-per-shutdown-phase: 10S
# 数据源
datasource:
url: jdbc:mysql://154.8.162.157:3306/hiver_shop?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&allowMultiQueries=true
# url: jdbc:mysql://8.140.198.243:3306/hiver_shop?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&allowMultiQueries=true
# url: jdbc:mysql://154.8.162.157:3306/hiver_shop?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&allowMultiQueries=true
url: jdbc:mysql://8.140.198.243:3306/hiver_shop?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&allowMultiQueries=true
username: reddoor
# Jasypt加密 可到common-utils中找到JasyptUtil加解密工具类生成加密结果 格式为ENC(加密结果) 以下解密结果为123456
password: ENC(Zla4U4+yRLPhicvuX2TmiEgxEpzP4dk8BHzFDEtiEhwLQIIaftZrrEUJZce6efoe)
@ -67,8 +67,8 @@ spring:
ddl-auto: update
# Redis 若设有密码自行添加配置password
redis:
host: 154.8.162.157
# host: 8.140.198.243
# host: 154.8.162.157
host: 8.140.198.243
password: reddoor168
# 数据库索引 默认0
database: 1
@ -332,6 +332,8 @@ ignored:
- /hiver/app/return/get/**
# 根据商品id获取商品子图,分享订单,客户查看商品子图使用
- /hiver/app/productPicture/getProductPictureByProductId
# 根据店铺id获取店铺二维码信息
- /hiver/app/shop/getshopIconById
# # 临时增加
# 限流及黑名单不拦截的路径

16
hiver-admin/test-output/test-report.html

@ -35,7 +35,7 @@
<a href="#"><span class="badge badge-primary">Hiver</span></a>
</li>
<li class="m-r-10">
<a href="#"><span class="badge badge-primary">八月 03, 2024 18:35:09</span></a>
<a href="#"><span class="badge badge-primary">八月 03, 2024 19:26:13</span></a>
</li>
</ul>
</div>
@ -84,7 +84,7 @@
<div class="test-detail">
<span class="meta text-white badge badge-sm"></span>
<p class="name">passTest</p>
<p class="text-sm"><span>18:35:10 下午</span> / <span>0.018 secs</span></p>
<p class="text-sm"><span>19:26:14 下午</span> / <span>0.017 secs</span></p>
</div>
<div class="test-contents d-none">
<div class="detail-head">
@ -92,9 +92,9 @@
<div class="info">
<div class='float-right'><span class='badge badge-default'>#test-id=1</span></div>
<h5 class="test-status text-pass">passTest</h5>
<span class='badge badge-success'>08.03.2024 18:35:10</span>
<span class='badge badge-danger'>08.03.2024 18:35:10</span>
<span class='badge badge-default'>0.018 secs</span>
<span class='badge badge-success'>08.03.2024 19:26:14</span>
<span class='badge badge-danger'>08.03.2024 19:26:14</span>
<span class='badge badge-default'>0.017 secs</span>
</div>
<div class="m-t-10 m-l-5"></div>
</div>
@ -104,7 +104,7 @@
<tbody>
<tr class="event-row">
<td><span class="badge log pass-bg">Pass</span></td>
<td>18:35:10</td>
<td>19:26:14</td>
<td>
Test passed
</td>
@ -128,13 +128,13 @@
<div class="col-md-3">
<div class="card"><div class="card-body">
<p class="m-b-0">Started</p>
<h3>八月 03, 2024 18:35:09</h3>
<h3>八月 03, 2024 19:26:13</h3>
</div></div>
</div>
<div class="col-md-3">
<div class="card"><div class="card-body">
<p class="m-b-0">Ended</p>
<h3>八月 03, 2024 18:35:10</h3>
<h3>八月 03, 2024 19:26:14</h3>
</div></div>
</div>
<div class="col-md-3">

50
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopController.java

@ -254,51 +254,77 @@ public class ShopController {
@RequestMapping(value = "/getShopRebateBalance", method = RequestMethod.POST)
@ApiOperation("获取返佣余额及累计返佣")
public Result getShopRebateBalance(){
final Map<String,String> shopRebateBalance = shopService.getShopRebateBalance();
public Result getShopRebateBalance() {
final Map<String, String> shopRebateBalance = shopService.getShopRebateBalance();
return ResultUtil.data(shopRebateBalance);
}
/**
* 根据店铺id获取店铺信息
* @author 王富康
* @date 2024/7/27
*
* @param id
* @return Result
* @author 王富康
* @date 2024/7/27
*/
@RequestMapping(value = "/getShopInfoById", method = RequestMethod.POST)
@ApiOperation("根据店铺id获取店铺信息")
public Result getShopInfoById(String id){
if(StringUtils.isEmpty(id)){
public Result getShopInfoById(String id) {
if (StringUtils.isEmpty(id)) {
return ResultUtil.error("店铺id不能为空");
}
final Shop shop = shopService.findById(id);
final Shop shop = shopService.findById(id);
return ResultUtil.data(shop);
}
/**
* 更新店铺图标及备注
* @author 王富康
* @date 2024/7/27
*
* @param shop
* @return Result
* @author 王富康
* @date 2024/7/27
*/
@RequestMapping(value = "/updateShopIconAndRemark", method = RequestMethod.POST)
@ApiOperation("更新店铺图标及备注")
public Result updateShopIconAndRemark(@RequestBody Shop shop) {
final String id = shop.getId();
if(StringUtils.isEmpty(id)){
if (StringUtils.isEmpty(id)) {
return ResultUtil.error("店铺id不能为空");
}
final Shop oldShop = shopService.get(id);
// 20240803 不更新店铺图标,可更新店铺地址
if(shop.getShopAddress() != null){
if (shop.getShopAddress() != null) {
oldShop.setShopAddress(shop.getShopAddress());
}
if(shop.getRemark() != null){
if (shop.getRemark() != null) {
oldShop.setRemark(shop.getRemark());
}
shopService.update(oldShop);
return ResultUtil.success("更新成功");
}
/**
* 根据店铺id获取店铺shopIcon二维码信息
*
* @param id
* @return Result
* @author 王富康
* @date 2024/8/3
*/
@RequestMapping(value = "/getshopIconById", method = RequestMethod.POST)
@ApiOperation("根据店铺id获取店铺shopIcon")
public Result getshopIconById(String id) {
if (StringUtils.isEmpty(id)) {
return ResultUtil.error("店铺id不能为空");
}
final Shop shop = shopService.findById(id);
if (shop == null) {
return ResultUtil.error("店铺不存在");
}
if (StringUtils.isEmpty(shop.getShopIcon())) {
return ResultUtil.error("店铺图标不存在");
}
return ResultUtil.data(shop.getShopIcon());
}
}

Loading…
Cancel
Save