YD_Event.Web/templates/route-types.ejs
2025-12-17 10:38:15 +08:00

19 lines
501 B
Plaintext

<%
const { utils, config, route, modelTypes } = it;
const { _, pascalCase } = utils;
const { routes, moduleName } = route;
const dataContracts = config.modular ? _.map(modelTypes, "name") : [];
%>
<% if (dataContracts.length) { %>
import { <%~ dataContracts.join(", ") %> } from "./<%~ config.fileNames.dataContracts %>"
<% } %>
export namespace <%~ pascalCase(moduleName) %> {
<% for (const route of routes) { %>
<%~ includeFile('./route-type.ejs', { ...it, route }) %>
<% } %>
}