package com.ruoyi.web.modules.region.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.web.modules.region.service.IRegionService;

/**
 * 平台端 — 省市区数据
 */
@RestController
@RequestMapping("/agri/region")
public class RegionController extends BaseController
{
    @Autowired
    private IRegionService regionService;

    /**
     * 省市区三级树，供注册地址、经营地址等选择
     */
    @GetMapping("/tree")
    public AjaxResult tree()
    {
        return success(regionService.getRegionTree());
    }
}
