import { TMarkRecordModel, TMarkRecordQueryParam } from '@/types'
import request from '@/until/request'

/**
 * 获取标记记录列表
 * @param data TMarkRecordQueryParam
 */
const QueryTMarkRecordList = (data: TMarkRecordQueryParam) =>
    request({
        url: '/TMarkRecordAction/findAllTMarkRecord',
        method: 'post',
        data: data
    })

/**
* 新增标记记录
* @param data TMarkRecordModel
*/
const AddTMarkRecord = (data: TMarkRecordModel) =>
    request({
        url: '/TMarkRecordAction/saveTMarkRecord',
        method: 'post',
        data: data
    })

/**
* 编辑标记记录
* @param data TMarkRecordModel
*/
const EditTMarkRecord = (data: TMarkRecordModel) =>
    request({
        url: '/TMarkRecordAction/updateTMarkRecord',
        method: 'post',
        data: data
    })

/**
* 删除标记记录
* @param  id number
*/
const DeleteTMarkRecord = (id: number) =>
    request({
        url: '/TMarkRecordAction/deleteTMarkRecord/' + id,
        method: 'get',
    })

/**
 * 根据SN查询台账
 * @param deviceSn 
 * @returns 
 */
const FindTMarkRecordBysn = (deviceSn: string) =>
    request({
        url: '/TMarkRecordAction/findTMarkRecordBysn/' + deviceSn,
        method: 'get',
    })

export default {
    QueryTMarkRecordList,
    AddTMarkRecord,
    EditTMarkRecord,
    DeleteTMarkRecord,
    FindTMarkRecordBysn
}