{"size": 1283, "ext": "js", "max_stars_repo_path": "vendor/lake/larke-admin-frontend/src/resources/assets/src/api/config.js", "max_stars_repo_name": "deatil/larke-admin-system", "max_stars_repo_stars_event_min_datetime": "2020-12-16T10:03:43.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-11T05:54:57.000Z", "max_issues_repo_path": "vendor/lake/larke-admin-frontend/src/resources/assets/src/api/config.js", "max_issues_repo_name": "deatil/larke-admin-system", "max_issues_repo_issues_event_min_datetime": "2021-01-09T06:29:03.000Z", "max_issues_repo_issues_event_max_datetime": "2021-03-01T04:50:26.000Z", "max_forks_repo_path": "vendor/lake/larke-admin-frontend/src/resources/assets/src/api/config.js", "max_forks_repo_name": "deatil/larke-admin-system", "max_forks_repo_forks_event_min_datetime": "2020-12-16T10:03:47.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-17T11:36:40.000Z"}
{"max_stars_count": 50, "max_issues_count": 3, "max_forks_count": 16, "avg_line_length": 14.9186046512, "max_line_length": 43, "alphanum_fraction": 0.5791114575}
import request from '@/utils/request'

export function getList(params) {
  return request({
    url: '/config',
    method: 'get',
    params
  })
}

export function getSettings() {
  return request({
    url: '/config/list',
    method: 'get'
  })
}

export function getDetail(id) {
  return request({
    url: `/config/${id}`,
    method: 'get'
  })
}

export function create(data) {
  return request({
    url: '/config',
    method: 'post',
    data
  })
}

export function update(id, data) {
  return request({
    url: `/config/${id}`,
    method: 'put',
    data
  })
}

export function deleteConfig(id) {
  return request({
    url: `/config/${id}`,
    method: 'delete'
  })
}

export function enable(id) {
  return request({
    url: `/config/${id}/enable`,
    method: 'patch'
  })
}

export function disable(id) {
  return request({
    url: `/config/${id}/disable`,
    method: 'patch'
  })
}

export function updateSort(id, listorder) {
  return request({
    url: `/config/${id}/sort`,
    method: 'patch',
    data: {
      listorder
    }
  })
}

export function getSetting() {
  return request({
    url: '/config/settings',
    method: 'get'
  })
}

export function setting(data) {
  return request({
    url: '/config/setting',
    method: 'put',
    data
  })
}
