api.js 6.83 KB
(function () {
  var api = {
    /**
     * api 接口
     * @type {{prototype: {}}}
     */

    login: '/api/passport/login',
    signOut: '/api/passport/signOut',
    upload: '/api/common/upload',
    common: {
      listProvince: '/api/common/listProvince',
      listCity: function (provinceName) {
        return '/api/common/listCity?provinceName=' + provinceName;
      },
      listArea: function (cityName) {
        return '/api/common/listArea?cityName=' + cityName;
      },
    },
    //商家管理
    storeManage: {
      list: {
        type: 'GET',
        url: '/api/store/list',
        desc: "商家列表"
      },
      create: {
        type: "POST",
        url: "/api/store/create",
        desc: '添加商家信息'
      },
      update: {
        type: "POST",
        url: "/api/store/update",
        desc: "修改商家信息"
      },
      get: {
        type: "GET",
        url: function (id) {
          return "/api/store/get/" + id;
        },
        desc: "商家详情"
      },
      disable: {
        type: 'GET',
        url: function (id) {
          return "/api/store/disable/" + id;
        },
        desc: "禁用商家"
      },
      enable: {
        type: "GET",
        url: function (id) {
          return "/api/store/enable/" + id;
        },
        desc: '启用商家',
      },

    },
    //场馆管理
    venues: {
      list: {
        type: 'GET',
        url: '/api/venues/list',
      },
      start: {
        type: 'POST',
        url: '/api/venues/start',
      },
      create: '/api/venues/create',
      update: '/api/venues/update',
      detail: function (id) {
        return '/api/venues/detail/' + id;
      },
      //收费
      price: '/api/venues/priceList',
      savePrice: '/api/venues/price/config/save',
      detailPriceConfig: function (id) {
        return '/api/venues/price/config/detail/' + id;
      },
      savePriceList: '/api/venues/price/list/save'
    },
    //场地管理:
    ground: {
      list: '/api/venues/ground/list',
      create: '/api/venues/ground/create',
      start: function (id) {
        return '/api/venues/ground/start/' + id;
      },
      detail: '/api/venues/ground/detail',
      update: '/api/venues/ground/update',
      changeRank: '/api/venues/ground/changeRank',
    },
    //闸机管理
    door: {
      list: '/api/venues/door/list',
      create: '/api/venues/door/create',
      detail: '/api/venues/door/detail',
      update: '/api/venues/door/update',
      delete: function (id) {
        return '/api/venues/door/delete/' + id;
      },
    },
    //会员管理
    user: {
      list: {
        type: 'GET',
        url: '/api/user/list',
      },
      getUserInfo: function (id) {
        return '/api/user/getUserInfo/' + id;
      },
      getUserVipCard: {
        type: 'GET',
        url: '/api/user/getUserVipCard',
      },
      getUserIdentify: function (id) {
        return '/api/user/getUserIdentify/' + id;
      },

      getUserAccount: function (id) {
        return '/api/user/getUserAccount/' + id;
      },
      getTimeList: {
        type: 'GET',
        url: '/api/user/getTimeList',
      },
      getBlockList: {
        type: 'GET',
        url: '/api/user/getBlockList',
      },
      resettingPwd: {
        type: 'POST',
        url: '/api/user/resettingPwd',
      },
      getUserIdcard: '/api/user/getUserIdcard',
      getCount: '/api/user/getCount',
      identifyPass: function (id) {
        return '/api/user/identifyPass/' + id;
      },
      identifyRefuse: function (id) {
        return '/api/user/identifyRefuse/' + id;
      },
      getUser: '/api/user/getUser',
      create: '/api/user/create',
    },
    //包场管理
    block: {
      list: '/api/block/order/list',
      today: '/api/block/order/list/today',
      statusList: '/api/block/status/list'
    },
    //消费管理
    order: {
      //计时订单
      time: {
        list: {
          type: "GET",
          url: '/api/order/time/list',
          desc: '计时订单列表',
        },
        get: {
          type: "GET",
          url: function (id) {
            return '/api/order/time/get/' + id;
          },
          desc: '计时详情'
        },
      },
      //包场订单
      block: {
        list: {
          type: "GET",
          url: '/api/order/block/list',
          desc: '包场订单列表',
        },
        get: {
          type: 'GET',
          url: function (id) {
            return '/api/order/block/get/' + id;
          },
          desc: '包场订单详情',
        },
      },
      //套餐订单
      package: {
        list: {
          type: "GET",
          url: '/api/order/package/list',
          desc: '套餐订单列表',
        },
        get: {
          type: 'GET',
          url: function (id) {
            return '/api/order/package/get/' + id;
          },
          desc: '套餐订单详情',
        }
      },
      //充值订单
      recharge: {
        list: {
          type: "GET",
          url: '/api/order/list',
          desc: '充值订单列表'
        },
        get: {
          type: "GET",
          url: function (id) {
            return '/api/order/get/' + id;
          },
          desc: '充值订单详情'
        }
      },
    },
    //促销管理
    promotion: {
      package: {
        list: {
          type: "GET",
          url: "/api/promotion/package/list",
          desc: "套餐列表"
        },
        get: {
          type: "GET",
          url: function (id) {
            return '/api/promotion/package/get/' + id;
          },
          desc: "套餐详情"
        },
        create: {
          type: "POST",
          url: '/api/promotion/package/create',
          desc: "添加套餐"
        },
        update: {
          type: "POST",
          url: "/api/promotion/package/update",
          desc: '修改套餐'
        },
        delete: {
          type: "POST",
          url: function (id) {
            return "/api/promotion/package/delete/" + id;
          },
          desc: '删除套餐'
        }
      },
      packageType: {
        list: {
          type: 'GET',
          url: '/api/promotion/package/type/list',
          desc: '套餐类型列表'
        },
        get: {
          type: 'GET',
          url: function (id) {
            return "/api/promotion/package/type/get/" + id;
          },
          desc: '添加套餐类型'
        },
        create: {
          type: 'POST',
          url: "/api/promotion/package/type/create",
          desc: '添加套餐类型'
        },
        update: {
          type: "POST",
          url: '/api/promotion/package/type/update',
          desc: '修改套餐类型',
        },
        delete: {
          type: "POST",
          url: function (id) {
            return "/api/promotion/package/type/delete/" + id;
          },
          desc: "删除套餐类型"
        },
      },
    }
  }
  window.api = api
})()