package cn.autoform.web.controller.enclosure; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import cn.autoform.fw.exception.RestResult; import cn.autoform.fw.utility.RestResultGenerator; import cn.autoform.util.tool.JSONTool; import cn.autoform.web.client.bean.Enclosure; import cn.autoform.web.client.bean.EnclosureExtend; import cn.autoform.web.service.Enclosure.EnclosureService; @RestController public class EnclosureController { @Autowired private EnclosureService enclosureService; @RequestMapping(value = "${requset.enclosure01}", method = RequestMethod.POST) public RestResult addFile(@RequestBody Map enc) { System.out.println("参数:"+JSONTool.toJson(enc)); EnclosureExtend encs = JSONTool.toObj(JSONTool.toJson(enc),EnclosureExtend.class); return RestResultGenerator.genSuccessResult(enclosureService.addFile(encs)); } @RequestMapping(value = "${requset.enclosure03}", method = RequestMethod.POST) public RestResult> selectFile(@RequestBody Enclosure enc) { return RestResultGenerator.genSuccessResult(enclosureService.selectFile(enc)); } @RequestMapping(value = "${requset.enclosure04}") public RestResult selectFileStatus(@RequestBody Enclosure enc) { return RestResultGenerator.genSuccessResult(enclosureService.selectFileStatus(enc.getFormID(),enc.getDataRowNum())); } }