50 lines
1.7 KiB
50 lines
1.7 KiB
5 years ago
|
package ${basePackage}.action.api.${module};
|
||
|
|
||
|
import ${basePackage}.frame.auth.LocalData;
|
||
|
import ${basePackage}.module.${module}.mgr.${table.getCName()}Manager;
|
||
|
import ${basePackage}.module.${module}.req.*;
|
||
|
import ${basePackage}.module.${module}.rsp.*;
|
||
|
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>
|
||
|
}
|