import * as sdk from '@/utils/fetch'
const serverInfo = <%-JSON.stringify(webapiGroup.serverInfo) %>
const controllerName = "<%-webapiGroup.name %>"

<% webapiGroup.apis.forEach(apiItem=>{ %>

/**
*
* <%=apiItem.comment%>
*
*/
export async function <%=apiItem.tplGetMethodName()%>(
<%- apiItem.tplGetRequestParamContent() %>
):Promise< <%= apiItem.tplGetResponseInterfaceName() %>> {

 const result = await sdk.<%=apiItem.tplGetMethodType()%>
  <%-apiItem.responseSchema? "<"+Util.getTypeNameFromSchema(apiItem.responseSchema) +">":""%>(
  <%-apiItem.tplGetUrl()%>,
  <%-apiItem.tplGetBodyParam()%> ,
  <%-apiItem.tplGetQueryParam()%>,
  {serverInfo,controllerName}
  )
  return result.data
  }
  <% }) %>

export default {
<% webapiGroup.apis.forEach(apiItem=>{ %>
<%=apiItem.tplGetMethodName()%>,
<% }) %>
}

  <%-tsDefinded%>