All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.api.js.ftl Maven / Gradle / Ivy

import { request } from '@/utils/request'

export default {

<#if query??>
  /**
   * 查询列表
   * @param params
   * @returns {AxiosPromise}
   */
  query: (params) => {
    return request({
      url: '/${moduleName}/${bizName}/query',
      method: 'get',
      params: params
    })
  },


<#if detail??>
  /**
   * 根据ID查询
   * @param ${keys[0].name}
   * @returns {AxiosPromise}
   */
  get: (${keys[0].name}) => {
    return request({
      url: '/${moduleName}/${bizName}',
      method: 'get',
      params: {
        ${keys[0].name}: ${keys[0].name}
      }
    })
  },


<#if create??>
  /**
   * 新增
   * @param params
   * @returns {AxiosPromise}
   */
  create: (params) => {
    return request({
      url: '/${moduleName}/${bizName}',
      method: 'post',
      params: params
    })
  },


<#if update??>
  /**
   * 修改
   * @param params
   * @returns {AxiosPromise}
   */
  modify: (params) => {
    return request({
      url: '/${moduleName}/${bizName}',
      method: 'put',
      params: params
    })
  },


<#if hasDelete>
  /**
   * 删除
   * @param params
   * @returns {AxiosPromise}
   */
  deleteById: (${keys[0].name}) => {
    return request({
      url: '/${moduleName}/${bizName}',
      method: 'delete',
      params: {
        ${keys[0].name}: ${keys[0].name}
      }
    })
  },

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy