package com.docus.server.report.controller;

import com.alibaba.fastjson.JSON;
import com.docus.server.report.api.dto.SdNurDocFailRequest;
import com.docus.server.report.api.dto.SdNurseInsertSugarRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Api(tags = "项目 模拟数据测试接口")
@RestController
@RequestMapping("/api/mockTest")
public class MockTestController {

    @PostMapping("/nurseReturnMock")
    @ApiOperation("护理请求模拟数据")
    public String nurseReturnMock(@RequestBody SdNurseInsertSugarRequest request){
        log.info("收到护理请求消息：{}，返回模拟数据！",JSON.toJSONString(request));
        String result="{\n" +
                "    \"data\": [\n" +
                "        {\n" +
                "            \"form_type\": \"bodyTemperature\",\n" +
                "            \"form_id\": \"bodyTemperature_002064786000_3\",\n" +
                "            \"create_time\": \"2023-06-25 16:44:08\",\n" +
                "            \"creator_name\": \"管理员\",\n" +
                "            \"form_name\": \"体温单\",\n" +
                "            \"patient_id\": \"002064786000\",\n" +
                "            \"visit_id\": \"3\",\n" +
                "            \"zyh\": \"686136\",\n" +
                "            \"update_time\": \"2023-06-25 16:44:08\",\n" +
                "            \"updater_name\": \"管理员\",\n" +
                "            \"url\": \"http://192.168.5.128:9091/crNursing/print/converttopdf//002064786000_3/bodyTemperature_002064786000_3_1.pdf\",\n" +
                "\"FILES_NUMBER\": \"2\"\n" +
                "\n" +
                "        },\n" +
                "        {\n" +
                "            \"form_type\": \"bodyTemperature\",\n" +
                "            \"form_id\": \"bodyTemperature_002091232400_3\",\n" +
                "            \"create_time\": \"2023-06-25 16:28:40\",\n" +
                "            \"creator_name\": \"管理员\",\n" +
                "            \"form_name\": \"体温单\",\n" +
                "            \"patient_id\": \"002091232400\",\n" +
                "            \"visit_id\": \"3\",\n" +
                "            \"zyh\": \"329630\",\n" +
                "            \"update_time\": \"2023-06-25 16:44:11\",\n" +
                "            \"updater_name\": \"管理员\",\n" +
                "            \"url\": \"http://192.168.5.128:9091/crNursing/print/converttopdf//002091232400_3/bodyTemperature_002091232400_3_1.pdf\",\n" +
                "\"FILES_NUMBER\": \"2\"\n" +
                "\n" +
                "        }\n" +
                "]\n" +
                "}";
        System.out.println(result);
        return result;
    }

    @PostMapping("/nurseErrMock")
    @ApiOperation("护理异常推送模拟数据")
    public String nurseReturnMock(@RequestBody SdNurDocFailRequest request){
        log.info("收到护理异常推送消息：{}，返回模拟数据！", JSON.toJSONString(request));
        String result="{\"error_code\":\"1\",\"error_msg\":\"接收成功\"}";
        System.out.println(result);
        return result;
    }

    public static void main(String[] args) {
        String result="{\n" +
                "    \"data\": [\n" +
                "        {\n" +
                "            \"form_type\": \"bodyTemperature\",\n" +
                "            \"form_id\": \"bodyTemperature_002064786000_3\",\n" +
                "            \"create_time\": \"2023-06-25 16:44:08\",\n" +
                "            \"creator_name\": \"管理员\",\n" +
                "            \"form_name\": \"体温单\",\n" +
                "            \"patient_id\": \"002064786000\",\n" +
                "            \"visit_id\": \"3\",\n" +
                "            \"zyh\": \"686136\",\n" +
                "            \"update_time\": \"2023-06-25 16:44:08\",\n" +
                "            \"updater_name\": \"管理员\",\n" +
                "            \"url\": \"http://192.168.5.128:9091/crNursing/print/converttopdf//002064786000_3/bodyTemperature_002064786000_3_1.pdf\",\n" +
                "\"FILES_NUMBER\": \"2\"\n" +
                "\n" +
                "        },\n" +
                "        {\n" +
                "            \"form_type\": \"bodyTemperature\",\n" +
                "            \"form_id\": \"bodyTemperature_002091232400_3\",\n" +
                "            \"create_time\": \"2023-06-25 16:28:40\",\n" +
                "            \"creator_name\": \"管理员\",\n" +
                "            \"form_name\": \"体温单\",\n" +
                "            \"patient_id\": \"002091232400\",\n" +
                "            \"visit_id\": \"3\",\n" +
                "            \"zyh\": \"329630\",\n" +
                "            \"update_time\": \"2023-06-25 16:44:11\",\n" +
                "            \"updater_name\": \"管理员\",\n" +
                "            \"url\": \"http://192.168.5.128:9091/crNursing/print/converttopdf//002091232400_3/bodyTemperature_002091232400_3_1.pdf\",\n" +
                "\"FILES_NUMBER\": \"2\"\n" +
                "\n" +
                "        }\n" +
                "]\n" +
                "}";
        System.out.println(result);
    }
}
