export default [
  {
    url: "/gateway/org/back/roleService/query",
    type: "post",
    response: (req, res, next) => {
      return {
        head: {
          requestId: "89ddd8cb218a9bf16bfae38afe12f1f9",
          errorCode: "0",
          timestamp: 1588932050331,
          time: 25,
          gtime: 37,
        },
        body: {
          data: [
            {
              entitleInsLevel: "总公司",
              isPost: "Y",
              isValid: "N",
              roleId: "4e387594bd954f688f83292259f963bb",
              roleName: "金牛风控",
              roleType: "1",
              remark: "测试备注",
            },
            {
              entitleInsLevel: "总公司;省公司;分公司",
              isPost: "N",
              isValid: "Y",
              roleId: "b524d6ed2c20407bac1c08b6443f8ed0",
              roleName: "**银行",
              roleType: "1",
              remark: "这是一条备注",
            },
          ],
          pager: {
            pageIndex: 1,
            pageSize: 20,
            pageCount: 3,
            recordCount: 46,
            sizeOfCurrentPage: 0,
            indexOfFirstItemOfCurrentPage: 0,
            prePageIndex: 1,
            nextPageIndex: 2,
          },
        },
      };
    },
  },
  {
    url: "/gateway/org/back/queryRolePostList",
    type: "post",
    response: (req, res, next) => {
      // req.body 可获取post参数
      // req.query 可获取get参数
      return {
        head: {
          requestId: "3adb59fce3ea547b913333e7a58329be",
          errorCode: "0",
          timestamp: 1588930172024,
          time: 29,
          gtime: 68,
        },
        body: {
          data: [
            {
              busTypeId: "1",
              createDepId: "1",
              createDepName: "金财互联",
              entitleInsLevel: "d0b7c260c01311e692d447a876564c79#79",
              entitleInsLevelName: "一般部门;总公司;分公司",
              insId: "1",
              isValid: "Y",
              postCode: "alert_rule_config",
              postId: "0a2c85f057a34902bebca2b329bdbcd0",
              postName: "告警规则配置员",
              remark: "该岗位负责告警规则配置",
            },
            {
              busTypeId: "1",
              createDepId: "1",
              createDepName: "金财互联",
              entitleInsLevel: "d0b7c260c01311e692d447a876564c79#79",
              entitleInsLevelName: "总公司;分公司",
              insId: "1",
              isValid: "N",
              postCode: "alert_rule_config",
              postId: "0b2c85f057a34902bebca2b329bdbcd0",
              postName: "管理员",
              remark: "该岗位",
            },
          ],
          pager: {
            pageIndex: 1,
            pageSize: 20,
            pageCount: 3,
            recordCount: 46,
            sizeOfCurrentPage: 0,
            indexOfFirstItemOfCurrentPage: 0,
            prePageIndex: 1,
            nextPageIndex: 2,
          },
        },
      };
    },
  },
  {
    url: "/gateway/org/back/roleService2/queryFunctionIdCheckedByRoleId",
    type: "post",
    response: (req, res, next) => {
      return new Promise((res, rej) => {
        if (req.body.pid) {
          res({
            head: {
              requestId: "b2777fc36384dfedc68d846065bd6ab9",
              errorCode: "0",
              timestamp: 1589018044455,
              time: 14,
              gtime: 25,
            },
            body: [
              {
                functioinId: "bcc9150bdf8d45e7a009a68c2172d583",
                name: "调度中心",
                nodeCheckedFeild: "1",
                parentId: "1",
                subNodeFlag: "1",
              },
              {
                functioinId: "1a78cdc265af4c59bff40ca3f0f12e7a",
                name: "应用管理",
                nodeCheckedFeild: "1",
                parentId: "1",
                subNodeFlag: "1",
              },
            ],
          });
        } else {
          res({
            head: {
              requestId: "56791afec658eecd9a40a80e080db0ac",
              errorCode: "0",
              timestamp: 1589017864120,
              time: 20,
              gtime: 30,
            },
            body: [
              {
                functioinId: "1",
                name: "菜单权限列表",
                nodeCheckedFeild: "0",
                parentId: "0",
                subNodeFlag: "1",
              },
            ],
          });
        }
      });
    },
  },
  {
    url: "/gateway/org/back/roleService2/V2",
    type: "post",
    response: (req, res, next) => {
      return new Promise((res, rej) => {
        if (req.body.pid) {
          res({
            head: {
              requestId: "b2777fc36384dfedc68d846065bd6ab9",
              errorCode: "0",
              timestamp: 1589018044455,
              time: 14,
              gtime: 25,
            },
            body: [
              {
                functioinId: "fcd5393e20434e8a81b723f482ce8b2e",
                name: "税务平台",
                nodeCheckedFeild: "1",
                parentId: "1",
                subNodeFlag: "1",
                children:[
                  {
                    functioinId: "df4b694477ac432f908b3585dfc2d38e",
                    name: "申请管理",
                    nodeCheckedFeild: "1",
                    parentId: "fcd5393e20434e8a81b723f482ce8b2e",
                    subNodeFlag: "0",
                  },
                  {
                    functioinId: "96fd10e9ee6f4306a875e4cd0632c710",
                    name: "API网关监控",
                    nodeCheckedFeild: "1",
                    parentId: "fcd5393e20434e8a81b723f482ce8b2e",
                    subNodeFlag: "0",
                  }
                ]
              },
              {
                functioinId: "1a78cdc265af4c59bff40ca3f0f12e7a",
                name: "应用管理",
                nodeCheckedFeild: "1",
                parentId: "1",
                subNodeFlag: "1",
              },
            ],
          });
        } else {
          res({
            head: {
              requestId: "56791afec658eecd9a40a80e080db0ac",
              errorCode: "0",
              timestamp: 1589017864120,
              time: 20,
              gtime: 30,
            },
            body: [
              {
                functioinId: "1",
                name: "菜单权限列表",
                nodeCheckedFeild: "0",
                parentId: "0",
                subNodeFlag: "1",
              },
            ],
          });
        }
      });
    },
  },
];


