// 引入封装的请求

import { http } from "./http";

const apiServe = {
  // login:function(){
  //     return 123
  // },
  // login:() => {
  //     return 123
  // },
  // login:() => 123

  // 登录
  login: (methods, data) => http("/users/login/web", methods, data),
  // // 投食船状态信息
  // shipList: (methods, data) =>
  //   http("/feeding-ship/android/getStatus/" + data.id, methods, {}),
  // //开启多点导航
  // guidedmode: (methods, data) =>
  //   http("/feeding-ship/android/setPointMode", methods, data),
  // //开启路线记录模式
  // ListJL: (methods, data) =>
  //   http("/feeding-ship/android/setRouteRecordingMode", methods, data),
  //用户管理分配角色
  RoleFP: (methods, data) => http("/users/user-manage/patch", methods, data),
  //用户管理修改信息
  RoleXG: (methods, data) => http("/users/user-manage", methods, data),
  // 角色列表
  Roleadmin: (methods, data) => http("/users/role-manage/list", methods, data),
  // 根据id查询用户
  Roleid: (methods, data) => http("/users/user-manage/" + data.id, methods, {}),
  // 用户新增
  RoleXZ: (methods, data) => http("/users/user-manage", methods, data),
  // 查看权限管理
  PowerList: (methods) => http("/users/permission-manage/list", methods, {}),
  // 新增权限管理
  PowerXZ: (methods, data) => http("/users/permission-manage", methods, data),
  // 查询权限管理(根据id查询权限信息再进行修改)
  PowerCX: (methods, data) =>
    http("/users/permission-manage/" + data.id, methods, {}),
  // 修改权限管理
  PowerXG: (methods, data) => http("/users/permission-manage", methods, data),
  // 角色列表
  admin: (methods, data) => http("/users/user-manage/page", methods, data),
  // 角色管理
  RoleManagement: (methods, data) =>
    http("/users/role-manage/page", methods, data),
  // 角色管理新增
  RoleUserXZ: (methods, data) => http("/users/role-manage", methods, data),
  // 角色管理修改
  RoleUserXG: (methods, data) => http("/users/role-manage", methods, data),
  // 角色管理删除
  RoleUserDE: (methods, data) => http("/users/role-manage", methods, data),
  // 角色管理查询(根据id查询权限信息再进行修改)
  RoleUserCX: (methods, data) =>
    http("/users/role-manage/" + data.id, methods, {}),
  // 租户信息列表
  Tenant: (methods, data) => http("/users/tenant-manage", methods, data),
  // 租户信息列表(什么也不传)
  TenantXZ: (methods, data) => http("/users/tenant-manage/list", methods, data),
  // 租户信息详情
  TenantXQ: (methods, data) =>
    http("/users/tenant-manage/" + data.id, methods, {}),
  // 租户信息新增
  CarData: (methods, data) => http("/car/index/" + data.carId, methods, {}),
  // 租户信息修改
  TenantXG: (methods, data) => http("/users/tenant-manage", methods, data),
  // 租户信息删除
  TenantDE: (methods, data) => http("/users/tenant-manage", methods, data),
  // 设备新增
  deviceXZ: (methods, data) => http("/users/android/manage", methods, data),
  // 团队列表
  team: (methods, data) => http("/team", methods, data),
  // 接口?teamId=8483 默认的
  // 接口/team/8483 需要改造的
  // 团队列表详情,把teamId拼接在接口路径上，然后传递数据是搁空数据
  // 团队列表详情,把teamId拼接在接口路径上，然后传递数据是搁空数据
  adminList: (methods, data) => http("/admin/" + data.id, methods, {}),
  // 团队列表详情,把teamId拼接在接口路径上，然后传递数据是搁空数据
  activityList: (methods, data) =>
    http("/activity/" + data.activityId, methods, {}),

  // v2.0
  //
  //
  //
  //
  //
  //
  // 投食模式
  FeedingMode: (methods, data) =>
    http("/feeding-ship-v2/feeding/mode", methods, data),
  // 错误信息分页查询
  ErrorMessage: (methods, data) =>
    http("/feeding-ship-v2/error-message/page", methods, data),
  // 历史路线分页查询
  HistoryRoute: (methods, data) =>
    http("/feeding-ship-v2/route-history/page", methods, data),
  // 获取历史路线详情
  HistoryRouteDetail: (methods, data) =>
    http("/feeding-ship-v2/route-history/" + data.id, methods, {}),
  // 删除历史路线
  DeleteHistoryRoute: (methods, data) =>
    http("/feeding-ship-v2/route-history/" + data.id, methods, {}),
  // 更新历史路线
  UpdateHistoryRoute: (methods, data) =>
    http("/feeding-ship-v2/route-history/", methods, data),
  // 添加历史路线
  AddHistoryRoute: (methods, data) =>
    http("/feeding-ship-v2/route-history", methods, data),
  // 获取船的状态信息数据
  GetShipStatus: (methods, data) =>
    http("/feeding-ship-v2/device/status/" + data.id, methods, {}),
  // 设置投食船多点导航模式
  SetShipNavigationMode: (methods, data) =>
    http("/feeding-ship-v2/navigation/points-mode/", methods, data),
  // 选择路线下发路线点位
  SelectRoutePoints: (methods, data) =>
    http("/feeding-ship-v2/navigation/execute/", methods, data),
  // 获取投食作业相关统计信息
  GetFeedingStatistics: (methods, data) =>
    http("/feeding-ship-v2/personal-center/feeding" + data.shipId, methods, {}),
  // 提交反馈信息
  SubmitFeedback: (methods, data) =>
    http("/feeding-ship-v2/feedback", methods, data),
  // 获取无人船故障报修分页查询
  GetWarrantRepair: (methods, data) =>
    http("/feeding-ship-v2/fault-warranty/page", methods, data),
  // 删除无人船故障报修
  DeleteWarrantRepair: (methods, data) =>
    http("/feeding-ship-v2/fault-warranty/" + data.id, methods, {}),
  // 更新修改无人船故障报修状态
  UpdateWarrantRepair: (methods, data) =>
    http("/feeding-ship-v2/fault-warranty/", methods, data),
  // 无人船撒药模式
  SetShipFeedingMode: (methods, data) =>
    http("/feeding-ship-v2/feeding/medicine/", methods, data),
};
// 导出
export default apiServe;

/* 
    在组件中引入api.js

    在vue中使用
        apiServe.login("post",{userName:1,passWord:1})这个函数的结果是http("/login",methods,data)
        http("/login",methods,data)这个函数的结果是promise对象
        promise对象的结果是resolve的值
    
    综上：apiServe.login("post",{userName:1,passWord:1})的结果就是resolve的值

    所以：
        apiServe.login("post",{userName:1,passWord:1}).then(res=>{
            // 逻辑
        })
*/
