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 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);
}


// shop
// √ 店铺添加
export function ShopAdd(postdata) {
    let url = headapi + '/v1/Shop/ShopAdd';
    return getApiBasic(url, postdata);
}

// √ 店铺详情查询
export function ShopDetailQuery(postdata) {
    let url = headapi + '/v1/User/ShopDetailQuery';
    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 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 SttPlanDetailBatchSave(postdata) {
    let url = headapi + '/v1/SttPlan/SttPlanDetailBatchSave';
    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 VipUserListQuery(postdata) {
    let url = headapi + '/v1/User/VipUserListQuery';
    return getApiBasic(url, postdata);
}





