import { FileUploadResponse } from './model/uploadModel';
import { IPutPersonal } from './model/index';
import { defHttp } from '/@/utils/http/axios';

enum API {
  BaseUploadUrl = '/oss/upload',
  PutPersonalUrl = '/user/center',
  GetPersonalUrl = '/user/',
}
export const uploadApi = (file) => {
  return defHttp.post<FileUploadResponse>({ url: API.BaseUploadUrl, params: file });
};

export const personalGet = (id: string) => {
  return defHttp.get({
    url: `${API.GetPersonalUrl}${id}`,
  });
};

export const personalPut = (params: IPutPersonal) => {
  return defHttp.put<IPutPersonal>({
    url: API.PutPersonalUrl,
    params,
  });
};
