package com.oo.eye.net;

import com.app.baselibrary.bean.UserInfo;
import com.oo.eye.bean.EyeChartsBean;
import com.oo.eye.bean.EyeHistroyBean;
import com.oo.eye.bean.InitDataBean;
import com.oo.seex.netlibrary.net.response.NewResponseImpl;

import java.util.ArrayList;

import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import rx.Observable;

/**
 * Created by xucon on 2017/12/26.
 */

public interface EyeApiService {

	/**
	 * 上传视力测试结果
	 */
	@FormUrlEncoded
	@POST("/SeexApi/Vision/add")
	Observable<NewResponseImpl<String>> postEyeTestData(@Field("deviceSN") String deviceSn
			, @Field("left") String leftEye, @Field("right") String rightEye
			, @Field("leftLine") String leftLine, @Field("rightLine") String rightLine);
	/**
	 * 获取视力测试历史结果
	 */
	@GET("/SeexApi/Vision")
	Observable<NewResponseImpl<ArrayList<EyeHistroyBean>>> getEyeTestData(@Query("deviceSN") String deviceSn
			, @Query("page") int page, @Query("limit") int limit);

	/**
	 * 获取视力测试历史结果
	 */
	@GET("/SeexApi/Vision/charts")
	Observable<NewResponseImpl<ArrayList<EyeChartsBean>>> getEyeTestCharts(@Query("deviceSN") String deviceSn
			, @Query("limit") int limit);

	/**
	 * @param deviceSN
	 * @return
	 */
	@GET("/SeexApi/Device/status")
	Observable<NewResponseImpl<UserInfo>> getUserInfo(@Query("deviceSN") String deviceSN);
	/**
	 * 获取初始数据
	 */
	@GET("/SeexApi/Teenage/default")
	Observable<NewResponseImpl<InitDataBean>> getEyeInit(@Query("deviceSN") String deviceSn);
}
