You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
969 B

2 weeks ago
  1. import http from 'libs/http'
  2. const baseUrl = '/tasks/'
  3. export const setTargetTemperature = (params: Home.SetTargetTemperatureParams): Promise<null> => http.post('/heat/target-temperature', params)
  4. export const trayTube = (params: Home.TrayTubeParams): Promise<null> => http.post('/tray/tube', params)
  5. export const addTask = (params: Task.TaskAdd): Promise<null> => http.post(baseUrl, params)
  6. export const stopTask = (): Promise<null> => http.post(`${baseUrl}stop`)
  7. export const getTask = (id: number): Promise<Task.Task> => http.get(`${baseUrl}${id}`)
  8. export const taskList = (params: Task.TaskQuery): Promise<Task.Task[]> => http.get(`${baseUrl}list`, { params })
  9. export const getTaskIng = (): Promise<null> => http.get(`${baseUrl}getIngTask`)
  10. export const delTask = (params: string): Promise<null> => http.delete(`${baseUrl}${params}`)
  11. export const trayIn = (): Promise<null> => http.post('tray/in')
  12. export const trayOut = (): Promise<null> => http.post('tray/out')