import request from '../utils/request'

const api = {
  ChangeUsername: '/User/ChangeUsername',
  ChangePassword: '/User/ChangePassword',
  UserInfo: '/User/Info',
  BindEmail: '/User/BindEmail',
  GetRepos: '/User/GetRepos',
  AdminUserList: '/Admin/User/GetUserList',
  AdminSetSendCountAutoApprove: '/Admin/User/SetSendCountAutoApprove',
  AdminSetUserBan: '/Admin/User/SetUserBan',
  AdminChangeLepaoCount: '/Admin/User/ChangeLepaoCount',
  AdminGetReqLog: '/Admin/User/GetReqLog',
  AdminGetReqLogDetail: '/Admin/User/GetReqLogDetail'
}

export function ChangeUsername(parameter) {
  return request({
    url: api.ChangeUsername,
    method: 'post',
    data: parameter
  })
}

export function adminGetReqLog(parameter) {
  return request({
    url: api.AdminGetReqLog,
    method: 'post',
    data: parameter
  })
}

export function adminGetReqLogDetail(parameter) {
  return request({
    url: api.AdminGetReqLogDetail,
    method: 'get',
    params: parameter
  })
}

export function adminChangeLepaoCount(parameter) {
  return request({
    url: api.AdminChangeLepaoCount,
    method: 'post',
    data: parameter
  })
}

export function adminSetSendCountAutoApprove(parameter) {
  return request({
    url: api.AdminSetSendCountAutoApprove,
    method: 'post',
    data: parameter
  })
}

export function adminSetUserBan(parameter) {
  return request({
    url: api.AdminSetUserBan,
    method: 'post',
    data: parameter
  })
}

export function BindEmail(parameter) {
  return request({
    url: api.BindEmail,
    method: 'post',
    data: parameter
  })
}

export function ChangePassword(parameter) {
  return request({
    url: api.ChangePassword,
    method: 'post',
    data: parameter
  })
}

export function GetUserInfo(parameter) {
  return request({
    url: api.UserInfo,
    method: 'get',
    params: parameter
  })
}

export function GetRepos(parameter) {
  return request({
    url: api.GetRepos,
    method: 'get',
    params: parameter
  })
}

export function adminGetUserList(parameter) {
  return request({
    url: api.AdminUserList,
    method: 'get',
    params: parameter
  })
}