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

import com.starry.admin.modules.system.service.ISysAdministrativeAreaDictInfoService;
import com.starry.common.result.R;
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;

import javax.annotation.Resource;

/**
 * 行政区域字典信息Controller
 *
 * @author admin
 * @since 2024-04-03
 */
@RestController
@RequestMapping("/sys/area")
public class AdministrativeAreaDictInfoController {
    @Resource
    private ISysAdministrativeAreaDictInfoService playAdministrativeAreaDictInfoService;

    /**
     * 查询省/市行政区域代码
     */
    @PreAuthorize("@customSs.hasPermission('play:info:list')")
    @GetMapping("/tree")
    public R list() throws Exception {
        return R.ok(playAdministrativeAreaDictInfoService.selectTree("2"));
    }

}
