import axios from 'axios';
import global from '../Global.js'

// 基础方法进行封装
function getApiBasic(url, postdata) {
    return axios.post(url, postdata).then(function (data) {
        let json = data.data;
        return json
    }, function (response) {
        console.info(response);
    })
}

// 调用的api改写成方法
export function worldDetail(postdata) {
    let url = headapi + 'worldDetail';
    return getApiBasic(url, postdata);
}


export function editbasicinfo(postdata) {
    let url = headapi + 'editbasicinfo';
    return getApiBasic(url, postdata);
}

export function modPwd(postdata) {
    let url = headapi + 'modPwd';
    return getApiBasic(url, postdata);
}

export function logout(postdata) {
    let url = headapi + 'logout';
    return getApiBasic(url, postdata);
}

// 调用的api改写成方法
export function testTable(postdata) {
    let url = headapi + 'testTable';
    return getApiBasic(url, postdata);
}

export function testTableLong(postdata) {
    let url = headapi + 'testTableLong';
    return getApiBasic(url, postdata);
}

export function testSelect(postdata) {
    let url = headapi + 'testSelect';
    return getApiBasic(url, postdata);
}

// Auth

// 获取验证图片
export function GenVerifyPic(postdata) {
    let url = headapi + 'v1/Auth/GenVerifyPic';
    return getApiBasic(url, postdata);
}

// 修改密码 √
export function PassEdit(postdata) {
    let url = headapi + 'v1/Auth/PassEdit';
    return getApiBasic(url, postdata);
}

// 用户登录 √
export function SignIn(postdata) {
    let url = headapi + 'v1/Auth/SignIn';
    return getApiBasic(url, postdata);
}

// 用户退出
export function SignOut(postdata) {
    let url = headapi + 'v1/Auth/SignOut';
    return getApiBasic(url, postdata);
}

// 用户添加
export function SignUp(postdata) {
    let url = headapi + 'v1/Auth/SignUp';
    return getApiBasic(url, postdata);
}

// 用户微信登录
export function WXSignIn(postdata) {
    let url = headapi + 'v1/Auth/WXSignIn';
    return getApiBasic(url, postdata);
}

// class
// √ 课程添加
export function ClassAdd(postdata) {
    let url = headapi + 'v1/Class/ClassAdd';
    return getApiBasic(url, postdata);
}
// 课程统计
export function ClassStatistics(postdata) {
    let url = headapi + 'v1/Class/ClassStatistics';
    return getApiBasic(url, postdata);
}

// √ 课程颜色修改
export function ClassColorEdit(postdata) {
    let url = headapi + 'v1/Class/ClassColorEdit';
    return getApiBasic(url, postdata);
}

// 课程单条查询
export function ClassDetailOne(postdata) {
    let url = headapi + 'v1/Class/ClassDetailOne';
    return getApiBasic(url, postdata);
}
// √ 课程基本信息修改
export function ClassEdit(postdata) {
    let url = headapi + 'v1/Class/ClassEdit';
    return getApiBasic(url, postdata);
}

// √ 课程列表查询
export function ClassListQuery(postdata) {
    let url = headapi + 'v1/Class/ClassListQuery';
    return getApiBasic(url, postdata);
}

// √ 课程状态修改
export function ClassStatusEdit(postdata) {
    let url = headapi + 'v1/Class/ClassStatusEdit';
    return getApiBasic(url, postdata);
}

// 课程会员增删
export function ClassVipuserEdit(postdata) {
    let url = headapi + 'v1/Class/ClassVipuserEdit';
    return getApiBasic(url, postdata);
}

// 课程会员查询
export function ClassVipuserQuery(postdata) {
    let url = headapi + 'v1/Class/ClassVipuserQuery';
    return getApiBasic(url, postdata);
}

// 课程微信可见状态修改
export function ClassVisibleStatusEdit(postdata) {
    let url = headapi + 'v1/Class/ClassVisibleStatusEdit';
    return getApiBasic(url, postdata);
}
// order
// 管理员今日预约添加
export function OrderAddByManager(postdata) {
    let url = headapi + 'v1/Order/OrderAddByManager';
    return getApiBasic(url, postdata);
}
// 管理员今日预约取消
export function OrderCancelByManager(postdata) {
    let url = headapi + 'v1/Order/OrderCancelByManager';
    return getApiBasic(url, postdata);
}
// 预约记录查询
export function OrderListQuery(postdata) {
    let url = headapi + 'v1/Order/OrderListQuery';
    return getApiBasic(url, postdata);
}
// 今日预约统计
export function OrderStatistics(postdata) {
    let url = headapi + 'v1/Order/OrderStatistics';
    return getApiBasic(url, postdata);
}
// 今日课程预约总览
export function TodayClassOrderQuery(postdata) {
    let url = headapi + 'v1/Order/TodayClassOrderQuery';
    return getApiBasic(url, postdata);
}
// 课程预约列表
export function ClassOrderQuery(postdata) {
    let url = headapi + 'v1/Order/ClassOrderQuery';
    return getApiBasic(url, postdata);
}
// 今日会员预约列表查询
export function TodayVipOrderQuery(postdata) {
    let url = headapi + 'v1/Order/TodayVipOrderQuery';
    return getApiBasic(url, postdata);
}
// 会员预约列表查询
export function VipUserOrderQuery(postdata) {
    let url = headapi + 'v1/Order/VipUserOrderQuery';
    return getApiBasic(url, postdata);
}

// SchoolTimeTable

// 正在进行课程列表
export function ClassOngoingList(postdata) {
    let url = headapi + 'v1/SchoolTimeTable/ClassOngoingList';
    return getApiBasic(url, postdata);
}
// 课程详情判断是否可删除
export function STTDetailAllowDelCheck(postdata) {
    let url = headapi + 'v1/SchoolTimeTable/STTDetailAllowDelCheck';
    return getApiBasic(url, postdata);
}
// 下课记录详情删除
export function ClassOverDetailDel(postdata) {
    let url = headapi + 'v1/SchoolTimeTable/ClassOverDetailDel';
    return getApiBasic(url, postdata);
}
// 课程表详情微信可预约状态修改
export function STTDetailWxOrderEdit(postdata) {
    let url = headapi + 'v1/SchoolTimeTable/STTDetailWxOrderEdit';
    return getApiBasic(url, postdata);
}
// 某日课程表查询
export function ClassListByOrderDate(postdata) {
    let url = headapi + 'v1/SchoolTimeTable/ClassListByOrderDate';
    return getApiBasic(url, postdata);
}


// 确认下课
export function ClassOverConfirm(postdata) {
    let url = headapi + 'v1/SchoolTimeTable/ClassOverConfirm';
    return getApiBasic(url, postdata);
}
// 下课记录详情添加
export function ClassOverDetailAdd(postdata) {
    let url = headapi + 'v1/SchoolTimeTable/ClassOverDetailAdd';
    return getApiBasic(url, postdata);
}
// 下课记录详情列表
export function ClassOverDetailListQuery(postdata) {
    let url = headapi + 'v1/SchoolTimeTable/ClassOverDetailListQuery';
    return getApiBasic(url, postdata);
}
// 下课记录详情状态修改
export function ClassOverDetailStatusEdit(postdata) {
    let url = headapi + 'v1/SchoolTimeTable/ClassOverDetailStatusEdit';
    return getApiBasic(url, postdata);
}
// 待下课课程列表
export function ClassOverPrepare(postdata) {
    let url = headapi + 'v1/SchoolTimeTable/ClassOverPrepare';
    return getApiBasic(url, postdata);
}
// 下课准备
export function ClassPreFinishListQuery(postdata) {
    let url = headapi + 'v1/SchoolTimeTable/ClassPreFinishListQuery';
    return getApiBasic(url, postdata);
}

// 课程表基本信息添加
export function STTBasicAdd(postdata) {
    let url = headapi + 'v1/SchoolTimeTable/STTBasicAdd';
    return getApiBasic(url, postdata);
}
// 课程表基本信息修改
export function STTBasicEdit(postdata) {
    let url = headapi + 'v1/SchoolTimeTable/STTBasicEdit';
    return getApiBasic(url, postdata);
}

// 课程表基本列表查询
export function STTBasicListQuery(postdata) {
    let url = headapi + 'v1/SchoolTimeTable/STTBasicListQuery';
    return getApiBasic(url, postdata);
}
// 课程表上下线状态修改
export function STTBasicOfflineEdit(postdata) {
    let url = headapi + 'v1/SchoolTimeTable/STTBasicOfflineEdit';
    return getApiBasic(url, postdata);
}
// 课程表状态修改
export function STTBasicStatusEdit(postdata) {
    let url = headapi + 'v1/SchoolTimeTable/STTBasicStatusEdit';
    return getApiBasic(url, postdata);
}

// 课程表详情批量保存
export function STTDetailBatchSave(postdata) {
    let url = headapi + 'v1/SchoolTimeTable/STTDetailBatchSave';
    return getApiBasic(url, postdata);
}
// 课程表详情列表查询
export function STTDetailListQuery(postdata) {
    let url = headapi + 'v1/SchoolTimeTable/STTDetailListQuery';
    return getApiBasic(url, postdata);
}
// 复制课程表
export function SchoolTimeTableCopy(postdata) {
    let url = headapi + 'v1/SchoolTimeTable/SchoolTimeTableCopy';
    return getApiBasic(url, postdata);
}
// 今日未上课课程列表查询
export function WaitingBeginClassList(postdata) {
    let url = headapi + 'v1/SchoolTimeTable/WaitingBeginClassList';
    return getApiBasic(url, postdata);
}

// shop
// √ 店铺添加
export function ShopAdd(postdata) {
    let url = headapi + 'v1/Shop/ShopAdd';
    return getApiBasic(url, postdata);
}
// 店铺微信预约状态修改
export function ShopWxStatusEdit(postdata) {
    let url = headapi + 'v1/Shop/ShopWxStatusEdit';
    return getApiBasic(url, postdata);
}
// 店铺单条查询
export function ShopDetailOne(postdata) {
    let url = headapi + 'v1/Shop/ShopDetailOne';
    return getApiBasic(url, postdata);
}

// √ 店铺详情查询
export function ShopDetailQuery(postdata) {
    let url = headapi + 'v1/User/ShopDetailQuery';
    return getApiBasic(url, postdata);
}
//  操作日志列表查询
export function OptLogListQuery(postdata) {
    let url = headapi + 'v1/User/OptLogListQuery';
    return getApiBasic(url, postdata);
}


// 店铺修改
export function ShopEdit(postdata) {
    let url = headapi + 'v1/Shop/ShopEdit';
    return getApiBasic(url, postdata);
}

// 店铺列表查询
export function ShopListQuery(postdata) {
    let url = headapi + 'v1/Shop/ShopListQuery';
    return getApiBasic(url, postdata);
}

// 店铺状态修改
export function ShopStatusEdit(postdata) {
    let url = headapi + 'v1/Shop/ShopStatusEdit';
    return getApiBasic(url, postdata);
}

// SttPlan
// 课程表模板基本信息添加
export function SttPlanBasicAdd(postdata) {
    let url = headapi + 'v1/SttPlan/SttPlanBasicAdd';
    return getApiBasic(url, postdata);
}

// 课程表模板基本信息修改
export function SttPlanBasicEdit(postdata) {
    let url = headapi + 'v1/SttPlan/SttPlanBasicEdit';
    return getApiBasic(url, postdata);
}

// 课程表模板基本信息列表查询
export function SttPlanBasicListQuery(postdata) {
    let url = headapi + 'v1/SttPlan/SttPlanBasicListQuery';
    return getApiBasic(url, postdata);
}

// 课程表模板店铺通用修改
export function SttPlanBasicShopEdit(postdata) {
    let url = headapi + 'v1/SttPlan/SttPlanBasicShopEdit';
    return getApiBasic(url, postdata);
}

// 课程表模板复制
export function SttPlanCopy(postdata) {
    let url = headapi + 'v1/SttPlan/SttPlanCopy';
    return getApiBasic(url, postdata);
}
// 课程表模板基本信息状态修改
export function SttPlanBasicStatusEdit(postdata) {
    let url = headapi + 'v1/SttPlan/SttPlanBasicStatusEdit';
    return getApiBasic(url, postdata);
}

// 课程表模板详情列表查询
export function SttPlanDetailListQuery(postdata) {
    let url = headapi + 'v1/SttPlan/SttPlanDetailListQuery';
    return getApiBasic(url, postdata);
}
// 课程表模板发布
export function SttPlanPublish(postdata) {
    let url = headapi + 'v1/SttPlan/SttPlanPublish';
    return getApiBasic(url, postdata);
}

// 课程表模板详情批量保存
export function SttPlanDetailBatchSave(postdata) {
    let url = headapi + 'v1/SttPlan/SttPlanDetailBatchSave';
    return getApiBasic(url, postdata);
}

// teacher
// 教练信息添加 √
export function TeacherAdd(postdata) {
    let url = headapi + 'v1/Teacher/TeacherAdd';
    return getApiBasic(url, postdata);
}
// 教练信息修改  √
export function TeacherEdit(postdata) {
    let url = headapi + 'v1/Teacher/TeacherEdit';
    return getApiBasic(url, postdata);
}
// 教练信息列表查询  √
export function TeacherListQuery(postdata) {
    let url = headapi + 'v1/Teacher/TeacherListQuery';
    return getApiBasic(url, postdata);
}
// 教练状态修改  √
export function TeacherStatusEdit(postdata) {
    let url = headapi + 'v1/Teacher/TeacherStatusEdit';
    return getApiBasic(url, postdata);
}

// User
// √
export function ManagerSelfQuery(postdata) {
    let url = headapi + 'v1/User/ManagerSelfQuery';
    return getApiBasic(url, postdata);
}

// √ 店铺管理员添加
export function ShopManagerAdd(postdata) {
    let url = headapi + 'v1/User/ShopManagerAdd';
    return getApiBasic(url, postdata);
}

// 店铺管理员修改
export function ShopManagerEdit(postdata) {
    let url = headapi + 'v1/User/ShopManagerEdit';
    return getApiBasic(url, postdata);
}

// 店铺管理员列表查询
export function ShopManagerListQuery(postdata) {
    let url = headapi + 'v1/User/ShopManagerListQuery';
    return getApiBasic(url, postdata);
}

// 店铺管理员状态修改
export function ShopManagerStatusEdit(postdata) {
    let url = headapi + 'v1/User/ShopManagerStatusEdit';
    return getApiBasic(url, postdata);
}
// 会员用户课时调整
export function VipUserHourEdit(postdata) {
    let url = headapi + 'v1/User/VipUserHourEdit';
    return getApiBasic(url, postdata);
}
// 会员统计
export function VipUserStatistics(postdata) {
    let url = headapi + 'v1/User/VipUserStatistics';
    return getApiBasic(url, postdata);
}
// 会员课程增删
export function VipUserClassEdit(postdata) {
    let url = headapi + 'v1/User/VipUserClassEdit';
    return getApiBasic(url, postdata);
}
// 会员有效期调整
export function VipUserExpEdit(postdata) {
    let url = headapi + 'v1/User/VipUserExpEdit';
    return getApiBasic(url, postdata);
}

// 会员用户添加
export function VipUserAdd(postdata) {
    let url = headapi + 'v1/User/VipUserAdd ';
    return getApiBasic(url, postdata);
}

// 会员用户基本信息修改
export function VipUserEdit(postdata) {
    let url = headapi + 'v1/User/VipUserEdit ';
    return getApiBasic(url, postdata);
}
// 会员消费记录查询
export function VipUserConsumeListQuery(postdata) {
    let url = headapi + 'v1/User/VipUserConsumeListQuery ';
    return getApiBasic(url, postdata);
}

// 会员用户列表
export function VipUserListQuery(postdata) {
    let url = headapi + 'v1/User/VipUserListQuery';
    return getApiBasic(url, postdata);
}


// 会员用户基本信息查询
export function VipUserSimpleQuery(postdata) {
    let url = headapi + 'v1/User/VipUserSimpleQuery ';
    return getApiBasic(url, postdata);
}

// 会员用户状态修改
export function VipUserStatusEdit(postdata) {
    let url = headapi + 'v1/User/VipUserStatusEdit ';
    return getApiBasic(url, postdata);
}





