package com.jwipc.sys.controller.pc;

import com.jwipc.sys.logic.AreaLogic;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static com.jwipc.sys.constant.ModuleConst.MODULE_ROOT;

/**
 * <p>国家省城市数据接口</p>
 *
 * @author ZhangJie
 * @version 1.0
 * @since JDK 1.8
 */
@RestController
@RequestMapping(MODULE_ROOT + "/area/rest")
@RequiredArgsConstructor
public class AreaRestController {
    private final AreaLogic areaLogic;
    /**
     * 查找国家-省市下拉框，用于供应商注册时省市数据加载
     */
    @GetMapping("/query")
    public ResponseEntity getByParent(String pCode) {
        return ResponseEntity.ok(areaLogic.getByParent(pCode));
    }
}
