puzhibing
2026-04-30 afbd8e340732c17a56693ad425dca59d8a0a8f37
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
77
78
79
80
81
82
83
84
85
86
package com.xiaopeng.account.controller;
 
import com.xiaopeng.account.model.dto.SysGroupAddDTO;
import com.xiaopeng.account.model.dto.SysGroupEditDTO;
import com.xiaopeng.account.model.query.GroupUserPageQuery;
import com.xiaopeng.account.model.query.SysGroupPageQuery;
import com.xiaopeng.account.model.vo.GroupUserVO;
import com.xiaopeng.account.model.vo.SysGroupDetailVO;
import com.xiaopeng.account.model.vo.SysGroupPageVO;
import com.xiaopeng.account.service.ISysGroupService;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.web.page.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Lazy;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
/**
 * <p>
 * 权限组管理 前端控制器
 * </p>
 *
 * @author mitao
 * @since 2026-02-03
 */
@Api(tags = "权限组管理")
@RequiredArgsConstructor(onConstructor_ = @Lazy)
@RestController
public class SysGroupController {
    private final ISysGroupService sysGroupService;
 
 
    @ApiOperation(value = "新增权限组", tags = {"管理后台-权限组管理"})
    @PostMapping("/api/v1/group/add")
    public R<?> add(@Validated @RequestBody SysGroupAddDTO dto) {
        sysGroupService.addGroup(dto);
        return R.ok();
    }
 
    @ApiOperation(value = "编辑权限组", tags = {"管理后台-权限组管理"})
    @PostMapping("/api/v1/group/edit")
    public R<?> edit(@Validated @RequestBody SysGroupEditDTO dto) {
        sysGroupService.editGroup(dto);
        return R.ok();
    }
 
    @ApiOperation(value = "权限组详情", tags = {"管理后台-权限组管理"})
    @GetMapping("/api/v1/group/queryById")
    public R<SysGroupDetailVO> queryById(@ApiParam(value = "权限组id", required = true) @RequestParam Long id) {
        SysGroupDetailVO detail = sysGroupService.getGroupDetail(id);
        return R.ok(detail);
    }
 
    @ApiOperation(value = "权限组分页列表", tags = {"管理后台-权限组管理"})
    @PostMapping("/api/v1/group/pageList")
    public R<PageInfo<SysGroupPageVO>> pageList(@Validated @RequestBody SysGroupPageQuery query) {
        PageInfo<SysGroupPageVO> pageInfo = sysGroupService.pageList(query);
        return R.ok(pageInfo);
    }
 
    @ApiOperation(value = "通过权限组id查询绑定账号列表", tags = {"管理后台-权限组管理"})
    @PostMapping("/api/v1/group/queryUserPageList")
    public R<PageInfo<GroupUserVO>> queryUserPageList(@Validated @RequestBody GroupUserPageQuery query) {
        PageInfo<GroupUserVO> pageInfo = sysGroupService.queryUserPageList(query);
        return R.ok(pageInfo);
    }
 
    @ApiOperation(value = "删除权限组", tags = {"管理后台-权限组管理"})
    @DeleteMapping("/api/v1/group")
    @ApiImplicitParam(name = "id", value = "权限组ID")
    public R<?> deleteById(@RequestParam Long id) {
        sysGroupService.deleteById(id);
        return R.ok();
    }
 
    @GetMapping("/logan/inner/group/getPhoneDesensitization")
    public R<String> getPhoneDesensitization(@RequestParam String phoneNumber) {
        return R.ok(sysGroupService.getPhoneDesensitization(phoneNumber));
    }
 
 
}