/*
 * @Author: Myz
 * @Date: 2020-10-19 15:10:28
 * @Last Modified by: Yolo
 * @Last Modified time: 2021-01-18 09:26:25
 * @Desc upload 接口
 */
import { errorCatcher, errorHandle, filter } from 'base-core-lib'
import { appRx } from '../defalutConfig/indexRx'
import {
  API_GET_APPENDIX_GETFILELIST,
  POST_GET_APPENDIX_SAVEFILES,
  API_GET_SYSTEM_GETROOTURL,
  API_GET_FILE_ACCESSCONFIG,
  API_POST_UPLOADFILES,
  API_POST_DELETEFILES,
  API_POST_OTHERUPLOADFILES
} from '@/api/common'
// 查询附件
export const getFileList = appRx.get(API_GET_APPENDIX_GETFILELIST, errorCatcher, errorHandle, filter)
// 保存附件
export const saveFiles = appRx.post(POST_GET_APPENDIX_SAVEFILES, errorCatcher, errorHandle, filter)
// 获取系统web路径
export const getRootUrl = appRx.get(API_GET_SYSTEM_GETROOTURL, errorCatcher, errorHandle, filter)
// 获得oss 的bucket 和 endpoint
export const GotOssAccessConfig = appRx.get(API_GET_FILE_ACCESSCONFIG, errorCatcher, errorHandle, filter)
// 船端上传附件
//   192.168.1.22:8090/shipAppendix/api/uploadFiles
// // 公司ID,分为"公司""通用"两种,如果是公司上传,ID不为空,否则为空 companyId
// // 详细ID,可为空 detailId
// // 业务对象名,不可为空 businessObjectName
// // 文件分类名,不可为空 fileCategoryName
// // 取得当前登录人ID,不可为空 staffId
// // 文件 fileName
export const uploadShipFiles = appRx.post(API_POST_UPLOADFILES, errorCatcher, errorHandle, filter)
//删除附件
export const deleteFiles = appRx.post(API_POST_DELETEFILES, errorCatcher, errorHandle, filter)
// 上传附件
export const uploadFiles = appRx.post(API_POST_OTHERUPLOADFILES, errorCatcher, errorHandle, filter)

