From 14b303934f8bbbfe4b14d7787d0a7d7fd2ff26f9 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期五, 16 八月 2024 14:28:52 +0800
Subject: [PATCH] 管理后台文件上传接口编写

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java |   47 ++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 42 insertions(+), 5 deletions(-)

diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java
index b2f94b8..97f0451 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java
@@ -1,6 +1,7 @@
 package com.ruoyi.other.controller;
 
 
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.core.web.page.PageInfo;
@@ -33,29 +34,39 @@
     @Autowired
     private TVipService vipService;
     @PostMapping("/saveVip")
-    @ApiOperation(value = "会员添加")
+    @ApiOperation(tags = {"管理后台-会员管理"},value = "会员添加")
     public AjaxResult saveVip(@RequestBody TVip dto) {
         vipService.save(dto);
         return AjaxResult.success();
     }
     @GetMapping("/delete")
-    @ApiOperation(value = "会员删除")
+    @ApiOperation(tags = {"管理后台-会员管理"},value = "会员删除")
     public AjaxResult delete(Integer id) {
         vipService.removeById(id);
         return AjaxResult.success();
     }
     @PostMapping("/updateVip")
-    @ApiOperation(value = "会员修改")
+    @ApiOperation(tags = {"管理后台-会员管理"},value = "会员修改")
     public AjaxResult updateVip(@RequestBody TVip dto) {
             vipService.updateById(dto);
         return AjaxResult.success();
     }
     @GetMapping("/getInfo")
-    @ApiOperation(value = "会员查看详情")
+    @ApiOperation(tags = {"管理后台-会员管理"},value = "会员查看详情")
     public AjaxResult<TVip> getInfo(Integer id) {
         return AjaxResult.ok(vipService.getById(id));
     }
-    @ApiOperation(value = "会员列表分页查询")
+
+    /**
+     * 远程调用
+     * @param id
+     * @return
+     */
+    @PostMapping("/getInfo1")
+    public R<TVip> getInfo1(@RequestParam("id")Integer id) {
+        return R.ok(vipService.getById(id));
+    }
+    @ApiOperation(tags = {"管理后台-会员管理"},value = "会员列表分页查询")
     @PostMapping(value = "/pageList")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "pageCurr", value = "分页参数,当前页码", required = true),
@@ -78,5 +89,31 @@
         return R.ok(idNameMap);
     }
 
+    /**
+     * 获取最高抵扣、最低起步价,最高折扣的会员
+     * @param type 1=最高抵扣、2=最低起步价,3=最高折扣
+     * @return
+     */
+    @PostMapping(value = "/getVipInfoByType")
+    public R<TVip> getVipInfoByType(@RequestParam("type") Integer type){
+        switch (type){
+            case 1:
+                return R.ok(vipService.getOne(Wrappers.lambdaQuery(TVip.class)
+                        .eq(TVip::getReveal,1)
+                        .orderByDesc(TVip::getMaximumDeduction)
+                        .last("LIMIT 1")));
+            case 2:
+                return R.ok(vipService.getOne(Wrappers.lambdaQuery(TVip.class)
+                        .eq(TVip::getReveal,1)
+                        .orderByAsc(TVip::getMonthlyCard)
+                        .last("LIMIT 1")));
+            default:
+                return R.ok(vipService.getOne(Wrappers.lambdaQuery(TVip.class)
+                        .eq(TVip::getReveal,1)
+                        .orderByDesc(TVip::getMonthlyCardDiscount)
+                        .last("LIMIT 1")));
+        }
+    }
+
 }
 

--
Gitblit v1.7.1