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.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.web.modules.region.service.IRegionService;

/**
 * C 端 — 省市区数据
 */
@RestController
@RequestMapping("/api/region")
public class RegionAppController extends BaseController
{
    @Autowired
    private IRegionService regionService;

    /**
     * 省市区三级树，供收货地址、入驻地址等选择
     */
    @Anonymous
    @GetMapping("/tree")
    public AjaxResult tree()
    {
        return success(regionService.getRegionTree());
    }
}
