package com.crunii.micro.service.sysmgr.controller;

import com.crunii.micro.common.dto.Result;
import com.crunii.micro.domain.dto.Worker;
import com.crunii.micro.service.sysmgr.dto.sysmgr.TsmChinaRegionReqDTO;
import com.crunii.micro.service.sysmgr.dto.sysmgr.TsmChinaRegionResVO;
import com.crunii.micro.service.sysmgr.service.TsmChinaRegionService;
import com.crunii.micro.web.mvc.CurrWorker;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

/**
 * youth-cq.
 * 全国统计用区划代码和城乡划分编码
 * @author leixb
 * @since 2023-12-05 15:51
 **/
@Api(tags = "全国统计用区划代码和城乡划分编码")
@RequiredArgsConstructor
@RestController
@RequestMapping("/auth/chinaRegion")
public class TsmChinaRegionController {
    
    private final TsmChinaRegionService tsmChinaRegionService;
    
    @ApiOperation("查询")
    @PostMapping("/findRegion")
    public Result<List<TsmChinaRegionResVO>> findRegion(@CurrWorker @ApiIgnore Worker worker, @RequestBody TsmChinaRegionReqDTO req) {
        return Result.ofSuccess(tsmChinaRegionService.findRegion(worker, req));
    }

}
