2 Commits 7d3264024f ... b9c6fc12e9

Autor SHA1 Mensaje Fecha
  chenguo b9c6fc12e9 Merge remote-tracking branch 'origin/cg_live_dev' into cg_live_dev hace 1 semana
  chenguo 66fe171587 直播点赞、收藏、关注 hace 1 semana
Se han modificado 44 ficheros con 1850 adiciones y 549 borrados
  1. 3 0
      fs-admin/src/main/java/com/fs/live/controller/LiveController.java
  2. 79 0
      fs-admin/src/main/java/com/fs/live/controller/LiveDataController.java
  3. 11 1
      fs-admin/src/main/java/com/fs/live/controller/LiveGoodsController.java
  4. 29 15
      fs-admin/src/main/java/com/fs/live/controller/LiveOrderController.java
  5. 0 103
      fs-admin/src/main/java/com/fs/live/controller/LiveOrderStatusController.java
  6. 103 0
      fs-admin/src/main/java/com/fs/live/controller/LiveUserFavoriteController.java
  7. 103 0
      fs-admin/src/main/java/com/fs/live/controller/LiveUserFollowController.java
  8. 103 0
      fs-admin/src/main/java/com/fs/live/controller/LiveUserLikeController.java
  9. 12 0
      fs-common/src/main/java/com/fs/common/constant/LiveKeysConstant.java
  10. 20 0
      fs-live-app/src/main/java/com/fs/app/task/Task.java
  11. 4 11
      fs-live-app/src/main/java/com/fs/app/websocket/service/WebSocketServer.java
  12. 1 1
      fs-service/src/main/java/com/fs/live/domain/Live.java
  13. 13 0
      fs-service/src/main/java/com/fs/live/domain/LiveData.java
  14. 13 5
      fs-service/src/main/java/com/fs/live/domain/LiveOrder.java
  15. 0 42
      fs-service/src/main/java/com/fs/live/domain/LiveOrderStatus.java
  16. 39 0
      fs-service/src/main/java/com/fs/live/domain/LiveUserFavorite.java
  17. 31 0
      fs-service/src/main/java/com/fs/live/domain/LiveUserFollow.java
  18. 31 0
      fs-service/src/main/java/com/fs/live/domain/LiveUserLike.java
  19. 57 0
      fs-service/src/main/java/com/fs/live/enums/LiveOrderCancleReason.java
  20. 0 36
      fs-service/src/main/java/com/fs/live/enums/LiveOrderStatusEnum.java
  21. 9 7
      fs-service/src/main/java/com/fs/live/mapper/LiveGoodsMapper.java
  22. 0 61
      fs-service/src/main/java/com/fs/live/mapper/LiveOrderStatusMapper.java
  23. 69 0
      fs-service/src/main/java/com/fs/live/mapper/LiveUserFavoriteMapper.java
  24. 65 0
      fs-service/src/main/java/com/fs/live/mapper/LiveUserFollowMapper.java
  25. 63 0
      fs-service/src/main/java/com/fs/live/mapper/LiveUserLikeMapper.java
  26. 11 0
      fs-service/src/main/java/com/fs/live/service/ILiveDataService.java
  27. 10 7
      fs-service/src/main/java/com/fs/live/service/ILiveGoodsService.java
  28. 12 10
      fs-service/src/main/java/com/fs/live/service/ILiveOrderService.java
  29. 0 61
      fs-service/src/main/java/com/fs/live/service/ILiveOrderStatusService.java
  30. 69 0
      fs-service/src/main/java/com/fs/live/service/ILiveUserFavoriteService.java
  31. 66 0
      fs-service/src/main/java/com/fs/live/service/ILiveUserFollowService.java
  32. 63 0
      fs-service/src/main/java/com/fs/live/service/ILiveUserLikeService.java
  33. 139 4
      fs-service/src/main/java/com/fs/live/service/impl/LiveDataServiceImpl.java
  34. 20 7
      fs-service/src/main/java/com/fs/live/service/impl/LiveGoodsServiceImpl.java
  35. 35 16
      fs-service/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java
  36. 0 91
      fs-service/src/main/java/com/fs/live/service/impl/LiveOrderStatusServiceImpl.java
  37. 113 0
      fs-service/src/main/java/com/fs/live/service/impl/LiveUserFavoriteServiceImpl.java
  38. 104 0
      fs-service/src/main/java/com/fs/live/service/impl/LiveUserFollowServiceImpl.java
  39. 99 0
      fs-service/src/main/java/com/fs/live/service/impl/LiveUserLikeServiceImpl.java
  40. 4 0
      fs-service/src/main/resources/mapper/live/LiveGoodsMapper.xml
  41. 0 71
      fs-service/src/main/resources/mapper/live/LiveOrderStatusMapper.xml
  42. 95 0
      fs-service/src/main/resources/mapper/live/LiveUserFavoriteMapper.xml
  43. 79 0
      fs-service/src/main/resources/mapper/live/LiveUserFollowMapper.xml
  44. 73 0
      fs-service/src/main/resources/mapper/live/LiveUserLikeMapper.xml

+ 3 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveController.java

@@ -94,4 +94,7 @@ public class LiveController extends BaseController
     {
         return toAjax(liveService.deleteLiveByLiveIds(liveIds));
     }
+
+
+
 }

+ 79 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveDataController.java

@@ -0,0 +1,79 @@
+package com.fs.live.controller;
+
+import com.fs.common.core.domain.R;
+import com.fs.live.domain.LiveData;
+import com.fs.live.service.ILiveDataService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+import static com.fs.common.utils.SecurityUtils.getUserId;
+
+@RestController
+@RequestMapping("/live/liveData")
+public class LiveDataController {
+
+    @Autowired
+    private ILiveDataService liveDataService;
+
+    /**
+     * 查询直播数据列表
+     * */
+    @GetMapping("/list")
+    public List<LiveData> list(LiveData liveData) {
+        return liveDataService.selectLiveDataList(liveData);
+    }
+
+    /**
+     * 查询直播数据详情
+     * */
+    @GetMapping("/get/{liveId}")
+    public R getLiveData(@PathVariable Long liveId) {
+        return R.ok().put("liveData", liveDataService.selectLiveDataByLiveId(liveId));
+    }
+
+    /**
+     * 点赞
+     * */
+    @GetMapping("/like/{liveId}")
+    public R like(@PathVariable Long liveId) {
+        return R.ok(liveDataService.updateLikeByLiveId(liveId, getUserId()));
+    }
+
+    /**
+     * 收藏
+     * */
+    @GetMapping("/collect/{liveId}")
+    public R collect(@PathVariable Long liveId) {
+        return R.ok(liveDataService.collect(liveId, getUserId()));
+    }
+
+    /**
+     * 关注
+     * */
+    @GetMapping("/follow/{liveId}")
+    public R follow(@PathVariable Long liveId) {
+        return R.ok(liveDataService.follow(liveId, getUserId()));
+    }
+
+    /**
+     * 收藏店铺/店铺商品
+     * */
+    @GetMapping("/collectStore")
+    public R collectStore(Long storeId, Long productId, Long liveId) {
+        return R.ok(liveDataService.collectStore(storeId, productId, liveId, getUserId()));
+    }
+
+    /**
+     * 获取直播内数据
+     * */
+    @GetMapping("/getLiveViewData")
+    public R getLiveViewData(Long liveId) {
+        Map<String,Object> liveViewData =liveDataService.getLiveViewData(liveId);
+        return R.ok(liveViewData);
+    }
+
+
+}

+ 11 - 1
fs-admin/src/main/java/com/fs/live/controller/LiveGoodsController.java

@@ -1,8 +1,9 @@
-package com.fs.live.controller.controller;
+package com.fs.live.controller;
 
 import com.fs.common.annotation.Log;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.poi.ExcelUtil;
@@ -94,4 +95,13 @@ public class LiveGoodsController extends BaseController
     {
         return toAjax(liveGoodsService.deleteLiveGoodsByGoodsIds(goodsIds));
     }
+
+    /**
+     * 获取直播店铺
+     * */
+    @GetMapping("/liveStore/{liveId}")
+    public R liveGoodsStore(@PathVariable Long liveId)
+    {
+        return R.ok().put("store", liveGoodsService.getStoreByLiveId(liveId));
+    }
 }

+ 29 - 15
fs-admin/src/main/java/com/fs/live/controller/LiveOrderController.java

@@ -1,6 +1,7 @@
 package com.fs.live.controller;
 
 import java.util.List;
+import java.util.Map;
 
 import cn.hutool.core.util.StrUtil;
 import com.fs.common.core.domain.R;
@@ -9,6 +10,7 @@ import com.fs.his.domain.FsStoreOrder;
 import com.fs.his.dto.ExpressInfoDTO;
 import com.fs.his.enums.ShipperCodeEnum;
 import com.fs.his.service.IFsExpressService;
+import com.fs.live.enums.LiveOrderCancleReason;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -76,7 +78,7 @@ public class LiveOrderController extends BaseController
      * 获取订单详细信息
      */
     @PreAuthorize("@ss.hasPermi('live:liveOrder:query')")
-    @GetMapping(value = "/{orderId}")
+    @GetMapping(value = "/info/{orderId}")
     public AjaxResult getInfo(@PathVariable("orderId") String orderId)
     {
         return AjaxResult.success(liveOrderService.selectLiveOrderByOrderId(orderId));
@@ -87,10 +89,10 @@ public class LiveOrderController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('live:liveOrder:add')")
     @Log(title = "订单", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody LiveOrder liveOrder)
+    @PostMapping("/create")
+    public R add(@RequestBody LiveOrder liveOrder)
     {
-        return toAjax(liveOrderService.insertLiveOrder(liveOrder));
+        return R.ok().put("data", liveOrderService.insertLiveOrder(liveOrder));
     }
 
     /**
@@ -98,22 +100,12 @@ public class LiveOrderController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('live:liveOrder:edit')")
     @Log(title = "订单", businessType = BusinessType.UPDATE)
-    @PutMapping
+    @PutMapping("/update")
     public AjaxResult edit(@RequestBody LiveOrder liveOrder)
     {
         return toAjax(liveOrderService.updateLiveOrder(liveOrder));
     }
 
-    /**
-     * 删除订单
-     */
-    @PreAuthorize("@ss.hasPermi('live:liveOrder:remove')")
-    @Log(title = "订单", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{orderIds}")
-    public AjaxResult remove(@PathVariable String[] orderIds)
-    {
-        return toAjax(liveOrderService.deleteLiveOrderByOrderIds(orderIds));
-    }
 
     /**
      * 查看物流状态
@@ -153,4 +145,26 @@ public class LiveOrderController extends BaseController
         return R.ok().put("data",expressInfoDTO);
     }
 
+    /**
+     * 支付订单
+     * */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:pay')")
+    @PostMapping(value = "/pay")
+    public void pay(LiveOrder liveOrder)
+    {
+       liveOrderService.handlePay(liveOrder);
+    }
+
+    /**
+     * 取消订单确认
+     * */
+    @GetMapping(value = "/cancelConfirm/{orderId}")
+    public R cancelConfirm(@PathVariable String orderId)
+    {
+        LiveOrder byId = liveOrderService.getById(orderId);
+        List<Map<String, String>> allCodeDescMap = LiveOrderCancleReason.getAllCodeDescMap();
+        return R.ok().put("reason",allCodeDescMap).put("data",byId);
+    }
+
+
 }

+ 0 - 103
fs-admin/src/main/java/com/fs/live/controller/LiveOrderStatusController.java

@@ -1,103 +0,0 @@
-package com.fs.live.controller;
-
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.live.domain.LiveOrderStatus;
-import com.fs.live.service.ILiveOrderStatusService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 订单操作记录Controller
- * 
- * @author fs
- * @date 2025-07-08
- */
-@RestController
-@RequestMapping("/live/liveOrderStatus")
-public class LiveOrderStatusController extends BaseController
-{
-    @Autowired
-    private ILiveOrderStatusService liveOrderStatusService;
-
-    /**
-     * 查询订单操作记录列表
-     */
-    @PreAuthorize("@ss.hasPermi('live:liveOrderStatus:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(LiveOrderStatus liveOrderStatus)
-    {
-        startPage();
-        List<LiveOrderStatus> list = liveOrderStatusService.selectLiveOrderStatusList(liveOrderStatus);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出订单操作记录列表
-     */
-    @PreAuthorize("@ss.hasPermi('live:liveOrderStatus:export')")
-    @Log(title = "订单操作记录", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(LiveOrderStatus liveOrderStatus)
-    {
-        List<LiveOrderStatus> list = liveOrderStatusService.selectLiveOrderStatusList(liveOrderStatus);
-        ExcelUtil<LiveOrderStatus> util = new ExcelUtil<LiveOrderStatus>(LiveOrderStatus.class);
-        return util.exportExcel(list, "订单操作记录数据");
-    }
-
-    /**
-     * 获取订单操作记录详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('live:liveOrderStatus:query')")
-    @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") String id)
-    {
-        return AjaxResult.success(liveOrderStatusService.selectLiveOrderStatusById(id));
-    }
-
-    /**
-     * 新增订单操作记录
-     */
-    @PreAuthorize("@ss.hasPermi('live:liveOrderStatus:add')")
-    @Log(title = "订单操作记录", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody LiveOrderStatus liveOrderStatus)
-    {
-        return toAjax(liveOrderStatusService.insertLiveOrderStatus(liveOrderStatus));
-    }
-
-    /**
-     * 修改订单操作记录
-     */
-    @PreAuthorize("@ss.hasPermi('live:liveOrderStatus:edit')")
-    @Log(title = "订单操作记录", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody LiveOrderStatus liveOrderStatus)
-    {
-        return toAjax(liveOrderStatusService.updateLiveOrderStatus(liveOrderStatus));
-    }
-
-    /**
-     * 删除订单操作记录
-     */
-    @PreAuthorize("@ss.hasPermi('live:liveOrderStatus:remove')")
-    @Log(title = "订单操作记录", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable String[] ids)
-    {
-        return toAjax(liveOrderStatusService.deleteLiveOrderStatusByIds(ids));
-    }
-}

+ 103 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveUserFavoriteController.java

@@ -0,0 +1,103 @@
+package com.fs.live.controller;
+
+import java.util.List;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.enums.BusinessType;
+import com.fs.live.domain.LiveUserFavorite;
+import com.fs.live.service.ILiveUserFavoriteService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 用户直播收藏Controller
+ * 
+ * @author fs
+ * @date 2025-07-11
+ */
+@RestController
+@RequestMapping("/live/liveUserFavorite")
+public class LiveUserFavoriteController extends BaseController
+{
+    @Autowired
+    private ILiveUserFavoriteService liveUserFavoriteService;
+
+    /**
+     * 查询用户直播收藏列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFavorite:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveUserFavorite liveUserFavorite)
+    {
+        startPage();
+        List<LiveUserFavorite> list = liveUserFavoriteService.selectLiveUserFavoriteList(liveUserFavorite);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出用户直播收藏列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFavorite:export')")
+    @Log(title = "用户直播收藏", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveUserFavorite liveUserFavorite)
+    {
+        List<LiveUserFavorite> list = liveUserFavoriteService.selectLiveUserFavoriteList(liveUserFavorite);
+        ExcelUtil<LiveUserFavorite> util = new ExcelUtil<LiveUserFavorite>(LiveUserFavorite.class);
+        return util.exportExcel(list, "用户直播收藏数据");
+    }
+
+    /**
+     * 获取用户直播收藏详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFavorite:query')")
+    @GetMapping(value = "/{favoriteId}")
+    public AjaxResult getInfo(@PathVariable("favoriteId") Long favoriteId)
+    {
+        return AjaxResult.success(liveUserFavoriteService.selectLiveUserFavoriteByFavoriteId(favoriteId));
+    }
+
+    /**
+     * 新增用户直播收藏
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFavorite:add')")
+    @Log(title = "用户直播收藏", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveUserFavorite liveUserFavorite)
+    {
+        return toAjax(liveUserFavoriteService.insertLiveUserFavorite(liveUserFavorite));
+    }
+
+    /**
+     * 修改用户直播收藏
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFavorite:edit')")
+    @Log(title = "用户直播收藏", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveUserFavorite liveUserFavorite)
+    {
+        return toAjax(liveUserFavoriteService.updateLiveUserFavorite(liveUserFavorite));
+    }
+
+    /**
+     * 删除用户直播收藏
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFavorite:remove')")
+    @Log(title = "用户直播收藏", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{favoriteIds}")
+    public AjaxResult remove(@PathVariable Long[] favoriteIds)
+    {
+        return toAjax(liveUserFavoriteService.deleteLiveUserFavoriteByFavoriteIds(favoriteIds));
+    }
+}

+ 103 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveUserFollowController.java

@@ -0,0 +1,103 @@
+package com.fs.live.controller;
+
+import java.util.List;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.enums.BusinessType;
+import com.fs.live.domain.LiveUserFollow;
+import com.fs.live.service.ILiveUserFollowService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 用户直播关注Controller
+ * 
+ * @author fs
+ * @date 2025-07-11
+ */
+@RestController
+@RequestMapping("/live/liveUserFollow")
+public class LiveUserFollowController extends BaseController
+{
+    @Autowired
+    private ILiveUserFollowService liveUserFollowService;
+
+    /**
+     * 查询用户直播关注列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFollow:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveUserFollow liveUserFollow)
+    {
+        startPage();
+        List<LiveUserFollow> list = liveUserFollowService.selectLiveUserFollowList(liveUserFollow);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出用户直播关注列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFollow:export')")
+    @Log(title = "用户直播关注", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveUserFollow liveUserFollow)
+    {
+        List<LiveUserFollow> list = liveUserFollowService.selectLiveUserFollowList(liveUserFollow);
+        ExcelUtil<LiveUserFollow> util = new ExcelUtil<LiveUserFollow>(LiveUserFollow.class);
+        return util.exportExcel(list, "用户直播关注数据");
+    }
+
+    /**
+     * 获取用户直播关注详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFollow:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(liveUserFollowService.selectLiveUserFollowById(id));
+    }
+
+    /**
+     * 新增用户直播关注
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFollow:add')")
+    @Log(title = "用户直播关注", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveUserFollow liveUserFollow)
+    {
+        return toAjax(liveUserFollowService.insertLiveUserFollow(liveUserFollow));
+    }
+
+    /**
+     * 修改用户直播关注
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFollow:edit')")
+    @Log(title = "用户直播关注", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveUserFollow liveUserFollow)
+    {
+        return toAjax(liveUserFollowService.updateLiveUserFollow(liveUserFollow));
+    }
+
+    /**
+     * 删除用户直播关注
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserFollow:remove')")
+    @Log(title = "用户直播关注", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveUserFollowService.deleteLiveUserFollowByIds(ids));
+    }
+}

+ 103 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveUserLikeController.java

@@ -0,0 +1,103 @@
+package com.fs.live.controller;
+
+import java.util.List;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.enums.BusinessType;
+import com.fs.live.domain.LiveUserLike;
+import com.fs.live.service.ILiveUserLikeService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 用户直播赞Controller
+ * 
+ * @author fs
+ * @date 2025-07-11
+ */
+@RestController
+@RequestMapping("/live/liveUserLike")
+public class LiveUserLikeController extends BaseController
+{
+    @Autowired
+    private ILiveUserLikeService liveUserLikeService;
+
+    /**
+     * 查询用户直播赞列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLike:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(LiveUserLike liveUserLike)
+    {
+        startPage();
+        List<LiveUserLike> list = liveUserLikeService.selectLiveUserLikeList(liveUserLike);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出用户直播赞列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLike:export')")
+    @Log(title = "用户直播赞", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(LiveUserLike liveUserLike)
+    {
+        List<LiveUserLike> list = liveUserLikeService.selectLiveUserLikeList(liveUserLike);
+        ExcelUtil<LiveUserLike> util = new ExcelUtil<LiveUserLike>(LiveUserLike.class);
+        return util.exportExcel(list, "用户直播赞数据");
+    }
+
+    /**
+     * 获取用户直播赞详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLike:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(liveUserLikeService.selectLiveUserLikeById(id));
+    }
+
+    /**
+     * 新增用户直播赞
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLike:add')")
+    @Log(title = "用户直播赞", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LiveUserLike liveUserLike)
+    {
+        return toAjax(liveUserLikeService.insertLiveUserLike(liveUserLike));
+    }
+
+    /**
+     * 修改用户直播赞
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLike:edit')")
+    @Log(title = "用户直播赞", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LiveUserLike liveUserLike)
+    {
+        return toAjax(liveUserLikeService.updateLiveUserLike(liveUserLike));
+    }
+
+    /**
+     * 删除用户直播赞
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveUserLike:remove')")
+    @Log(title = "用户直播赞", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(liveUserLikeService.deleteLiveUserLikeByIds(ids));
+    }
+}

+ 12 - 0
fs-common/src/main/java/com/fs/common/constant/LiveKeysConstant.java

@@ -0,0 +1,12 @@
+package com.fs.common.constant;
+
+public class LiveKeysConstant {
+
+    public static final String USER_VISIT_KEY = "live:user:visit:";  // 用户访问标识用于判断是否是首次访问
+    public static final String UNIQUE_VISITORS_KEY = "live:unique:visitors:";  //访客数
+    public static final String UNIQUE_VIEWERS_KEY = "live:unique:viewers:";  //累计观看人数
+    public static final String PAGE_VIEWS_KEY = "live:page:views:";  //浏览量
+    public static final String TOTAL_VIEWS_KEY = "live:total:views:";  //累计观看人次
+    public static final String MAX_ONLINE_USERS_KEY = "live:max:online:"; //最大在线人数
+    public static final String ONLINE_USERS_KEY = "live:online:users:";  //当前在线人数
+}

+ 20 - 0
fs-live-app/src/main/java/com/fs/app/task/Task.java

@@ -1,7 +1,11 @@
 package com.fs.app.task;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.fs.common.core.redis.RedisCache;
+import com.fs.common.utils.spring.SpringUtils;
 import com.fs.live.domain.Live;
+import com.fs.live.domain.LiveData;
+import com.fs.live.service.ILiveDataService;
 import com.fs.live.service.ILiveService;
 import lombok.AllArgsConstructor;
 import org.springframework.scheduling.annotation.Scheduled;
@@ -16,6 +20,10 @@ public class Task {
 
     private final ILiveService liveService;
 
+    private final ILiveDataService liveDataService;
+
+    private final RedisCache redisCache;
+
     @Scheduled(cron = "0 0/1 * * * ?")
     public void selectSopUserLogsListByTime() {
         LocalDateTime now = LocalDateTime.now();
@@ -33,4 +41,16 @@ public class Task {
             liveService.updateBatchById(list);
         }
     }
+    /**
+     *同步点赞数据到数据库
+     */
+    @Scheduled(cron = "0 0/1 * * * ?")
+    public void syncLikeData() {
+        List<LiveData>  liveDatas = liveDataService.selectLiveDataList(new LiveData());
+        liveDatas.forEach(liveData ->
+                liveData.setLikes(redisCache.getCacheObject("live:like:" + liveData.getLiveId())));
+        if(!liveDatas.isEmpty())
+            liveDataService.updateBatchById(liveDatas);
+    }
+
 }

+ 4 - 11
fs-live-app/src/main/java/com/fs/app/websocket/service/WebSocketServer.java

@@ -2,13 +2,11 @@ package com.fs.app.websocket.service;
 
 
 import com.alibaba.fastjson.JSONObject;
-import com.fs.app.config.ProductionWordFilter;
 import com.fs.app.websocket.auth.WebSocketConfigurator;
 import com.fs.app.websocket.bean.SendMsgVo;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.common.exception.base.BaseException;
-import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.spring.SpringUtils;
 import com.fs.his.domain.FsUser;
 import com.fs.his.service.IFsUserService;
@@ -18,7 +16,6 @@ import com.fs.live.domain.LiveWatchUser;
 import com.fs.live.service.*;
 import com.fs.live.vo.LiveWatchUserVO;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -30,6 +27,8 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.TimeUnit;
 
+import static com.fs.common.constant.LiveKeysConstant.*;
+
 @ServerEndpoint(value = "/app/webSocket",configurator = WebSocketConfigurator.class)
 @Component
 @Slf4j
@@ -49,13 +48,7 @@ public class WebSocketServer {
     // 直播间在线用户缓存
     //private static final ConcurrentHashMap<Long, Integer> liveOnlineUsers = new ConcurrentHashMap<>();
 
-    private static final String USER_VISIT_KEY = "live:user:visit:";  // 用户访问标识用于判断是否是首次访问
-    private static final String UNIQUE_VISITORS_KEY = "live:unique:visitors:";  //访客数
-    private static final String UNIQUE_VIEWERS_KEY = "live:unique:viewers:";  //累计观看人数
-    private static final String PAGE_VIEWS_KEY = "live:page:views:";  //浏览量
-    private static final String TOTAL_VIEWS_KEY = "live:total:views:";  //累计观看人次
-    private static final String MAX_ONLINE_USERS_KEY = "live:max:online:"; //最大在线人数
-    private static final String ONLINE_USERS_KEY = "live:online:users:";  //当前在线人数
+
     //建立连接成功调用
     @OnOpen
     public void onOpen(Session session) {
@@ -205,7 +198,7 @@ public class WebSocketServer {
                     if (userType == 0) {
                         LiveWatchUser liveWatchUser = liveWatchUserService.getByLiveIdAndUserId(msg.getLiveId(), msg.getUserId());
                         if(liveWatchUser.getMsgStatus() == 1){
-                            sendMessage(session, JSONObject.toJSONString(R.error("你被禁言")));
+                            sendMessage(session, JSONObject.toJSONString(R.error("你被禁言")));
                             return;
                         }
 

+ 1 - 1
fs-service/src/main/java/com/fs/live/domain/Live.java

@@ -53,7 +53,7 @@ public class Live extends BaseEntity {
     private Integer showType;
 
     /** 1待支付 2直播中 3已结束 */
-    @Excel(name = "1待支付 2直播中 3已结束")
+    @Excel(name = "1未开播 2直播中 3已结束")
     private Integer status;
 
     /** 直播ID */

+ 13 - 0
fs-service/src/main/java/com/fs/live/domain/LiveData.java

@@ -67,4 +67,17 @@ public class LiveData extends BaseEntity{
     private Long peakConcurrentViewers;
 
 
+    /** 点赞数 */
+    @Excel(name = "点赞数")
+    private Long likes;
+
+    /** 收藏数*/
+    @Excel(name = "收藏数")
+    private Long favourite_num;
+
+    /** 关注数*/
+    @Excel(name = "关注数")
+    private Long follow_num;
+
+
 }

+ 13 - 5
fs-service/src/main/java/com/fs/live/domain/LiveOrder.java

@@ -2,6 +2,9 @@ package com.fs.live.domain;
 
 import java.math.BigDecimal;
 import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fs.common.annotation.Excel;
@@ -16,18 +19,19 @@ import lombok.EqualsAndHashCode;
  * @date 2025-07-08
  */
 @Data
-@EqualsAndHashCode(callSuper = true)
-public class LiveOrder extends BaseEntity{
+@TableName("live_order")
+public class LiveOrder{
 
     /** 订单ID */
-    private String orderId;
+    @TableId(type= IdType.AUTO)
+    private Long orderId;
 
     /** 直播ID */
     @Excel(name = "直播ID")
     private Long liveId;
 
     /** $column.columnComment */
-    @Excel(name = "直播ID")
+    @Excel(name = "店铺ID")
     private Long storeId;
 
     /** 订单号 */
@@ -74,6 +78,10 @@ public class LiveOrder extends BaseEntity{
     @Excel(name = "支付状态 待支付 1已支付")
     private String isPay;
 
+    /** 取消理由*/
+    @Excel(name = "取消理由")
+    private String cancelReason;
+
     /** 支付时间 */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd")
@@ -83,7 +91,7 @@ public class LiveOrder extends BaseEntity{
     @Excel(name = "支付方式 1微信")
     private String payType;
 
-    /** 订单状态(-1 : 申请退款 -2 : 退货成功 1:待支付 2:待发货;3:待收货;4:待评价;5:已完成) */
+    /** 订单状态(-1 : 申请退款 -2 : 退货成功 0:已取消 1:待支付 2:待发货;3:待收货;4:待评价;5:已完成) */
     @Excel(name = "订单状态", readConverterExp = "-=1,:=,申=请退款,-=2,:=,退=货成功,1=:待支付,2=:待发货;3:待收货;4:待评价;5:已完成")
     private Integer status;
 

+ 0 - 42
fs-service/src/main/java/com/fs/live/domain/LiveOrderStatus.java

@@ -1,42 +0,0 @@
-package com.fs.live.domain;
-
-import java.util.Date;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.fs.common.annotation.Excel;
-import lombok.Data;
-import com.fs.common.core.domain.BaseEntity;
-import lombok.EqualsAndHashCode;
-
-/**
- * 订单操作记录对象 live_order_status
- *
- * @author fs
- * @date 2025-07-08
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-public class LiveOrderStatus extends BaseEntity{
-
-    /** $column.columnComment */
-    private String id;
-
-    /** 订单id */
-    @Excel(name = "订单id")
-    private String orderId;
-
-    /** 操作类型 */
-    @Excel(name = "操作类型")
-    private String changeType;
-
-    /** 操作备注 */
-    @Excel(name = "操作备注")
-    private String changeMessage;
-
-    /** 操作时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
-    private Date changeTime;
-
-
-}

+ 39 - 0
fs-service/src/main/java/com/fs/live/domain/LiveUserFavorite.java

@@ -0,0 +1,39 @@
+package com.fs.live.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 用户直播收藏对象 live_user_favorite
+ *
+ * @author fs
+ * @date 2025-07-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class LiveUserFavorite extends BaseEntity{
+
+    /** 收藏id */
+    private Long favoriteId;
+
+    /** 用户id */
+    @Excel(name = "用户id")
+    private Long userId;
+
+    /** 课程id */
+    @Excel(name = "课程id")
+    private Long liveId;
+
+    /** 店铺id*/
+    @Excel(name = "店铺id")
+    private Long storeId;
+
+    /** 商品id*/
+    @Excel(name = "商品id")
+    private Long productId;
+
+
+}

+ 31 - 0
fs-service/src/main/java/com/fs/live/domain/LiveUserFollow.java

@@ -0,0 +1,31 @@
+package com.fs.live.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 用户直播关注对象 live_user_follow
+ *
+ * @author fs
+ * @date 2025-07-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class LiveUserFollow extends BaseEntity{
+
+    /** 关注id */
+    private Long id;
+
+    /** 用户id */
+    @Excel(name = "用户id")
+    private Long userId;
+
+    /** 直播id */
+    @Excel(name = "直播id")
+    private Long liveId;
+
+
+}

+ 31 - 0
fs-service/src/main/java/com/fs/live/domain/LiveUserLike.java

@@ -0,0 +1,31 @@
+package com.fs.live.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 用户直播赞对象 live_user_like
+ *
+ * @author fs
+ * @date 2025-07-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class LiveUserLike extends BaseEntity{
+
+    /** 点赞id */
+    private Long id;
+
+    /** 用户id */
+    @Excel(name = "用户id")
+    private Long userId;
+
+    /** 直播id */
+    @Excel(name = "直播id")
+    private Long liveId;
+
+
+}

+ 57 - 0
fs-service/src/main/java/com/fs/live/enums/LiveOrderCancleReason.java

@@ -0,0 +1,57 @@
+package com.fs.live.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Getter
+@AllArgsConstructor
+public enum LiveOrderCancleReason {
+
+    //不小心点错商品/数量
+//发现更便宜的渠道
+//优惠券未生效
+//想等折扣再买
+//重复下单
+//不需要了
+//找到更好的替代品
+//家人/朋友已帮忙购买
+//客服沟通不畅
+//发现商品差评较多
+    REASON_1("1", "不小心点错商品/数量"),
+    REASON_2("2", "发现更便宜的渠道"),
+    REASON_3("3", "优惠券未生效"),
+    REASON_4("4", "想等折扣再买"),
+    REASON_5("5", "重复下单"),
+    REASON_6("6", "不需要了"),
+    REASON_7("7", "找到更好的替代品"),
+    REASON_8("8", "家人/朋友已帮忙购买"),
+    REASON_9("9", "客服沟通不畅"),
+    REASON_10("10", "发现商品差评较多");
+
+    private final String code;
+    private final String desc;
+
+
+    public static String getDescByCode(String code) {
+        for (LiveOrderCancleReason reason : values()) {
+            if (reason.getCode().equals(code)) {
+                return reason.getDesc();
+            }
+        }
+        return null;
+    }
+
+
+    //返回所有code:desc的map集合
+    public static List<Map<String, String>> getAllCodeDescMap() {
+        return Arrays.stream(values())
+                .map(reason -> new HashMap<String, String>() {{
+                    put("code", reason.getCode());
+                    put("desc", reason.getDesc());
+                }})
+                .collect(Collectors.toList());
+    }
+}

+ 0 - 36
fs-service/src/main/java/com/fs/live/enums/LiveOrderStatusEnum.java

@@ -1,36 +0,0 @@
-package com.fs.live.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-
-import java.util.stream.Stream;
-
-@Getter
-@NoArgsConstructor
-@AllArgsConstructor
-public enum LiveOrderStatusEnum {
-    STATUS_NE1(-1,"申请退款"),
-    STATUS_NE2(-2,"退货成功"),
-    STATUS_NE3(-3,"已取消"),
-    STATUS_1(1,"待支付"),
-    STATUS_2(2,"待发货"),
-    STATUS_3(3,"待收货"),
-    STATUS_4(4,"已完成"),
-
-    REFUND_STATUS_0(0,"正常"),
-    REFUND_STATUS_1(1,"退款中"),
-    REFUND_STATUS_2(2,"已退款");
-
-
-
-    private Integer value;
-    private String desc;
-
-    public static LiveOrderStatusEnum toType(int value) {
-        return Stream.of(LiveOrderStatusEnum.values())
-                .filter(p -> p.value == value)
-                .findAny()
-                .orElse(null);
-    }
-}

+ 9 - 7
fs-service/src/main/java/com/fs/live/mapper/LiveGoodsMapper.java

@@ -6,14 +6,14 @@ import com.fs.live.domain.LiveGoods;
 
 /**
  * 直播商品Mapper接口
- * 
+ *
  * @author fs
  * @date 2025-07-08
  */
 public interface LiveGoodsMapper extends BaseMapper<LiveGoods>{
     /**
      * 查询直播商品
-     * 
+     *
      * @param goodsId 直播商品主键
      * @return 直播商品
      */
@@ -21,7 +21,7 @@ public interface LiveGoodsMapper extends BaseMapper<LiveGoods>{
 
     /**
      * 查询直播商品列表
-     * 
+     *
      * @param liveGoods 直播商品
      * @return 直播商品集合
      */
@@ -29,7 +29,7 @@ public interface LiveGoodsMapper extends BaseMapper<LiveGoods>{
 
     /**
      * 新增直播商品
-     * 
+     *
      * @param liveGoods 直播商品
      * @return 结果
      */
@@ -37,7 +37,7 @@ public interface LiveGoodsMapper extends BaseMapper<LiveGoods>{
 
     /**
      * 修改直播商品
-     * 
+     *
      * @param liveGoods 直播商品
      * @return 结果
      */
@@ -45,7 +45,7 @@ public interface LiveGoodsMapper extends BaseMapper<LiveGoods>{
 
     /**
      * 删除直播商品
-     * 
+     *
      * @param goodsId 直播商品主键
      * @return 结果
      */
@@ -53,9 +53,11 @@ public interface LiveGoodsMapper extends BaseMapper<LiveGoods>{
 
     /**
      * 批量删除直播商品
-     * 
+     *
      * @param goodsIds 需要删除的数据主键集合
      * @return 结果
      */
     int deleteLiveGoodsByGoodsIds(Long[] goodsIds);
+
+    Long selectStoreIdByLiveId(Long liveId);
 }

+ 0 - 61
fs-service/src/main/java/com/fs/live/mapper/LiveOrderStatusMapper.java

@@ -1,61 +0,0 @@
-package com.fs.live.mapper;
-
-import java.util.List;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.fs.live.domain.LiveOrderStatus;
-
-/**
- * 订单操作记录Mapper接口
- * 
- * @author fs
- * @date 2025-07-08
- */
-public interface LiveOrderStatusMapper extends BaseMapper<LiveOrderStatus>{
-    /**
-     * 查询订单操作记录
-     * 
-     * @param id 订单操作记录主键
-     * @return 订单操作记录
-     */
-    LiveOrderStatus selectLiveOrderStatusById(String id);
-
-    /**
-     * 查询订单操作记录列表
-     * 
-     * @param liveOrderStatus 订单操作记录
-     * @return 订单操作记录集合
-     */
-    List<LiveOrderStatus> selectLiveOrderStatusList(LiveOrderStatus liveOrderStatus);
-
-    /**
-     * 新增订单操作记录
-     * 
-     * @param liveOrderStatus 订单操作记录
-     * @return 结果
-     */
-    int insertLiveOrderStatus(LiveOrderStatus liveOrderStatus);
-
-    /**
-     * 修改订单操作记录
-     * 
-     * @param liveOrderStatus 订单操作记录
-     * @return 结果
-     */
-    int updateLiveOrderStatus(LiveOrderStatus liveOrderStatus);
-
-    /**
-     * 删除订单操作记录
-     * 
-     * @param id 订单操作记录主键
-     * @return 结果
-     */
-    int deleteLiveOrderStatusById(String id);
-
-    /**
-     * 批量删除订单操作记录
-     * 
-     * @param ids 需要删除的数据主键集合
-     * @return 结果
-     */
-    int deleteLiveOrderStatusByIds(String[] ids);
-}

+ 69 - 0
fs-service/src/main/java/com/fs/live/mapper/LiveUserFavoriteMapper.java

@@ -0,0 +1,69 @@
+package com.fs.live.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.live.domain.LiveUserFavorite;
+
+/**
+ * 用户直播收藏Mapper接口
+ *
+ * @author fs
+ * @date 2025-07-11
+ */
+public interface LiveUserFavoriteMapper extends BaseMapper<LiveUserFavorite>{
+    /**
+     * 查询用户直播收藏
+     *
+     * @param favoriteId 用户直播收藏主键
+     * @return 用户直播收藏
+     */
+    LiveUserFavorite selectLiveUserFavoriteByFavoriteId(Long favoriteId);
+
+    /**
+     * 查询用户直播收藏列表
+     *
+     * @param liveUserFavorite 用户直播收藏
+     * @return 用户直播收藏集合
+     */
+    List<LiveUserFavorite> selectLiveUserFavoriteList(LiveUserFavorite liveUserFavorite);
+
+    /**
+     * 新增用户直播收藏
+     *
+     * @param liveUserFavorite 用户直播收藏
+     * @return 结果
+     */
+    int insertLiveUserFavorite(LiveUserFavorite liveUserFavorite);
+
+    /**
+     * 修改用户直播收藏
+     *
+     * @param liveUserFavorite 用户直播收藏
+     * @return 结果
+     */
+    int updateLiveUserFavorite(LiveUserFavorite liveUserFavorite);
+
+    /**
+     * 删除用户直播收藏
+     *
+     * @param favoriteId 用户直播收藏主键
+     * @return 结果
+     */
+    int deleteLiveUserFavoriteByFavoriteId(Long favoriteId);
+
+    /**
+     * 批量删除用户直播收藏
+     *
+     * @param favoriteIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteLiveUserFavoriteByFavoriteIds(Long[] favoriteIds);
+
+    LiveUserFavorite selectLiveUserFavoriteByLiveIdAndUserId(Long liveId, Long userId);
+
+    void deleteLiveUserFavoriteByLiveIdAndUserId(Long liveId, Long userId);
+
+    LiveUserFavorite selectByIds(Long productId, Long storeId, Long liveId, Long userId);
+
+    void deleteLiveUserFavoriteByIds(Long productId, Long storeId, Long liveId, Long userId);
+}

+ 65 - 0
fs-service/src/main/java/com/fs/live/mapper/LiveUserFollowMapper.java

@@ -0,0 +1,65 @@
+package com.fs.live.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.live.domain.LiveUserFollow;
+
+/**
+ * 用户直播关注Mapper接口
+ *
+ * @author fs
+ * @date 2025-07-11
+ */
+public interface LiveUserFollowMapper extends BaseMapper<LiveUserFollow>{
+    /**
+     * 查询用户直播关注
+     *
+     * @param id 用户直播关注主键
+     * @return 用户直播关注
+     */
+    LiveUserFollow selectLiveUserFollowById(Long id);
+
+    /**
+     * 查询用户直播关注列表
+     *
+     * @param liveUserFollow 用户直播关注
+     * @return 用户直播关注集合
+     */
+    List<LiveUserFollow> selectLiveUserFollowList(LiveUserFollow liveUserFollow);
+
+    /**
+     * 新增用户直播关注
+     *
+     * @param liveUserFollow 用户直播关注
+     * @return 结果
+     */
+    int insertLiveUserFollow(LiveUserFollow liveUserFollow);
+
+    /**
+     * 修改用户直播关注
+     *
+     * @param liveUserFollow 用户直播关注
+     * @return 结果
+     */
+    int updateLiveUserFollow(LiveUserFollow liveUserFollow);
+
+    /**
+     * 删除用户直播关注
+     *
+     * @param id 用户直播关注主键
+     * @return 结果
+     */
+    int deleteLiveUserFollowById(Long id);
+
+    /**
+     * 批量删除用户直播关注
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteLiveUserFollowByIds(Long[] ids);
+
+    LiveUserFollow selectLiveUserFollowByLiveIdAndUserId(Long liveId, Long userId);
+
+    void deleteLiveUserFollowByLiveIdAndUserId(Long liveId, Long userId);
+}

+ 63 - 0
fs-service/src/main/java/com/fs/live/mapper/LiveUserLikeMapper.java

@@ -0,0 +1,63 @@
+package com.fs.live.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.live.domain.LiveUserLike;
+
+/**
+ * 用户直播赞Mapper接口
+ *
+ * @author fs
+ * @date 2025-07-11
+ */
+public interface LiveUserLikeMapper extends BaseMapper<LiveUserLike>{
+    /**
+     * 查询用户直播赞
+     *
+     * @param id 用户直播赞主键
+     * @return 用户直播赞
+     */
+    LiveUserLike selectLiveUserLikeById(Long id);
+
+    /**
+     * 查询用户直播赞列表
+     *
+     * @param liveUserLike 用户直播赞
+     * @return 用户直播赞集合
+     */
+    List<LiveUserLike> selectLiveUserLikeList(LiveUserLike liveUserLike);
+
+    /**
+     * 新增用户直播赞
+     *
+     * @param liveUserLike 用户直播赞
+     * @return 结果
+     */
+    int insertLiveUserLike(LiveUserLike liveUserLike);
+
+    /**
+     * 修改用户直播赞
+     *
+     * @param liveUserLike 用户直播赞
+     * @return 结果
+     */
+    int updateLiveUserLike(LiveUserLike liveUserLike);
+
+    /**
+     * 删除用户直播赞
+     *
+     * @param id 用户直播赞主键
+     * @return 结果
+     */
+    int deleteLiveUserLikeById(Long id);
+
+    /**
+     * 批量删除用户直播赞
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteLiveUserLikeByIds(Long[] ids);
+
+    LiveUserLike selectLiveUserLikeByIds(Long liveId, Long userId);
+}

+ 11 - 0
fs-service/src/main/java/com/fs/live/service/ILiveDataService.java

@@ -7,6 +7,7 @@ import com.fs.live.vo.RecentLiveDataVo;
 import com.fs.live.vo.TrendDataVO;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 直播数据Service接口
@@ -96,4 +97,14 @@ public interface ILiveDataService extends IService<LiveData>{
     /*List<ColumnsConfigVo> getColumnsConfig(String userId);*/
 
     void saveColumnsConfig(String userId, List<ColumnsConfigVo> columns);
+
+    String updateLikeByLiveId(Long liveId, Long userId);
+
+    String collect(Long liveId, Long userId);
+
+    String follow(Long liveId, Long userId);
+
+    String collectStore(Long storeId, Long productId, Long liveId, Long userId);
+
+    Map<String, Object> getLiveViewData(Long liveId);
 }

+ 10 - 7
fs-service/src/main/java/com/fs/live/service/ILiveGoodsService.java

@@ -2,18 +2,19 @@ package com.fs.live.service;
 
 import java.util.List;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.his.domain.FsStore;
 import com.fs.live.domain.LiveGoods;
 
 /**
  * 直播商品Service接口
- * 
+ *
  * @author fs
  * @date 2025-07-08
  */
 public interface ILiveGoodsService extends IService<LiveGoods>{
     /**
      * 查询直播商品
-     * 
+     *
      * @param goodsId 直播商品主键
      * @return 直播商品
      */
@@ -21,7 +22,7 @@ public interface ILiveGoodsService extends IService<LiveGoods>{
 
     /**
      * 查询直播商品列表
-     * 
+     *
      * @param liveGoods 直播商品
      * @return 直播商品集合
      */
@@ -29,7 +30,7 @@ public interface ILiveGoodsService extends IService<LiveGoods>{
 
     /**
      * 新增直播商品
-     * 
+     *
      * @param liveGoods 直播商品
      * @return 结果
      */
@@ -37,7 +38,7 @@ public interface ILiveGoodsService extends IService<LiveGoods>{
 
     /**
      * 修改直播商品
-     * 
+     *
      * @param liveGoods 直播商品
      * @return 结果
      */
@@ -45,7 +46,7 @@ public interface ILiveGoodsService extends IService<LiveGoods>{
 
     /**
      * 批量删除直播商品
-     * 
+     *
      * @param goodsIds 需要删除的直播商品主键集合
      * @return 结果
      */
@@ -53,9 +54,11 @@ public interface ILiveGoodsService extends IService<LiveGoods>{
 
     /**
      * 删除直播商品信息
-     * 
+     *
      * @param goodsId 直播商品主键
      * @return 结果
      */
     int deleteLiveGoodsByGoodsId(Long goodsId);
+
+    FsStore getStoreByLiveId(Long liveId);
 }

+ 12 - 10
fs-service/src/main/java/com/fs/live/service/ILiveOrderService.java

@@ -6,14 +6,14 @@ import com.fs.live.domain.LiveOrder;
 
 /**
  * 订单Service接口
- * 
+ *
  * @author fs
  * @date 2025-07-08
  */
 public interface ILiveOrderService extends IService<LiveOrder>{
     /**
      * 查询订单
-     * 
+     *
      * @param orderId 订单主键
      * @return 订单
      */
@@ -21,7 +21,7 @@ public interface ILiveOrderService extends IService<LiveOrder>{
 
     /**
      * 查询订单列表
-     * 
+     *
      * @param liveOrder 订单
      * @return 订单集合
      */
@@ -29,15 +29,15 @@ public interface ILiveOrderService extends IService<LiveOrder>{
 
     /**
      * 新增订单
-     * 
+     *
      * @param liveOrder 订单
      * @return 结果
      */
-    int insertLiveOrder(LiveOrder liveOrder);
+    Long insertLiveOrder(LiveOrder liveOrder);
 
     /**
      * 修改订单
-     * 
+     *
      * @param liveOrder 订单
      * @return 结果
      */
@@ -45,17 +45,19 @@ public interface ILiveOrderService extends IService<LiveOrder>{
 
     /**
      * 批量删除订单
-     * 
+     *
      * @param orderIds 需要删除的订单主键集合
      * @return 结果
      */
-    int deleteLiveOrderByOrderIds(String[] orderIds);
+    //int deleteLiveOrderByOrderIds(String[] orderIds);
 
     /**
      * 删除订单信息
-     * 
+     *
      * @param orderId 订单主键
      * @return 结果
      */
-    int deleteLiveOrderByOrderId(String orderId);
+    //int deleteLiveOrderByOrderId(String orderId);
+
+    void handlePay(LiveOrder liveOrder);
 }

+ 0 - 61
fs-service/src/main/java/com/fs/live/service/ILiveOrderStatusService.java

@@ -1,61 +0,0 @@
-package com.fs.live.service;
-
-import java.util.List;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.fs.live.domain.LiveOrderStatus;
-
-/**
- * 订单操作记录Service接口
- * 
- * @author fs
- * @date 2025-07-08
- */
-public interface ILiveOrderStatusService extends IService<LiveOrderStatus>{
-    /**
-     * 查询订单操作记录
-     * 
-     * @param id 订单操作记录主键
-     * @return 订单操作记录
-     */
-    LiveOrderStatus selectLiveOrderStatusById(String id);
-
-    /**
-     * 查询订单操作记录列表
-     * 
-     * @param liveOrderStatus 订单操作记录
-     * @return 订单操作记录集合
-     */
-    List<LiveOrderStatus> selectLiveOrderStatusList(LiveOrderStatus liveOrderStatus);
-
-    /**
-     * 新增订单操作记录
-     * 
-     * @param liveOrderStatus 订单操作记录
-     * @return 结果
-     */
-    int insertLiveOrderStatus(LiveOrderStatus liveOrderStatus);
-
-    /**
-     * 修改订单操作记录
-     * 
-     * @param liveOrderStatus 订单操作记录
-     * @return 结果
-     */
-    int updateLiveOrderStatus(LiveOrderStatus liveOrderStatus);
-
-    /**
-     * 批量删除订单操作记录
-     * 
-     * @param ids 需要删除的订单操作记录主键集合
-     * @return 结果
-     */
-    int deleteLiveOrderStatusByIds(String[] ids);
-
-    /**
-     * 删除订单操作记录信息
-     * 
-     * @param id 订单操作记录主键
-     * @return 结果
-     */
-    int deleteLiveOrderStatusById(String id);
-}

+ 69 - 0
fs-service/src/main/java/com/fs/live/service/ILiveUserFavoriteService.java

@@ -0,0 +1,69 @@
+package com.fs.live.service;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.live.domain.LiveUserFavorite;
+
+/**
+ * 用户直播收藏Service接口
+ *
+ * @author fs
+ * @date 2025-07-11
+ */
+public interface ILiveUserFavoriteService extends IService<LiveUserFavorite>{
+    /**
+     * 查询用户直播收藏
+     *
+     * @param favoriteId 用户直播收藏主键
+     * @return 用户直播收藏
+     */
+    LiveUserFavorite selectLiveUserFavoriteByFavoriteId(Long favoriteId);
+
+    /**
+     * 查询用户直播收藏列表
+     *
+     * @param liveUserFavorite 用户直播收藏
+     * @return 用户直播收藏集合
+     */
+    List<LiveUserFavorite> selectLiveUserFavoriteList(LiveUserFavorite liveUserFavorite);
+
+    /**
+     * 新增用户直播收藏
+     *
+     * @param liveUserFavorite 用户直播收藏
+     * @return 结果
+     */
+    int insertLiveUserFavorite(LiveUserFavorite liveUserFavorite);
+
+    /**
+     * 修改用户直播收藏
+     *
+     * @param liveUserFavorite 用户直播收藏
+     * @return 结果
+     */
+    int updateLiveUserFavorite(LiveUserFavorite liveUserFavorite);
+
+    /**
+     * 批量删除用户直播收藏
+     *
+     * @param favoriteIds 需要删除的用户直播收藏主键集合
+     * @return 结果
+     */
+    int deleteLiveUserFavoriteByFavoriteIds(Long[] favoriteIds);
+
+    /**
+     * 删除用户直播收藏信息
+     *
+     * @param favoriteId 用户直播收藏主键
+     * @return 结果
+     */
+    int deleteLiveUserFavoriteByFavoriteId(Long favoriteId);
+
+    LiveUserFavorite selectLiveUserFavoriteByLiveIdAndUserId(Long liveId, Long userId);
+
+    void deleteLiveUserFavoriteByLiveIdAndUserId(Long liveId, Long userId);
+
+    LiveUserFavorite selectByIds(Long productId, Long storeId, Long liveId, Long userId);
+
+    void deleteLiveUserFavoriteByIds(Long productId, Long storeId, Long liveId, Long userId);
+}

+ 66 - 0
fs-service/src/main/java/com/fs/live/service/ILiveUserFollowService.java

@@ -0,0 +1,66 @@
+package com.fs.live.service;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.live.domain.LiveUserFollow;
+
+/**
+ * 用户直播关注Service接口
+ *
+ * @author fs
+ * @date 2025-07-11
+ */
+public interface ILiveUserFollowService extends IService<LiveUserFollow>{
+    /**
+     * 查询用户直播关注
+     *
+     * @param id 用户直播关注主键
+     * @return 用户直播关注
+     */
+    LiveUserFollow selectLiveUserFollowById(Long id);
+
+    /**
+     * 查询用户直播关注列表
+     *
+     * @param liveUserFollow 用户直播关注
+     * @return 用户直播关注集合
+     */
+    List<LiveUserFollow> selectLiveUserFollowList(LiveUserFollow liveUserFollow);
+
+    /**
+     * 新增用户直播关注
+     *
+     * @param liveUserFollow 用户直播关注
+     * @return 结果
+     */
+    int insertLiveUserFollow(LiveUserFollow liveUserFollow);
+
+    /**
+     * 修改用户直播关注
+     *
+     * @param liveUserFollow 用户直播关注
+     * @return 结果
+     */
+    int updateLiveUserFollow(LiveUserFollow liveUserFollow);
+
+    /**
+     * 批量删除用户直播关注
+     *
+     * @param ids 需要删除的用户直播关注主键集合
+     * @return 结果
+     */
+    int deleteLiveUserFollowByIds(Long[] ids);
+
+    /**
+     * 删除用户直播关注信息
+     *
+     * @param id 用户直播关注主键
+     * @return 结果
+     */
+    int deleteLiveUserFollowById(Long id);
+
+    LiveUserFollow selectLiveUserFollowByLiveIdAndUserId(Long liveId, Long userId);
+
+    void deleteLiveUserFollowByLiveIdAndUserId(Long liveId, Long userId);
+
+}

+ 63 - 0
fs-service/src/main/java/com/fs/live/service/ILiveUserLikeService.java

@@ -0,0 +1,63 @@
+package com.fs.live.service;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.live.domain.LiveUserLike;
+
+/**
+ * 用户直播赞Service接口
+ *
+ * @author fs
+ * @date 2025-07-11
+ */
+public interface ILiveUserLikeService extends IService<LiveUserLike>{
+    /**
+     * 查询用户直播赞
+     *
+     * @param id 用户直播赞主键
+     * @return 用户直播赞
+     */
+    LiveUserLike selectLiveUserLikeById(Long id);
+
+    /**
+     * 查询用户直播赞列表
+     *
+     * @param liveUserLike 用户直播赞
+     * @return 用户直播赞集合
+     */
+    List<LiveUserLike> selectLiveUserLikeList(LiveUserLike liveUserLike);
+
+    /**
+     * 新增用户直播赞
+     *
+     * @param liveUserLike 用户直播赞
+     * @return 结果
+     */
+    int insertLiveUserLike(LiveUserLike liveUserLike);
+
+    /**
+     * 修改用户直播赞
+     *
+     * @param liveUserLike 用户直播赞
+     * @return 结果
+     */
+    int updateLiveUserLike(LiveUserLike liveUserLike);
+
+    /**
+     * 批量删除用户直播赞
+     *
+     * @param ids 需要删除的用户直播赞主键集合
+     * @return 结果
+     */
+    int deleteLiveUserLikeByIds(Long[] ids);
+
+    /**
+     * 删除用户直播赞信息
+     *
+     * @param id 用户直播赞主键
+     * @return 结果
+     */
+    int deleteLiveUserLikeById(Long id);
+
+    LiveUserLike selectLiveUserLikeByIds(Long liveId, Long userId);
+}

+ 139 - 4
fs-service/src/main/java/com/fs/live/service/impl/LiveDataServiceImpl.java

@@ -5,8 +5,14 @@ import com.fs.common.core.redis.RedisCache;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.spring.SpringUtils;
 import com.fs.live.domain.LiveData;
+import com.fs.live.domain.LiveUserFavorite;
+import com.fs.live.domain.LiveUserFollow;
+import com.fs.live.domain.LiveUserLike;
 import com.fs.live.mapper.LiveDataMapper;
 import com.fs.live.service.ILiveDataService;
+import com.fs.live.service.ILiveUserFavoriteService;
+import com.fs.live.service.ILiveUserFollowService;
+import com.fs.live.service.ILiveUserLikeService;
 import com.fs.live.vo.ColumnsConfigVo;
 import com.fs.live.vo.DateRange;
 import com.fs.live.vo.RecentLiveDataVo;
@@ -18,11 +24,14 @@ import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.time.DayOfWeek;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.time.temporal.ChronoUnit;
+import java.util.*;
+import java.util.concurrent.TimeUnit;
+
+import static com.fs.common.constant.LiveKeysConstant.*;
+
 
 /**
  * 直播数据Service业务层处理
@@ -33,12 +42,21 @@ import java.util.Map;
 @Service
 public class LiveDataServiceImpl extends ServiceImpl<LiveDataMapper, LiveData> implements ILiveDataService {
 
+
     @Autowired
     private LiveDataMapper liveDataMapper;
     private final RedisCache redisCache = SpringUtils.getBean(RedisCache.class);
     private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd");
     private final String COLUMNS_CONFIG = "columnsConfigKey";
 
+    @Autowired
+    private ILiveUserLikeService liveUserLikeService;
+
+    @Autowired
+    private ILiveUserFollowService liveUserFollowService;
+
+    @Autowired
+    private ILiveUserFavoriteService liveUserFavoriteService;
     /**
      * 查询直播数据
      *
@@ -329,6 +347,123 @@ public class LiveDataServiceImpl extends ServiceImpl<LiveDataMapper, LiveData> i
         redisCache.deleteObject(COLUMNS_CONFIG + userId + ":");
         redisCache.setCacheObject(COLUMNS_CONFIG + userId + ":", columns);
     }
+
+    @Override
+    public String updateLikeByLiveId(Long liveId, Long userId) {
+        //一个用户一天只能点赞十次
+        String key = "live:like" + liveId + ":user:" + userId+":date:"+ DateUtils.getDate();
+        LiveUserLike liveUserLike;
+        if(!redisCache.redisTemplate.hasKey(key)) {
+            liveUserLike = liveUserLikeService.selectLiveUserLikeByIds(liveId, userId);
+            if (liveUserLike == null) {
+                liveUserLike = new LiveUserLike();
+                liveUserLike.setUserId(userId);
+                liveUserLike.setLiveId(liveId);
+                liveUserLike.setCreateTime(new Date());
+                liveUserLikeService.insertLiveUserLike(liveUserLike);
+            }
+        }
+        int count =redisCache.getCacheObject(key);
+        if(count>=10) {
+            //当前时间
+            LocalDateTime now = LocalDateTime.now();
+            //明天0点
+            LocalDateTime tomorrow = now.plusDays(1).withHour(0).withMinute(0).withSecond(0);
+            //间隔秒
+            long seconds = ChronoUnit.SECONDS.between(now, tomorrow);
+            redisCache.expire(key, (int)seconds, TimeUnit.SECONDS);
+            return "每天最多为直播间点赞10次哟";
+        }
+        //用户直播间点赞数
+        redisCache.increment(key,1);
+        //直播间总点赞数
+        redisCache.increment("live:like:" + liveId,1);
+        return "点赞成功";
+    }
+
+    @Override
+    public String collect(Long liveId, Long userId) {
+        //查询用户是否收藏过该直播间
+        LiveUserFavorite liveUserFavorite = liveUserFavoriteService.selectLiveUserFavoriteByLiveIdAndUserId(liveId, userId);
+        if (liveUserFavorite != null) {
+            liveUserFavoriteService.deleteLiveUserFavoriteByLiveIdAndUserId(liveId, userId);
+            return "取消收藏成功";
+        }
+        liveUserFavorite = new LiveUserFavorite();
+        liveUserFavorite.setUserId(userId);
+        liveUserFavorite.setLiveId(liveId);
+        liveUserFavorite.setCreateTime(new Date());
+        liveUserFavoriteService.insertLiveUserFavorite(liveUserFavorite);
+        return "收藏成功";
+    }
+
+    @Override
+    public String follow(Long liveId, Long userId) {
+        LiveUserFollow liveUserFollow = liveUserFollowService.selectLiveUserFollowByLiveIdAndUserId(liveId, userId);
+        if (liveUserFollow != null) {
+            liveUserFollowService.deleteLiveUserFollowByLiveIdAndUserId(liveId, userId);
+            return "取消关注成功";
+        }
+        liveUserFollow = new LiveUserFollow();
+        liveUserFollow.setUserId(userId);
+        liveUserFollow.setLiveId(liveId);
+        liveUserFollow.setCreateTime(new Date());
+        liveUserFollowService.insertLiveUserFollow(liveUserFollow);
+        return "关注成功";
+    }
+
+    /**
+     * 收藏商品默认收藏直播间和店铺
+     * 收藏店铺默认收藏直播间
+     * 取消收藏店铺默认取消收藏商品
+     * */
+    @Override
+    public String collectStore(Long storeId, Long productId, Long liveId, Long userId) {
+        if(liveId==null&&storeId==null){
+            return "未知的产品或店铺";
+        }
+        //判断是收藏店铺还是收藏产品
+        if (productId != null) {
+            //查询用户是否收藏过该产品
+            LiveUserFavorite liveUserFavorite = liveUserFavoriteService.selectByIds(productId,storeId,liveId,userId);
+            if (liveUserFavorite != null) {
+                liveUserFavoriteService.deleteLiveUserFavoriteByIds(productId,storeId,liveId,userId);
+                return "取消收藏成功";
+            }
+            liveUserFavorite = new LiveUserFavorite();
+            liveUserFavorite.setProductId(productId);
+            liveUserFavorite.setStoreId(storeId);
+            liveUserFavorite.setLiveId(liveId);
+            liveUserFavorite.setCreateTime(new Date());
+            liveUserFavoriteService.insertLiveUserFavorite(liveUserFavorite);
+            return "收藏成功";
+        }
+        //查询用户是否收藏过该店铺
+        LiveUserFavorite liveUserFavorite = liveUserFavoriteService.selectByIds(null,storeId,liveId,userId);
+        if (liveUserFavorite != null) {
+            liveUserFavoriteService.deleteLiveUserFavoriteByIds(null,storeId,liveId,userId);
+            return "取消收藏成功";
+        }
+        liveUserFavorite = new LiveUserFavorite();
+        liveUserFavorite.setStoreId(storeId);
+        liveUserFavorite.setLiveId(liveId);
+        liveUserFavorite.setCreateTime(new Date());
+        liveUserFavoriteService.insertLiveUserFavorite(liveUserFavorite);
+        return "收藏成功";
+    }
+
+    @Override
+    public Map<String, Object> getLiveViewData(Long liveId) {
+        Map<String, Object> liveViewData = new HashMap<>();
+        //在线人数
+        liveViewData.put("online", redisCache.getCacheObject(ONLINE_USERS_KEY+liveId));
+        //关注数
+        liveViewData.put("follow", baseMapper.selectLiveDataByLiveId(liveId).getFollow_num());
+        //点赞数
+        liveViewData.put("like", redisCache.getCacheObject("live:like"+liveId));
+        return liveViewData;
+    }
+
     private Map<String, String> createColumn(String dataIndex, String status, String title) {
         Map<String, String> column = new HashMap<>();
         column.put("dataIndex", dataIndex);

+ 20 - 7
fs-service/src/main/java/com/fs/live/service/impl/LiveGoodsServiceImpl.java

@@ -3,6 +3,8 @@ package com.fs.live.service.impl;
 import java.util.List;
 import com.fs.common.utils.DateUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.his.domain.FsStore;
+import com.fs.his.service.IFsStoreService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.live.mapper.LiveGoodsMapper;
@@ -11,16 +13,19 @@ import com.fs.live.service.ILiveGoodsService;
 
 /**
  * 直播商品Service业务层处理
- * 
+ *
  * @author fs
  * @date 2025-07-08
  */
 @Service
 public class LiveGoodsServiceImpl extends ServiceImpl<LiveGoodsMapper, LiveGoods> implements ILiveGoodsService {
 
+    @Autowired
+    private IFsStoreService fsStoreService;
+
     /**
      * 查询直播商品
-     * 
+     *
      * @param goodsId 直播商品主键
      * @return 直播商品
      */
@@ -32,7 +37,7 @@ public class LiveGoodsServiceImpl extends ServiceImpl<LiveGoodsMapper, LiveGoods
 
     /**
      * 查询直播商品列表
-     * 
+     *
      * @param liveGoods 直播商品
      * @return 直播商品
      */
@@ -44,7 +49,7 @@ public class LiveGoodsServiceImpl extends ServiceImpl<LiveGoodsMapper, LiveGoods
 
     /**
      * 新增直播商品
-     * 
+     *
      * @param liveGoods 直播商品
      * @return 结果
      */
@@ -57,7 +62,7 @@ public class LiveGoodsServiceImpl extends ServiceImpl<LiveGoodsMapper, LiveGoods
 
     /**
      * 修改直播商品
-     * 
+     *
      * @param liveGoods 直播商品
      * @return 结果
      */
@@ -70,7 +75,7 @@ public class LiveGoodsServiceImpl extends ServiceImpl<LiveGoodsMapper, LiveGoods
 
     /**
      * 批量删除直播商品
-     * 
+     *
      * @param goodsIds 需要删除的直播商品主键
      * @return 结果
      */
@@ -82,7 +87,7 @@ public class LiveGoodsServiceImpl extends ServiceImpl<LiveGoodsMapper, LiveGoods
 
     /**
      * 删除直播商品信息
-     * 
+     *
      * @param goodsId 直播商品主键
      * @return 结果
      */
@@ -91,4 +96,12 @@ public class LiveGoodsServiceImpl extends ServiceImpl<LiveGoodsMapper, LiveGoods
     {
         return baseMapper.deleteLiveGoodsByGoodsId(goodsId);
     }
+
+    @Override
+    public FsStore getStoreByLiveId(Long liveId) {
+        //获取店铺id
+        Long storeId = baseMapper.selectStoreIdByLiveId(liveId);
+        //获取店铺信息
+        return fsStoreService.selectFsStoreByStoreId(storeId);
+    }
 }

+ 35 - 16
fs-service/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java

@@ -1,17 +1,16 @@
 package com.fs.live.service.impl;
 
 import java.util.List;
-import com.fs.common.utils.DateUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.live.mapper.LiveOrderMapper;
 import com.fs.live.domain.LiveOrder;
 import com.fs.live.service.ILiveOrderService;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * 订单Service业务层处理
- * 
+ *
  * @author fs
  * @date 2025-07-08
  */
@@ -20,7 +19,7 @@ public class LiveOrderServiceImpl extends ServiceImpl<LiveOrderMapper, LiveOrder
 
     /**
      * 查询订单
-     * 
+     *
      * @param orderId 订单主键
      * @return 订单
      */
@@ -32,7 +31,7 @@ public class LiveOrderServiceImpl extends ServiceImpl<LiveOrderMapper, LiveOrder
 
     /**
      * 查询订单列表
-     * 
+     *
      * @param liveOrder 订单
      * @return 订单
      */
@@ -44,51 +43,71 @@ public class LiveOrderServiceImpl extends ServiceImpl<LiveOrderMapper, LiveOrder
 
     /**
      * 新增订单
-     * 
+     *
      * @param liveOrder 订单
      * @return 结果
      */
     @Override
-    public int insertLiveOrder(LiveOrder liveOrder)
+    @Transactional
+    public Long insertLiveOrder(LiveOrder liveOrder)
     {
-        liveOrder.setCreateTime(DateUtils.getNowDate());
-        return baseMapper.insertLiveOrder(liveOrder);
+        //liveOrder.setCreateTime(DateUtils.getNowDate());
+        baseMapper.insertLiveOrder(liveOrder);
+        return liveOrder.getOrderId();
     }
 
     /**
      * 修改订单
-     * 
+     *
      * @param liveOrder 订单
      * @return 结果
      */
     @Override
+    @Transactional
     public int updateLiveOrder(LiveOrder liveOrder)
     {
-        liveOrder.setUpdateTime(DateUtils.getNowDate());
+        //liveOrder.setUpdateTime(DateUtils.getNowDate());
         return baseMapper.updateLiveOrder(liveOrder);
     }
 
     /**
      * 批量删除订单
-     * 
+     *
      * @param orderIds 需要删除的订单主键
      * @return 结果
      */
-    @Override
+    /*@Override
     public int deleteLiveOrderByOrderIds(String[] orderIds)
     {
         return baseMapper.deleteLiveOrderByOrderIds(orderIds);
-    }
+    }*/
 
     /**
      * 删除订单信息
-     * 
+     *
      * @param orderId 订单主键
      * @return 结果
      */
-    @Override
+    /*@Override
     public int deleteLiveOrderByOrderId(String orderId)
     {
         return baseMapper.deleteLiveOrderByOrderId(orderId);
+    }*/
+
+    @Override
+    @Transactional
+    public void handlePay(LiveOrder liveOrder) {
+        //订单状态
+        //插入订单详情
+        //插入操作日志
+
+    }
+
+    /**
+     * 订单操作记录
+     * */
+    @Transactional
+    public void handleOrderStatus(LiveOrder liveOrder) {
+
     }
 }

+ 0 - 91
fs-service/src/main/java/com/fs/live/service/impl/LiveOrderStatusServiceImpl.java

@@ -1,91 +0,0 @@
-package com.fs.live.service.impl;
-
-import java.util.List;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.fs.live.mapper.LiveOrderStatusMapper;
-import com.fs.live.domain.LiveOrderStatus;
-import com.fs.live.service.ILiveOrderStatusService;
-
-/**
- * 订单操作记录Service业务层处理
- * 
- * @author fs
- * @date 2025-07-08
- */
-@Service
-public class LiveOrderStatusServiceImpl extends ServiceImpl<LiveOrderStatusMapper, LiveOrderStatus> implements ILiveOrderStatusService {
-
-    /**
-     * 查询订单操作记录
-     * 
-     * @param id 订单操作记录主键
-     * @return 订单操作记录
-     */
-    @Override
-    public LiveOrderStatus selectLiveOrderStatusById(String id)
-    {
-        return baseMapper.selectLiveOrderStatusById(id);
-    }
-
-    /**
-     * 查询订单操作记录列表
-     * 
-     * @param liveOrderStatus 订单操作记录
-     * @return 订单操作记录
-     */
-    @Override
-    public List<LiveOrderStatus> selectLiveOrderStatusList(LiveOrderStatus liveOrderStatus)
-    {
-        return baseMapper.selectLiveOrderStatusList(liveOrderStatus);
-    }
-
-    /**
-     * 新增订单操作记录
-     * 
-     * @param liveOrderStatus 订单操作记录
-     * @return 结果
-     */
-    @Override
-    public int insertLiveOrderStatus(LiveOrderStatus liveOrderStatus)
-    {
-        return baseMapper.insertLiveOrderStatus(liveOrderStatus);
-    }
-
-    /**
-     * 修改订单操作记录
-     * 
-     * @param liveOrderStatus 订单操作记录
-     * @return 结果
-     */
-    @Override
-    public int updateLiveOrderStatus(LiveOrderStatus liveOrderStatus)
-    {
-        return baseMapper.updateLiveOrderStatus(liveOrderStatus);
-    }
-
-    /**
-     * 批量删除订单操作记录
-     * 
-     * @param ids 需要删除的订单操作记录主键
-     * @return 结果
-     */
-    @Override
-    public int deleteLiveOrderStatusByIds(String[] ids)
-    {
-        return baseMapper.deleteLiveOrderStatusByIds(ids);
-    }
-
-    /**
-     * 删除订单操作记录信息
-     * 
-     * @param id 订单操作记录主键
-     * @return 结果
-     */
-    @Override
-    public int deleteLiveOrderStatusById(String id)
-    {
-        return baseMapper.deleteLiveOrderStatusById(id);
-    }
-}

+ 113 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveUserFavoriteServiceImpl.java

@@ -0,0 +1,113 @@
+package com.fs.live.service.impl;
+
+import java.util.List;
+import com.fs.common.utils.DateUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.fs.live.mapper.LiveUserFavoriteMapper;
+import com.fs.live.domain.LiveUserFavorite;
+import com.fs.live.service.ILiveUserFavoriteService;
+
+/**
+ * 用户直播收藏Service业务层处理
+ *
+ * @author fs
+ * @date 2025-07-11
+ */
+@Service
+public class LiveUserFavoriteServiceImpl extends ServiceImpl<LiveUserFavoriteMapper, LiveUserFavorite> implements ILiveUserFavoriteService {
+
+    /**
+     * 查询用户直播收藏
+     *
+     * @param favoriteId 用户直播收藏主键
+     * @return 用户直播收藏
+     */
+    @Override
+    public LiveUserFavorite selectLiveUserFavoriteByFavoriteId(Long favoriteId)
+    {
+        return baseMapper.selectLiveUserFavoriteByFavoriteId(favoriteId);
+    }
+
+    /**
+     * 查询用户直播收藏列表
+     *
+     * @param liveUserFavorite 用户直播收藏
+     * @return 用户直播收藏
+     */
+    @Override
+    public List<LiveUserFavorite> selectLiveUserFavoriteList(LiveUserFavorite liveUserFavorite)
+    {
+        return baseMapper.selectLiveUserFavoriteList(liveUserFavorite);
+    }
+
+    /**
+     * 新增用户直播收藏
+     *
+     * @param liveUserFavorite 用户直播收藏
+     * @return 结果
+     */
+    @Override
+    public int insertLiveUserFavorite(LiveUserFavorite liveUserFavorite)
+    {
+        liveUserFavorite.setCreateTime(DateUtils.getNowDate());
+        return baseMapper.insertLiveUserFavorite(liveUserFavorite);
+    }
+
+    /**
+     * 修改用户直播收藏
+     *
+     * @param liveUserFavorite 用户直播收藏
+     * @return 结果
+     */
+    @Override
+    public int updateLiveUserFavorite(LiveUserFavorite liveUserFavorite)
+    {
+        liveUserFavorite.setUpdateTime(DateUtils.getNowDate());
+        return baseMapper.updateLiveUserFavorite(liveUserFavorite);
+    }
+
+    /**
+     * 批量删除用户直播收藏
+     *
+     * @param favoriteIds 需要删除的用户直播收藏主键
+     * @return 结果
+     */
+    @Override
+    public int deleteLiveUserFavoriteByFavoriteIds(Long[] favoriteIds)
+    {
+        return baseMapper.deleteLiveUserFavoriteByFavoriteIds(favoriteIds);
+    }
+
+    /**
+     * 删除用户直播收藏信息
+     *
+     * @param favoriteId 用户直播收藏主键
+     * @return 结果
+     */
+    @Override
+    public int deleteLiveUserFavoriteByFavoriteId(Long favoriteId)
+    {
+        return baseMapper.deleteLiveUserFavoriteByFavoriteId(favoriteId);
+    }
+
+    @Override
+    public LiveUserFavorite selectLiveUserFavoriteByLiveIdAndUserId(Long liveId, Long userId) {
+        return baseMapper.selectLiveUserFavoriteByLiveIdAndUserId(liveId, userId);
+    }
+
+    @Override
+    public void deleteLiveUserFavoriteByLiveIdAndUserId(Long liveId, Long userId) {
+        baseMapper.deleteLiveUserFavoriteByLiveIdAndUserId(liveId, userId);
+    }
+
+    @Override
+    public LiveUserFavorite selectByIds(Long productId, Long storeId, Long liveId, Long userId) {
+        return baseMapper.selectByIds(productId,storeId,liveId,userId);
+    }
+
+    @Override
+    public void deleteLiveUserFavoriteByIds(Long productId, Long storeId, Long liveId, Long userId) {
+        baseMapper.deleteLiveUserFavoriteByIds(productId,storeId,liveId,userId);
+    }
+}

+ 104 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveUserFollowServiceImpl.java

@@ -0,0 +1,104 @@
+package com.fs.live.service.impl;
+
+import java.util.List;
+import com.fs.common.utils.DateUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.fs.live.mapper.LiveUserFollowMapper;
+import com.fs.live.domain.LiveUserFollow;
+import com.fs.live.service.ILiveUserFollowService;
+
+/**
+ * 用户直播关注Service业务层处理
+ *
+ * @author fs
+ * @date 2025-07-11
+ */
+@Service
+public class LiveUserFollowServiceImpl extends ServiceImpl<LiveUserFollowMapper, LiveUserFollow> implements ILiveUserFollowService {
+
+    /**
+     * 查询用户直播关注
+     *
+     * @param id 用户直播关注主键
+     * @return 用户直播关注
+     */
+    @Override
+    public LiveUserFollow selectLiveUserFollowById(Long id)
+    {
+        return baseMapper.selectLiveUserFollowById(id);
+    }
+
+    /**
+     * 查询用户直播关注列表
+     *
+     * @param liveUserFollow 用户直播关注
+     * @return 用户直播关注
+     */
+    @Override
+    public List<LiveUserFollow> selectLiveUserFollowList(LiveUserFollow liveUserFollow)
+    {
+        return baseMapper.selectLiveUserFollowList(liveUserFollow);
+    }
+
+    /**
+     * 新增用户直播关注
+     *
+     * @param liveUserFollow 用户直播关注
+     * @return 结果
+     */
+    @Override
+    public int insertLiveUserFollow(LiveUserFollow liveUserFollow)
+    {
+        liveUserFollow.setCreateTime(DateUtils.getNowDate());
+        return baseMapper.insertLiveUserFollow(liveUserFollow);
+    }
+
+    /**
+     * 修改用户直播关注
+     *
+     * @param liveUserFollow 用户直播关注
+     * @return 结果
+     */
+    @Override
+    public int updateLiveUserFollow(LiveUserFollow liveUserFollow)
+    {
+        liveUserFollow.setUpdateTime(DateUtils.getNowDate());
+        return baseMapper.updateLiveUserFollow(liveUserFollow);
+    }
+
+    /**
+     * 批量删除用户直播关注
+     *
+     * @param ids 需要删除的用户直播关注主键
+     * @return 结果
+     */
+    @Override
+    public int deleteLiveUserFollowByIds(Long[] ids)
+    {
+        return baseMapper.deleteLiveUserFollowByIds(ids);
+    }
+
+    /**
+     * 删除用户直播关注信息
+     *
+     * @param id 用户直播关注主键
+     * @return 结果
+     */
+    @Override
+    public int deleteLiveUserFollowById(Long id)
+    {
+        return baseMapper.deleteLiveUserFollowById(id);
+    }
+
+    @Override
+    public LiveUserFollow selectLiveUserFollowByLiveIdAndUserId(Long liveId, Long userId) {
+        return baseMapper.selectLiveUserFollowByLiveIdAndUserId(liveId, userId);
+    }
+
+    @Override
+    public void deleteLiveUserFollowByLiveIdAndUserId(Long liveId, Long userId) {
+        baseMapper.deleteLiveUserFollowByLiveIdAndUserId(liveId, userId);
+    }
+}

+ 99 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveUserLikeServiceImpl.java

@@ -0,0 +1,99 @@
+package com.fs.live.service.impl;
+
+import java.util.List;
+import com.fs.common.utils.DateUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.fs.live.mapper.LiveUserLikeMapper;
+import com.fs.live.domain.LiveUserLike;
+import com.fs.live.service.ILiveUserLikeService;
+
+/**
+ * 用户直播赞Service业务层处理
+ *
+ * @author fs
+ * @date 2025-07-11
+ */
+@Service
+public class LiveUserLikeServiceImpl extends ServiceImpl<LiveUserLikeMapper, LiveUserLike> implements ILiveUserLikeService {
+
+    /**
+     * 查询用户直播赞
+     *
+     * @param id 用户直播赞主键
+     * @return 用户直播赞
+     */
+    @Override
+    public LiveUserLike selectLiveUserLikeById(Long id)
+    {
+        return baseMapper.selectLiveUserLikeById(id);
+    }
+
+    /**
+     * 查询用户直播赞列表
+     *
+     * @param liveUserLike 用户直播赞
+     * @return 用户直播赞
+     */
+    @Override
+    public List<LiveUserLike> selectLiveUserLikeList(LiveUserLike liveUserLike)
+    {
+        return baseMapper.selectLiveUserLikeList(liveUserLike);
+    }
+
+    /**
+     * 新增用户直播赞
+     *
+     * @param liveUserLike 用户直播赞
+     * @return 结果
+     */
+    @Override
+    public int insertLiveUserLike(LiveUserLike liveUserLike)
+    {
+        liveUserLike.setCreateTime(DateUtils.getNowDate());
+        return baseMapper.insertLiveUserLike(liveUserLike);
+    }
+
+    /**
+     * 修改用户直播赞
+     *
+     * @param liveUserLike 用户直播赞
+     * @return 结果
+     */
+    @Override
+    public int updateLiveUserLike(LiveUserLike liveUserLike)
+    {
+        liveUserLike.setUpdateTime(DateUtils.getNowDate());
+        return baseMapper.updateLiveUserLike(liveUserLike);
+    }
+
+    /**
+     * 批量删除用户直播赞
+     *
+     * @param ids 需要删除的用户直播赞主键
+     * @return 结果
+     */
+    @Override
+    public int deleteLiveUserLikeByIds(Long[] ids)
+    {
+        return baseMapper.deleteLiveUserLikeByIds(ids);
+    }
+
+    /**
+     * 删除用户直播赞信息
+     *
+     * @param id 用户直播赞主键
+     * @return 结果
+     */
+    @Override
+    public int deleteLiveUserLikeById(Long id)
+    {
+        return baseMapper.deleteLiveUserLikeById(id);
+    }
+
+    @Override
+    public LiveUserLike selectLiveUserLikeByIds(Long liveId, Long userId) {
+        return baseMapper.selectLiveUserLikeByIds(liveId, userId);
+    }
+}

+ 4 - 0
fs-service/src/main/resources/mapper/live/LiveGoodsMapper.xml

@@ -108,4 +108,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{goodsId}
         </foreach>
     </delete>
+
+    <select id="selectStoreIdByLiveId" parameterType="Long">
+        select distinct store_id from live_goods where live_id = #{liveId}
+    </select>
 </mapper>

+ 0 - 71
fs-service/src/main/resources/mapper/live/LiveOrderStatusMapper.xml

@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.fs.live.mapper.LiveOrderStatusMapper">
-
-    <resultMap type="LiveOrderStatus" id="LiveOrderStatusResult">
-        <result property="id"    column="id"    />
-        <result property="orderId"    column="order_id"    />
-        <result property="changeType"    column="change_type"    />
-        <result property="changeMessage"    column="change_message"    />
-        <result property="changeTime"    column="change_time"    />
-    </resultMap>
-
-    <sql id="selectLiveOrderStatusVo">
-        select id, order_id, change_type, change_message, change_time from live_order_status
-    </sql>
-
-    <select id="selectLiveOrderStatusList" parameterType="LiveOrderStatus" resultMap="LiveOrderStatusResult">
-        <include refid="selectLiveOrderStatusVo"/>
-        <where>
-            <if test="orderId != null  and orderId != ''"> and order_id = #{orderId}</if>
-            <if test="changeType != null  and changeType != ''"> and change_type = #{changeType}</if>
-            <if test="changeMessage != null  and changeMessage != ''"> and change_message = #{changeMessage}</if>
-            <if test="changeTime != null "> and change_time = #{changeTime}</if>
-        </where>
-    </select>
-
-    <select id="selectLiveOrderStatusById" parameterType="String" resultMap="LiveOrderStatusResult">
-        <include refid="selectLiveOrderStatusVo"/>
-        where id = #{id}
-    </select>
-
-    <insert id="insertLiveOrderStatus" parameterType="LiveOrderStatus" useGeneratedKeys="true" keyProperty="id">
-        insert into live_order_status
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="orderId != null and orderId != ''">order_id,</if>
-            <if test="changeType != null and changeType != ''">change_type,</if>
-            <if test="changeMessage != null and changeMessage != ''">change_message,</if>
-            <if test="changeTime != null">change_time,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="orderId != null and orderId != ''">#{orderId},</if>
-            <if test="changeType != null and changeType != ''">#{changeType},</if>
-            <if test="changeMessage != null and changeMessage != ''">#{changeMessage},</if>
-            <if test="changeTime != null">#{changeTime},</if>
-         </trim>
-    </insert>
-
-    <update id="updateLiveOrderStatus" parameterType="LiveOrderStatus">
-        update live_order_status
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="orderId != null and orderId != ''">order_id = #{orderId},</if>
-            <if test="changeType != null and changeType != ''">change_type = #{changeType},</if>
-            <if test="changeMessage != null and changeMessage != ''">change_message = #{changeMessage},</if>
-            <if test="changeTime != null">change_time = #{changeTime},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteLiveOrderStatusById" parameterType="String">
-        delete from live_order_status where id = #{id}
-    </delete>
-
-    <delete id="deleteLiveOrderStatusByIds" parameterType="String">
-        delete from live_order_status where id in
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-</mapper>

+ 95 - 0
fs-service/src/main/resources/mapper/live/LiveUserFavoriteMapper.xml

@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.live.mapper.LiveUserFavoriteMapper">
+
+    <resultMap type="LiveUserFavorite" id="LiveUserFavoriteResult">
+        <result property="favoriteId"    column="favorite_id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="liveId"    column="live_id"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectLiveUserFavoriteVo">
+        select favorite_id, user_id, live_id, create_time, update_time from live_user_favorite
+    </sql>
+
+    <select id="selectLiveUserFavoriteList" parameterType="LiveUserFavorite" resultMap="LiveUserFavoriteResult">
+        <include refid="selectLiveUserFavoriteVo"/>
+        <where>
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="liveId != null "> and live_id = #{liveId}</if>
+        </where>
+    </select>
+
+    <select id="selectLiveUserFavoriteByFavoriteId" parameterType="Long" resultMap="LiveUserFavoriteResult">
+        <include refid="selectLiveUserFavoriteVo"/>
+        where favorite_id = #{favoriteId}
+    </select>
+
+    <insert id="insertLiveUserFavorite" parameterType="LiveUserFavorite" useGeneratedKeys="true" keyProperty="favoriteId">
+        insert into live_user_favorite
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="userId != null">user_id,</if>
+            <if test="liveId != null">live_id,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="userId != null">#{userId},</if>
+            <if test="liveId != null">#{liveId},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateLiveUserFavorite" parameterType="LiveUserFavorite">
+        update live_user_favorite
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="liveId != null">live_id = #{liveId},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where favorite_id = #{favoriteId}
+    </update>
+
+    <delete id="deleteLiveUserFavoriteByFavoriteId" parameterType="Long">
+        delete from live_user_favorite where favorite_id = #{favoriteId}
+    </delete>
+
+    <delete id="deleteLiveUserFavoriteByFavoriteIds" parameterType="String">
+        delete from live_user_favorite where favorite_id in
+        <foreach item="favoriteId" collection="array" open="(" separator="," close=")">
+            #{favoriteId}
+        </foreach>
+    </delete>
+
+    <select id="selectLiveUserFavoriteByLiveIdAndUserId" parameterType="Long" resultMap="LiveUserFavoriteResult">
+        <include refid="selectLiveUserFavoriteVo"/>
+        where live_id = #{liveId} and user_id = #{userId}
+    </select>
+
+    <delete id="deleteLiveUserFavoriteByLiveIdAndUserId" parameterType="Long">
+        delete from live_user_favorite where live_id = #{liveId} and user_id = #{userId}
+    </delete>
+
+    <select id="selectByIds" parameterType="Long" resultMap="LiveUserFavoriteResult">
+        <include refid="selectLiveUserFavoriteVo"/>
+        where
+        live_id = #{liveId} and user_id = #{userId}
+        <if test="productId != null">and product_id = #{productId}</if>
+        <if test="storeId != null">and store_id = #{storeId}</if>
+    </select>
+
+    <delete id="deleteLiveUserFavoriteByIds" parameterType="Long">
+        delete from live_user_favorite
+               where live_id = #{liveId}
+                and user_id = #{userId}
+        <if test="productId != null">and product_id = #{productId}</if>
+        <if test="storeId != null">and store_id = #{storeId}</if>
+    </delete>
+
+</mapper>

+ 79 - 0
fs-service/src/main/resources/mapper/live/LiveUserFollowMapper.xml

@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.live.mapper.LiveUserFollowMapper">
+
+    <resultMap type="LiveUserFollow" id="LiveUserFollowResult">
+        <result property="id"    column="id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="liveId"    column="live_id"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectLiveUserFollowVo">
+        select id, user_id, live_id, create_time, update_time from live_user_follow
+    </sql>
+
+    <select id="selectLiveUserFollowList" parameterType="LiveUserFollow" resultMap="LiveUserFollowResult">
+        <include refid="selectLiveUserFollowVo"/>
+        <where>
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="liveId != null "> and live_id = #{liveId}</if>
+        </where>
+    </select>
+
+    <select id="selectLiveUserFollowById" parameterType="Long" resultMap="LiveUserFollowResult">
+        <include refid="selectLiveUserFollowVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertLiveUserFollow" parameterType="LiveUserFollow" useGeneratedKeys="true" keyProperty="id">
+        insert into live_user_follow
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="userId != null">user_id,</if>
+            <if test="liveId != null">live_id,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="userId != null">#{userId},</if>
+            <if test="liveId != null">#{liveId},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateLiveUserFollow" parameterType="LiveUserFollow">
+        update live_user_follow
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="liveId != null">live_id = #{liveId},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteLiveUserFollowById" parameterType="Long">
+        delete from live_user_follow where id = #{id}
+    </delete>
+
+    <delete id="deleteLiveUserFollowByIds" parameterType="String">
+        delete from live_user_follow where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <select id="selectLiveUserFollowByLiveIdAndUserId" parameterType="LiveUserFollow" resultMap="LiveUserFollowResult">
+        <include refid="selectLiveUserFollowVo"/>
+        where live_id = #{liveId} and user_id = #{userId}
+    </select>
+
+    <delete id="deleteLiveUserFollowByLiveIdAndUserId" parameterType="LiveUserFollow">
+        delete from live_user_follow where live_id = #{liveId} and user_id = #{userId}
+    </delete>
+
+</mapper>

+ 73 - 0
fs-service/src/main/resources/mapper/live/LiveUserLikeMapper.xml

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.live.mapper.LiveUserLikeMapper">
+
+    <resultMap type="LiveUserLike" id="LiveUserLikeResult">
+        <result property="id"    column="id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="liveId"    column="live_id"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectLiveUserLikeVo">
+        select id, user_id, live_id, create_time, update_time from live_user_like
+    </sql>
+
+    <select id="selectLiveUserLikeList" parameterType="LiveUserLike" resultMap="LiveUserLikeResult">
+        <include refid="selectLiveUserLikeVo"/>
+        <where>
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="liveId != null "> and live_id = #{liveId}</if>
+        </where>
+    </select>
+
+    <select id="selectLiveUserLikeById" parameterType="Long" resultMap="LiveUserLikeResult">
+        <include refid="selectLiveUserLikeVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertLiveUserLike" parameterType="LiveUserLike" useGeneratedKeys="true" keyProperty="id">
+        insert into live_user_like
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="userId != null">user_id,</if>
+            <if test="liveId != null">live_id,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="userId != null">#{userId},</if>
+            <if test="liveId != null">#{liveId},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateLiveUserLike" parameterType="LiveUserLike">
+        update live_user_like
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="liveId != null">live_id = #{liveId},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteLiveUserLikeById" parameterType="Long">
+        delete from live_user_like where id = #{id}
+    </delete>
+
+    <delete id="deleteLiveUserLikeByIds" parameterType="String">
+        delete from live_user_like where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+    <select id="selectLiveUserLikeByIds" parameterType="Long" resultType="LiveUserLike">
+        <include refid="selectLiveUserLikeVo"/>
+        where live_id = #{liveId} and user_id = #{userId}
+    </select>
+</mapper>