

package com.mortals.xhx.protocol.complex;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.mortals.xhx.protocol.complex.matter.model.rsp.LoginRspInfo;
import lombok.Data;

@Data
public class ComplexApiRest<T> {
    private T result;
    private Integer code;
    private String message;
    private Boolean success;

    private Long timestamp;


    public static void main(String[] args) {
        String str="{\n" +
                "    \"success\": true,\n" +
                "    \"message\": \"操作成功！\",\n" +
                "    \"code\": 200,\n" +
                "    \"result\": {\n" +
                "        \"token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTnVtIjoiZ29uZ2ppIiwic2VsZkRldmljZUlkIjoiNiIsImhhbmRsZUFkZHJlc3NJZCI6IjE0OTk2NTA0ODgyMzEwNzE3NDYiLCJleHAiOjE2OTUyMjk5MTksInVzZXJJZCI6IjExMTIiLCJ3aW5kb3dJZCI6IjE0OTk2NTA1NTM0MTA1NTU5MDYifQ.ADZQR8AIo8OHtuUJBskBx3w2yaqHHsQLMSBamYvf6YE\",\n" +
                "        \"sysUser\": {\n" +
                "            \"createBy\": 1,\n" +
                "            \"createTime\": \"2021-08-16 16:38:17\",\n" +
                "            \"updateBy\": null,\n" +
                "            \"updateTime\": \"2023-08-12 10:40:34\",\n" +
                "            \"delFlag\": \"N\",\n" +
                "            \"userId\": 1112,\n" +
                "            \"userName\": \"万青青\",\n" +
                "            \"sex\": \"男\",\n" +
                "            \"loginName\": null,\n" +
                "            \"userNumber\": \"gongji\",\n" +
                "            \"dept\": null,\n" +
                "            \"deptId\": 306,\n" +
                "            \"email\": \"56462@qq.com\",\n" +
                "            \"address\": null,\n" +
                "            \"idCard\": \"522121199208022252\",\n" +
                "            \"phoneNumber\": \"18888888888\",\n" +
                "            \"workPhone\": \"17778445521\",\n" +
                "            \"avatar\": \"/mnt/jpg/2023-08-12/3bf75fd4301da7469c83e8e35e233c65.jpg\",\n" +
                "            \"startNumber\": null,\n" +
                "            \"userType\": null,\n" +
                "            \"password\": \"632a02caecc0bb7b\",\n" +
                "            \"passwordState\": \"Y\",\n" +
                "            \"salt\": \"ZGimxeDr\",\n" +
                "            \"status\": \"Y\",\n" +
                "            \"remark\": \"\",\n" +
                "            \"areaCode\": \"510100000000\",\n" +
                "            \"hometown\": null,\n" +
                "            \"windowId\": null,\n" +
                "            \"centerUserId\": \"123456789\",\n" +
                "            \"value\": null,\n" +
                "            \"label\": null,\n" +
                "            \"dkUserId\": null,\n" +
                "            \"dkUnionId\": null,\n" +
                "            \"changePwTime\": \"2023-08-25 10:03:46\",\n" +
                "            \"sysRole\": null,\n" +
                "            \"isWaiter\": \"N\"\n" +
                "        },\n" +
                "        \"selfDeviceInfo\": {\n" +
                "            \"selfDeviceId\": \"6\",\n" +
                "            \"deviceLogo\": \"uutest\",\n" +
                "            \"note\": \"张远海\",\n" +
                "            \"userId\": \"1112\",\n" +
                "            \"windowId\": \"1499650553410555906\",\n" +
                "            \"createBy\": \"1\",\n" +
                "            \"createTime\": \"2023-08-25 15:11:41\",\n" +
                "            \"updateBy\": null,\n" +
                "            \"updateTime\": null,\n" +
                "            \"delFlag\": \"N\",\n" +
                "            \"coordinate\": \"104.090953,30.767351\",\n" +
                "            \"ticketTitle\": null,\n" +
                "            \"tips\": null,\n" +
                "            \"workHours\": null,\n" +
                "            \"telephone\": \"9528\",\n" +
                "            \"floorId\": \"1499650525505851393\",\n" +
                "            \"handleAddressId\": \"1499650488231071746\"\n" +
                "        }\n" +
                "    },\n" +
                "    \"timestamp\": 1695193919663\n" +
                "}\n";

        ComplexApiRest<LoginRspInfo> loginRspInfoComplexApiRest = JSON.parseObject(str, new TypeReference<ComplexApiRest<LoginRspInfo>>() {
        });

        System.out.println(JSON.toJSONString(loginRspInfoComplexApiRest));

    }
}
