package com.starry.admin.modules.system.controller;

import com.starry.admin.modules.system.service.ISysAdministrativeAreaDictInfoService;
import com.starry.common.result.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import javax.annotation.Resource;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 行政区域字典信息Controller
 *
 * @author admin
 * @since 2024-04-03
 */
@Api(tags = "行政区域字典", description = "行政区域字典信息相关接口")
@RestController
@RequestMapping("/sys/area")
public class AdministrativeAreaDictInfoController {
    @Resource
    private ISysAdministrativeAreaDictInfoService playAdministrativeAreaDictInfoService;

    /**
     * 查询省/市行政区域代码
     */
    @ApiOperation(value = "获取行政区域树", notes = "查询省/市行政区域代码的树形结构")
    @ApiResponses({@ApiResponse(code = 200, message = "操作成功")})
    @PreAuthorize("@customSs.hasPermission('play:info:list')")
    @GetMapping("/tree")
    public R list() throws Exception {
        return R.ok(playAdministrativeAreaDictInfoService.selectTree("2"));
    }

}
