package com.backendsys.modules.system.controller;

import com.backendsys.modules.common.config.security.annotations.Anonymous;
import com.backendsys.modules.common.utils.Result;
import com.backendsys.modules.system.entity.SysCity;
import com.backendsys.modules.system.service.SysCityService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Validated
@RestController
@Tag(name = "省市区域枚举")
public class SysCityController {

    @Autowired
    private SysCityService sysCityService;

    @Anonymous
    @Operation(summary = "获取省市区域信息")
    @GetMapping("/api/system/city/getCityList")
    public Result getSysCity(@Validated SysCity sysCity) {
        return Result.success().put("data", sysCityService.selectCityList(sysCity));
    }

}
