
import request from '@/utils/request'

// 新增
export function journalAdd(data, type) {
  return request({
    url: `/journal/${type}`,
    method: 'post',
    data
  })
}

// 删除
export function journalDel(type, id) {
  return request({
      url: `/journal/${type}/${id}`,
      method: 'delete'
  })
}

// 修改
export function journalUpdate(data, type) {
  return request({
    url: `/journal/${type}`,
    method: 'put',
    data: data
  })
}

// 查询List
export function journalQuery(query, type, alias) {
  return request({
    url: `/journal/${type}${alias ? '/' + alias : ''}/list`,
    method: 'get',
    params: query
  })
}

// 查询详情
export function journalFetch(suffix, type) {
  return request({
    url: `/journal/${type}/${suffix}`,
    method: 'get'
  })
}

