package com.yfyy.yingtan.http;

import com.dtflys.forest.annotation.*;
import com.dtflys.forest.http.ForestResponse;
import com.yfyy.yingtan.bean.request.NonLoraDataReqBean;
import com.yfyy.yingtan.bean.response.BaseResBean;
import com.yfyy.yingtan.bean.response.LoginResBean;
import com.yfyy.yingtan.bean.request.SyncReqBean;
import com.yfyy.yingtan.ApplicationCons;

import java.util.List;
import java.util.Map;

@BaseRequest(baseURL = ApplicationCons.hostUrl)
public interface YingtanClient {

    /**
     * 聪明的你一定看出来了@Get注解代表该方法专做GET请求
     * 在url中的{0}代表引用第一个参数，{1}引用第二个参数
     */
    @Get("api-usersystem/user/login?loginName={0}&password={1}")
    ForestResponse<BaseResBean<LoginResBean>> login(String loginName, String password);

    // 物联设备基础数据上报
    @Post("api-projectdatamanage/equipmentsync/sync")
    Map sync(@Header("Authenticator") String token, @JSONBody List<SyncReqBean> syncReqBean);

    // 物联设备基础数据上报
    @Post("/api-devicelog-collect/data/NonLoraData")
    Map NonLoraData(@Header("Authenticator") String token, @JSONBody NonLoraDataReqBean nonLoraDataReqBean);
}