package cn.autoform.web.controller.formevent; 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.CodeMasterEntity; import cn.autoform.db.entity.FormEventEntity; import cn.autoform.db.entity.FormFieldEntity; import cn.autoform.fw.exception.RestResult; import cn.autoform.fw.utility.RestResultGenerator; import cn.autoform.web.service.formevent.FormEventService; @RestController public class FormEventController { @Autowired private FormEventService formEventService= null; /** * 获取表单事件 * @param tenantID * @param formID * @return */ @RequestMapping(value = "${requset.formevent01}", method = RequestMethod.GET) public RestResult> getFormEventListService(String tenantID,String formID) { List rsList = formEventService.getFormEventList(tenantID, formID); return RestResultGenerator.genSuccessResult(rsList); } /** * 获取表单可以添加事件的 * @param tenantID * @param formID * @return */ @RequestMapping(value = "${requset.formevent02}", method = RequestMethod.GET) public RestResult> getFieldListwithTypeService(String tenantID,String formID) { List rsList = formEventService.getFieldListwithType(tenantID, formID); return RestResultGenerator.genSuccessResult(rsList); } /** * * @param formID * @param fieldName * @param tenantID * @param event * @param fieldType * @param eventmethod * @param createUser * @return */ @RequestMapping(value = "${requset.formevent03}", method = RequestMethod.POST) public RestResult createFormEventService(@RequestBody FormEventEntity formEventEntity) { int nRs = formEventService.createFormEvent(formEventEntity); return RestResultGenerator.genSuccessResult(String.valueOf(nRs)); } /** * * @param formID * @param fieldName * @param tenantID * @param event * @return */ @RequestMapping(value = "${requset.formevent04}", method = RequestMethod.GET) public RestResult deleteFormEventService(String formID,String fieldName, String tenantID, String event) { int nRs = formEventService.deleteFormEvent(formID, fieldName, tenantID, event); return RestResultGenerator.genSuccessResult(String.valueOf(nRs)); } /** * * @param tenantID * @param formID * @param columnOrderNum * @return */ @RequestMapping(value = "${requset.formevent05}", method = RequestMethod.GET) public RestResult> getFieldEventService(String tenantID,String formID,String columnOrderNum) { List rsList = formEventService.getFieldEventList(tenantID, formID, columnOrderNum); return RestResultGenerator.genSuccessResult(rsList); } /** * 获取字段事件列表 * @param tenantID * @param formID * @param fieldName * @return */ @RequestMapping(value = "${requset.formevent06}", method = RequestMethod.GET) public RestResult> getEventListService(String tenantID,String formID, String fieldName) { List rsList = formEventService.getEventList(tenantID, formID, fieldName); return RestResultGenerator.genSuccessResult(rsList); } }