From a4fc8d1a88374ee4e1aba8acde5567e0abe9f659 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期五, 30 八月 2024 09:50:40 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile

---
 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java |   30 +++++++++++++++++++++++++-----
 1 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java
index 898a5eb..42de42e 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java
@@ -5,12 +5,14 @@
 import com.ruoyi.account.api.vo.GetAppUserVipDetail;
 import com.ruoyi.account.service.TAppUserVipDetailService;
 import com.ruoyi.common.core.domain.R;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.security.service.TokenService;
+import com.ruoyi.other.api.domain.TVip;
+import com.ruoyi.other.api.feignClient.VipClient;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import java.util.List;
 
 /**
  * @author zhibing.pu
@@ -22,6 +24,8 @@
 	
 	@Resource
 	private TAppUserVipDetailService appUserVipDetailService;
+	@Resource
+	private TokenService tokenService;
 	
 	/**
 	 * 获取用户当前有效的vip明细
@@ -36,6 +40,22 @@
 				.last(" and now() between start_time and end_time"));
 		return R.ok(one);
 	}
-	
+
+	@Resource
+	private VipClient vipClient;
+
+	@GetMapping("/getVipUseDetail")
+	@ApiOperation(value = "生效会员列表", tags = {"小程序-个人中心"})
+	public R<List<TAppUserVipDetail>> getVipUseDetail(){
+        Long userId = tokenService.getLoginUserApplet().getUserId();
+        List<TAppUserVipDetail> list = appUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getAppUserId, userId).last(" and now() between start_time and end_time order by start_time desc").list();
+
+		for (TAppUserVipDetail tAppUserVipDetail : list) {
+            TVip data = vipClient.getInfo1(tAppUserVipDetail.getVipId()).getData();
+            tAppUserVipDetail.setVipName(data.getName());
+        }
+        return R.ok(list);
+	}
+
 	
 }

--
Gitblit v1.7.1