package com.yx.face.service.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

@FeignClient(name = "tbDeviceFaceService", url = "${face.service.tb}", path = "/Face")
public interface TBDeviceFaceService {
/*    //示例
    @RequestLine("GET /api/documents/{contentType}")
    @Headers("Accept: {contentType}")
    Response getDocumentByType(@Param("contentType") String type);

    //示例
    @GetMapping("/api/documents")
    String getDocument(@RequestHeader(name = "Token") String Token);*/

    /**
     * @param map {
     *            "SN": "555555",
     *            "taskId": 1,
     *            "Data": [{
     *            "pin": "777",
     *            "name": "张三",
     *            "photo": "/9j/4AAQSklJpSm.........9k=",
     *            "cardid": "1234567890",
     *            "validPeriodStart": "2018-06-23 08:00:00",
     *            "validPeriodEnd": "2019-06-23 08:00:00",
     *            "ruleId": "1",
     *            "userType": 0
     *            }]
     *            }<br>
     * @return {"errCode":"00"} <br>
     * @description: 3.1、添加人员/修改 (用于小批量（1-10条）数据添加修改 <br>
     * @date: 2021/5/28 15:10 <br>
     * @author: PWB <br>
     */
    @PostMapping("/downUser")
    Map<String, Object> downUser(@RequestBody Map<String, Object> map);


    /**
     * @param map {
     *            "SN": "555555",
     *            "taskId": 2,
     *            "Data": [{"pin": "777"},{"pin": "555"}]
     *            }<br>
     * @return {"errCode":"00"}<br>
     * @description: 3.2、删除人员信息  删除所有时 "Data": "all"<br>
     * @date: 2021/5/28 15:14 <br>
     * @author: PWB <br>
     */
    @PostMapping("/delUser")
    Map<String, Object> delUser(@RequestBody Map<String, Object> map);


    /**
     * @param map {
     *            "SN": "555555",
     *            "maxCount": "1",
     *            "updateTime": "10",
     *            "offset": 1,
     *            "taskId": 1
     *            }<br>
     * @return {
     * "errCode": "00",
     * "totalNum": "5",
     * "updateTime": "11",
     * "data": [{
     * "pin": "777",
     * "name": "张三",
     * "photo": "/9j/4AAQSklJpSm.........9k=",
     * "cardid": "1234567890",
     * "validPeriodStart": "2018-06-23 08:00:00",
     * "validPeriodEnd": "2019-06-23 08:00:00",
     * "opt": 1,
     * "userType": 0
     * }]
     * } <br>
     * @description: 3.6、同步人员信息（分批同步大量数据） <br>
     * @date: 2021/5/28 15:18 <br>
     * @author: PWB <br>
     */
    @PostMapping("/syncUsers")
    Map<String, Object> syncUsers(@RequestBody Map<String, Object> map);


    /**
     * @param map {
     *            "SN": "555555",
     *            "data": {
     *            "offset": [1,2],
     *            "pin": [
     *            {
     *            "errmsg": "照片不规范",
     *            "pin": "10"
     *            }
     *            ],
     *            "updateTime": 0
     *            },
     *            "direction": 0,
     *            "magic": 0,
     *            "taskId": 12,
     *            "taskState": 1
     *            }<br>
     * @return {"errCode":"00"} <br>
     * @description: 3.7、上报任务结果处理 <br>
     * @date: 2021/5/28 15:24 <br>
     * @author: PWB <br>
     */
    @PostMapping("/pushTaskResult")
    Map<String, Object> pushTaskResult(@RequestBody Map<String, Object> map);


    /**
     * @param map {
     *            "SN": ["555555"],
     *            "data": {
     *            "cmd": "pushUsers",
     *            "direction": 0,
     *            "datas": ""
     *            }
     *            }<br>
     * @return {"errCode":"00","taskId": 12} <br>
     * @description: 3.8、获取任务ID <br>
     * @date: 2021/5/28 15:28 <br>
     * @author: PWB <br>
     */
    @PostMapping("/getTaskId")
    Map<String, Object> getTaskId(@RequestBody Map<String, Object> map);

    /**
     * @param map <br>
     * @return java.lang.String <br>
     * @description: 中间件应答
     * * 请求参数
     * * {"SN": ["55555"],
     * * "type": "doorControl",
     * * "taskId": 31,
     * * "Data": {
     * * "doorControl": "1,5",
     * * "tts": "远程开门语音播报"}}
     * * 结果：
     * * {"errCode":"00",
     * * "msg":"命令下发成功",
     * * "taskId":31} <br>
     * @date: 2021/5/28 14:51 <br>
     * @author: PWB <br>
     */
    @PostMapping("/sendControl")
    Map<String, Object> sendControl(@RequestBody Map<String, Object> map);



    /**
     * @param map {"SN":"555555"}<br>
     * @return {
     * "errCode": "00",
     * "data": [
     * { "SN": "55555",
     * "devIP": "192.168.11.115",
     * "orgId": "888888",
     * "swipeCardCount": 13,
     * "userCount": 22,
     * "version": "2.0.9.10",
     * "lastTime": "2019-04-23 15:40:21",
     * "online": 1,
     * "onlineStr": "在线"
     * }
     * ]
     * } <br>
     * @description: 2.3、设备查询 <br>
     * @date: 2021/5/28 15:00 <br>
     * @author: PWB <br>
     */
    @PostMapping("/getDeviceInfo")
    Map<String, Object> getDeviceInfo(@RequestBody Map<String, Object> map);


    /**
     * @param map {"page": 1,"pageSize": 10  }<br>
     * @return {
     * "errCode": "00",
     * "totalNum": 1,
     * "data": [
     * {
     * "SN": "55555",
     * "devIP": "192.168.11.115",
     * "orgId": "888888",
     * "swipeCardCount": 13,
     * "userCount": 22,
     * "version": "2.0.9.10",
     * "lastTime": "2019-04-23 15:40:21",
     * "online": 1,
     * "onlineStr": "在线"
     * }
     * ]
     * } <br>
     * @description: 2.4、设备查询(分页) <br>
     * @date: 2021/5/28 15:03 <br>
     * @author: PWB <br>
     */
    @PostMapping("/getDeviceInfoPage")
    Map<String, Object> getDeviceInfoPage(@RequestBody Map<String, Object> map);

}
