import { get, post } from '@/api/http';

const fix = '/user';

const url = {
  login: `${fix}/login`,
  userInfo: `${fix}/userInfo`,
  insert: `${fix}/insert`,
  page: `${fix}/page`,
  update: `${fix}/update`,
  delete: `${fix}/delete`,
  updateSystemSetting: `/userStyleSetting/update`,
  getUserStyleSetting: `/userStyleSetting/get`,
};

export const login = (params: Object) => {
  return post(url.login, params);
};

export const getUserInfo = () => {
  return get(url.userInfo);
};

export const insertUser = (params: Object) => {
  return post(url.insert, params);
};

export const getUserList = (params: Object) => {
  return get(url.page, params);
};

export const updateUser = (params: Object) => {
  return post(url.update, params);
};

export const deleteUser = (params: Object) => {
  return post(url.delete, params);
};

export const setSystemSetting = (params: Object) => {
  return post(url.updateSystemSetting, params);
};

export const getUserStyleSetting = () => {
  return get(url.getUserStyleSetting);
};
