package cn.autoform.web.controller.forminterface;
|
|
import java.util.List;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import cn.autoform.db.entity.FormInterfaceEntity;
|
import cn.autoform.fw.exception.RestResult;
|
import cn.autoform.fw.utility.RestResultGenerator;
|
import cn.autoform.web.service.forminterface.FormInterfaceService;
|
|
/**
|
*
|
* @author liumy
|
*
|
* @param <T>
|
*/
|
@RestController
|
public class FormInterfaceController<T> {
|
|
@Autowired
|
private FormInterfaceService formInterfaceService = null;
|
|
/**
|
* 新增一个接口
|
* @param tenantID
|
* @param formID
|
* @param interfaceName
|
* @param createUser
|
* @param interfacemethod
|
* @param customInterfacemethod
|
* @return
|
*/
|
@RequestMapping(value = "${requset.forminterface01}", method = RequestMethod.POST)
|
public RestResult<String> createFormInterfaceService(@RequestBody FormInterfaceEntity formInterfaceEntity) {
|
|
int nRs = formInterfaceService.createFormInterface(formInterfaceEntity);
|
return RestResultGenerator.genSuccessResult(String.valueOf(nRs));
|
}
|
|
/**
|
* 表单接口管理表中取出数据
|
* @param tenantID
|
* @param formID
|
* @return
|
*/
|
@RequestMapping(value = "${requset.forminterface02}", method = RequestMethod.GET)
|
public RestResult<List<FormInterfaceEntity>> getFormInterfaceListService(String tenantID, String formID) {
|
List<FormInterfaceEntity> rsList = formInterfaceService.getFormInterfaceList(tenantID, formID);
|
|
return RestResultGenerator.genSuccessResult(rsList);
|
}
|
|
/**
|
* 删除一个接口
|
* @param tenantID
|
* @param formID
|
* @param interfaceName
|
* @return
|
*/
|
@RequestMapping(value = "${requset.forminterface03}", method = RequestMethod.GET)
|
public RestResult<String> deleteFormInterfaceService(String tenantID, String formID, String interfaceName) {
|
|
int nRs = formInterfaceService.deleteFormInterface(tenantID, formID, interfaceName);
|
|
return RestResultGenerator.genSuccessResult(String.valueOf(nRs));
|
}
|
|
|
}
|