
const moduleName = 'property-news'

export default prefix => {
  return {
    // 列表
    getNewsList: {
      url: `${prefix}/${moduleName}`,
      method: 'get',
      action: `admin.${moduleName}.list`
    },

    // 详情
    getNewsDetail: {
      url: `${prefix}/${moduleName}/:id`,
      method: 'get',
      action: `admin.${moduleName}.detail`
    },

    // 新增
    addNews: {
      url: `${prefix}/${moduleName}`,
      method: 'post',
      action: `admin.${moduleName}.add`
    },

    // 更新
    updateNews: {
      url: `${prefix}/${moduleName}/:id`,
      method: 'put',
      action: `admin.${moduleName}.update`
    },

    // 删除
    deleteNews: {
      url: `${prefix}/${moduleName}/:id`,
      method: 'delete',
      action: `admin.${moduleName}.delete`
    },
    
    newsType: {
      list: {
        method: 'GET',
        url: `${prefix}/tpNewsType`,
        action: 'admin.tpNewsType.get',
      },
      delete: {
        method: 'DELETE',
        url: `${prefix}/tpNewsType/:id`,
        action: 'admin.tpNewsType.id.delete',
      },
      put: {
        method: 'PUT',
        url: `${prefix}/tpNewsType/:id`,
        action: 'admin.tpNewsType.id.delete',
      },
      post: {
        method: 'POST',
        url: `${prefix}/tpNewsType`,
        action: 'admin.tpNewsType.post',
      },
      get: {
        method: 'GET',
        url: `${prefix}/tpNewsType/:id`,
        action: 'admin.tpNewsType.get',
      }
    },
  }
}
