mitao
2024-12-03 0832f454bc53eafee9c6b7eedb32481a021257c3
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
package com.sinata.web.controller.backend;
 
import com.sinata.common.core.domain.R;
import com.sinata.system.domain.vo.SysDepartmentVO;
import com.sinata.system.enums.DepartmentEnum;
import com.sinata.system.service.SysDepartmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
/**
 * <p>
 * 区域表 前端控制器
 * </p>
 *
 * @author mitao
 * @since 2024-12-02
 */
@Api(tags = {"区域管理相关接口"})
@RestController
@RequestMapping("/backend/sysDepartment")
@RequiredArgsConstructor
public class SysDepartmentController {
    private final SysDepartmentService sysDepartmentService;
 
    /**
     * 获取区域树
     * @return
     */
    @ApiOperation("获取区域树")
    @PostMapping("/tree")
    public R<List<SysDepartmentVO>> list() {
      return R.ok(sysDepartmentService.listByType(DepartmentEnum.REGION.getCode()));
    }
}