hjl
2024-05-21 f0d8f535a4c09dee9d786d8fb13c9b9918addaa9
ruoyi-service/ruoyi-management/src/main/java/com/ruoyi/management/controller/TUserController.java
@@ -18,8 +18,10 @@
import com.ruoyi.study.api.vo.VipOrderVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
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 java.util.List;
@@ -41,6 +43,7 @@
    @Autowired
    private StudyClient studyClient;
    @PostMapping("/userList")
    @ApiOperation(value = "用户列表", tags = {"用户管理"})
    public AjaxResult<PageInfo<AppUserVO>> couponReceive(AppUserQuery query) {
@@ -111,6 +114,7 @@
        return AjaxResult.success(data);
    }
    @PostMapping("/freeze")
    @ApiOperation(value = "冻结/解冻", tags = {"用户管理"})
    public AjaxResult freeze(Integer id) {
@@ -118,23 +122,26 @@
        if (byId.getState() == 1) {
            studyClient.freeze(id);
            return AjaxResult.success("冻结成功");
        }else {
        } else {
            studyClient.freeze(id);
            return AjaxResult.success("解冻成功");
        }
    }
    @PostMapping("/getVipSet")
    @ApiOperation(value = "获取会员设置", tags = {"用户管理"})
    public AjaxResult<List<TVipSet>> getVipSet() {
        List<TVipSet> list = vipSetService.list(new QueryWrapper<TVipSet>().orderByAsc("amount"));
        return AjaxResult.success(list);
    }
    @PostMapping("/getVipSet1")
    @ApiOperation(value = "获取会员设置", tags = {"家长端"})
    public R<List<TVipSet>> getVipSet1() {
        List<TVipSet> list = vipSetService.list(new QueryWrapper<TVipSet>().orderByAsc("amount"));
        return R.ok(list);
    }
    @PostMapping("/setVipSet")
    @ApiOperation(value = "保存会员设置", tags = {"用户管理"})
    public AjaxResult setVipSet(@RequestBody VipSetVO vo) {
@@ -146,6 +153,7 @@
        }
        return AjaxResult.success("保存成功");
    }
    @PostMapping("/vipOrderList")
    @ApiOperation(value = "列表查询", tags = {"会员管理"})
    public AjaxResult<PageInfo<VipOrderVO>> vipOrderList(AppUserQuery query) {
@@ -153,11 +161,13 @@
        PageInfo<VipOrderVO> data = studyClient.vipOrderList(query).getData();
        return AjaxResult.success(data);
    }
    @PostMapping("/vipBack")
    @ApiOperation(value = "会员退款", tags = {"会员管理"})
    public AjaxResult vipOrderList(Integer id) {
        studyClient.vipBack(id);
        return AjaxResult.success();
    }
}