mitao
2025-02-10 0af4429cca70d12e8e84cb2773b76ed1a72128c4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package com.ruoyi.member.controller.management;
 
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.page.PageDTO;
import com.ruoyi.member.controller.management.dto.MgtMemberDTO;
import com.ruoyi.member.controller.management.dto.MgtMemberPointsQuery;
import com.ruoyi.member.controller.management.dto.MgtMemberQuery;
import com.ruoyi.member.controller.management.vo.MgtMemberPointsVO;
import com.ruoyi.member.controller.management.vo.MgtMemberVO;
import com.ruoyi.member.service.IMemberService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
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;
 
/**
 * @author mitao
 * @date 2024/5/27
 */
@RestController
@RequestMapping("/mgt/member")
@RequiredArgsConstructor
@Api(value = "管理后台-会员管理相关接口", tags = "管理后台-会员管理相关接口")
public class MgtMemberController {
 
    private final IMemberService memberService;
 
    /**
     * 获取会员管理分页列表
     *
     * @param query 会员列表查询对象
     * @return PageDTO<MgtMemberVO>
     */
    @ApiOperation(value = "获取会员管理分页列表", notes = "获取会员管理分页列表")
    @PostMapping("/page")
    public R<PageDTO<MgtMemberVO>> getMemberPage(@Validated @RequestBody MgtMemberQuery query) {
        return R.ok(memberService.getMemberPage(query));
    }
 
    @ApiOperation("查看详情")
    @GetMapping("/detail/{id}")
    public R<MgtMemberVO> getMemberById(@PathVariable("id") Long id) {
        return R.ok(memberService.getMemberById(id));
    }
 
    /**
     * 获取积分明细分页列表
     *
     * @param query 会员积分明细查询对象
     * @return PageDTO<MgtMemberPointsVO>
     */
    @ApiOperation("查看详情-积分明细")
    @PostMapping("/points/detail")
    public R<PageDTO<MgtMemberPointsVO>> getMemberPoints(
            @Validated @RequestBody MgtMemberPointsQuery query) {
        return R.ok(memberService.getMemberPoints(query));
    }
 
    /**
     * 编辑用户会员分类
     * @param dto
     * @return
     */
    @ApiOperation("编辑用户会员分类")
    @PostMapping("/update/vipClassify")
    public R<?> updMemberClassify(@RequestBody MgtMemberDTO dto) {
        memberService.updMemberClassify(dto);
        return R.ok();
    }
}