import createDb from '../db/createdb';
import { getDict, updateDict } from '../db/modelApi/dict';
import {
  getUnfinishTrackTask,
  createTrackTask,
  createTrackTaskDetails,
  updateTrackTaskStatus,
  getTrackTaskDetailCount,
  getUnfinishTrackTaskDetail,
  updateTrackTaskDetailStatus,
  finishAllUnfinishTask,
  releaseAllRunningTaskDetail,
  getUnfinishTrackTaskDetails,
  releaseAllRunningTaskDetailByIds,
} from '../db/modelApi/trackTask';

createDb();

const dbApi = {
  getDict,
  updateDict,
  getUnfinishTrackTask,
  createTrackTask,
  createTrackTaskDetails,
  updateTrackTaskStatus,
  getTrackTaskDetailCount,
  getUnfinishTrackTaskDetail,
  updateTrackTaskDetailStatus,
  finishAllUnfinishTask,
  releaseAllRunningTaskDetail,
  getUnfinishTrackTaskDetails,
  releaseAllRunningTaskDetailByIds,
};

export type DbApi = typeof dbApi;

export default dbApi;
