package com.sptg.third.api.feigns.grid;

import com.sptg.common.core.beans.ResultBean;
import com.sptg.device.api.dto.DeviceDto;
import com.sptg.device.api.entity.Device;
import com.sptg.estate.api.entity.AccessRecords;
import com.sptg.third.api.feigns.grid.fallback.GridDoorDeviceFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * Created By lidexi in 2021/1/13
 **/
@FeignClient(value = "smart-house-third", fallbackFactory = GridDoorDeviceFeignFallbackFactory.class)
public interface GridDoorDeviceFeign {

    /**
     * 推送门禁设备到网格
     * @param device
     * @return
     */
    @PostMapping(value = "/third/grid/door/device/push")
    public ResultBean<String> gridDevicePush(@RequestBody Device device);

    /**
     * 推送出入记录到网格
     * @param accessRecords
     * @return
     */
    @PostMapping(value = "/third/grid/door/device/accessrecord/push")
    public ResultBean<String> gridAccessrecordPush(@RequestBody AccessRecords accessRecords);
}
