package com.mosty.sjzx.remote;

import com.alibaba.fastjson.JSON;
import com.mosty.base.feign.service.MostyYszxFeignService;
import com.mosty.base.model.vo.yszx.TbYsDlQuery;
import com.mosty.base.model.vo.yszx.TbYsGajgQuery;
import com.mosty.common.base.domain.ResponseResult;
//import com.mosty.yszx.bean.vo.TbYsDlVo;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by 张海军 on 2022/7/14 19:50
 *
 * @ClassName this.tbYsDlRemoteService
 */
@Slf4j
@Service
@AllArgsConstructor
public class TbYszxAdapRemoteService {

    private final MostyYszxFeignService mostyYszxFeignService;

    // 查询地理要素
    public Object queryAll( TbYsDlQuery dto) {
        ResponseResult responseResult = this.mostyYszxFeignService.queryAll(dto);
        if (responseResult == null || !responseResult.isSuccess()) {
            log.error("查询地理要素异常Result = {}", JSON.toJSONString(responseResult));
            return null;
        }
        return responseResult.getData();
    }

    // 查询公安机关要素
    public Object getGajgAll( TbYsGajgQuery dto) {
        ResponseResult responseResult = this.mostyYszxFeignService.getGajgAll(dto);
        if (responseResult == null || !responseResult.isSuccess()) {
            log.error("查询公安机关要素异常Result = {}", JSON.toJSONString(responseResult));
            return null;
        }
        return responseResult.getData();
    }
}
