<%_ if (position === 'import') { _%>
<%_ } _%>
<%_ if (position === 'method') { _%>
  <%_ if (clientTheme === 'vben' && clientFramework === 'vue') { _%>
  // prettier-ignore
  copy(copyId: <%- primaryKey.tsType %>): Promise<ICommonTable> {
    return new Promise<any>((resolve, reject) => {
      defHttp.put({ url: `${apiUrl}/copy/${copyId}` })
           .then(res => { resolve(res); })
           .catch(err => { reject(err);});
    });
  },
  // prettier-ignore
  findByEntityName(entityName: string): Promise<ICommonTable> {
    return new Promise<any>((resolve, reject) => {
      defHttp.get({ url: `${apiUrl}/entity-name/${entityName}`})
           .then(res => { resolve(res.data); })
           .catch(err => { reject(err);});
    });
  },
  <%_ } _%>
  <%_ if (clientTheme === 'antd' && clientFramework === 'react') { _%>

export async function copy(copyId: <%- primaryKey.tsType %>): Promise<ICommonTable> {
  return request<any>(`${apiUrl}/copy/${copyId}`, { method: 'PUT'});
}

export async function findByEntityName(entityName: string): Promise<ICommonTable> {
  return request<any>(`${apiUrl}/entity-name/${entityName}`);
}
  <%_ } _%>
  <%_ if (clientFramework === 'angular' && clientTheme === 'alain') { _%>

  copy(copyId: <%- primaryKey.tsType %>): Observable<ICommonTable> {
    return this.http.put<ICommonTable>(`${this.resourceUrl}/copy/${copyId}`);
  }

 findByEntityName(entityName: string): Observable<ICommonTable> {
  return this.http.get<ICommonTable>(`${this.resourceUrl}/entity-name/${entityName}`);
}
  <%_ } _%>
<%_ } _%>
