You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
3.4 KiB

package ${domain}.action.api.${module};
import ${domain}.frame.auth.LocalData;
import ${domain}.module.${module}.mgr.${table.getCName()}Manager;
<#if table.getCreate()>
import ${domain}.module.${moduleName}.req.${table.getCName()}CreateRequest;
</#if>
<#if table.getDelete()>
import ${domain}.module.${moduleName}.req.${table.getCName()}DeleteRequest;
</#if>
<#if table.getFind()>
import ${domain}.module.${moduleName}.req.${table.getCName()}FindRequest;
</#if>
<#if table.getGet()>
import ${domain}.module.${moduleName}.req.${table.getCName()}GetRequest;
</#if>
<#if table.getSearch()>
import ${domain}.module.${moduleName}.req.${table.getCName()}SearchRequest;
</#if>
<#if table.getUpdate()>
import ${domain}.module.${moduleName}.req.${table.getCName()}UpdateRequest;
</#if>
<#if table.getCreate()>
import ${domain}.module.${moduleName}.rsp.${table.getCName()}CreateResponse;
</#if>
<#if table.getDelete()>
import ${domain}.module.${moduleName}.rsp.${table.getCName()}DeleteResponse;
</#if>
<#if table.getFind()>
import ${domain}.module.${moduleName}.rsp.${table.getCName()}FindResponse;
</#if>
<#if table.getGet()>
import ${domain}.module.${moduleName}.rsp.${table.getCName()}GetResponse;
</#if>
<#if table.getSearch()>
import ${domain}.module.${moduleName}.rsp.${table.getCName()}SearchResponse;
</#if>
<#if table.getUpdate()>
import ${domain}.module.${moduleName}.rsp.${table.getCName()}UpdateResponse;
</#if>
<#list table.methods as item>
<#if item.selected>
import ${domain}.module.${moduleName}.req.${table.getCName()}${item.getAbbName()?default("")}Request;
import ${domain}.module.${moduleName}.rsp.${table.getCName()}${item.getAbbName()?default("")}Response;
</#if>
</#list>
import org.springframework.beans.factory.annotation.Autowired;
public class ${table.getCName()}Api{
@Autowired
private ${table.getCName()}Manager ${table.getFName()}Manager;
<#if table.getCreate()>
public ${table.getCName()}CreateResponse create(${table.getCName()}CreateRequest request) {
return ${table.getFName()}Manager.create(request, LocalData.getToken());
}
</#if>
<#if table.getDelete()>
public ${table.getCName()}DeleteResponse delete(${table.getCName()}DeleteRequest request) {
return ${table.getFName()}Manager.delete(request, LocalData.getToken());
}
</#if>
<#if table.getUpdate()>
public ${table.getCName()}UpdateResponse update(${table.getCName()}UpdateRequest request) {
return ${table.getFName()}Manager.update(request, LocalData.getToken());
}
</#if>
<#if table.getFind()>
public ${table.getCName()}FindResponse find(${table.getCName()}FindRequest request) {
return ${table.getFName()}Manager.find(request, LocalData.getToken());
}
</#if>
<#if table.getGet()>
public ${table.getCName()}GetResponse get(${table.getCName()}GetRequest request) {
return ${table.getFName()}Manager.get(request, LocalData.getToken());
}
</#if>
<#if table.getSearch()>
public ${table.getCName()}SearchResponse search(${table.getCName()}SearchRequest request) {
return ${table.getFName()}Manager.search(request, LocalData.getToken());
}
</#if>
<#list table.methods as item>
<#if item.selected>
public ${table.getCName()}${item.getAbbName()?default("")}Response ${item.name}(${table.getCName()}${item.getAbbName()?default("")}Request request) {
return ${table.getFName()}Manager.${item.name}(request, LocalData.getToken());
}
</#if>
</#list>
}

Powered by TurnKey Linux.