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 */ @RestController public class FormInterfaceController { @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 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> getFormInterfaceListService(String tenantID, String formID) { List 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 deleteFormInterfaceService(String tenantID, String formID, String interfaceName) { int nRs = formInterfaceService.deleteFormInterface(tenantID, formID, interfaceName); return RestResultGenerator.genSuccessResult(String.valueOf(nRs)); } }