Browse Source

新增查看表单html

周浩 9 years ago
parent
commit
9a9c06d346

+ 19 - 4
hsweb-web-controller/src/main/java/org/hsweb/web/controller/form/FormController.java

@@ -8,10 +8,7 @@ import org.hsweb.web.bean.po.form.Form;
 import org.hsweb.web.controller.GenericController;
 import org.hsweb.web.message.ResponseMessage;
 import org.hsweb.web.service.form.FormService;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.util.List;
@@ -81,4 +78,22 @@ public class FormController extends GenericController<Form, String> {
             return new ResponseMessage(false, e);
         }
     }
+
+    @RequestMapping(value = "/{name}/html", method = RequestMethod.GET)
+    public ResponseMessage html(@PathVariable("name") String name) {
+        try {
+            return new ResponseMessage(true, formService.createDeployHtml(name));
+        } catch (Exception e) {
+            return new ResponseMessage(false, e);
+        }
+    }
+
+    @RequestMapping(value = "/{id}/view", method = RequestMethod.GET)
+    public ResponseMessage view(@PathVariable("id") String id) {
+        try {
+            return new ResponseMessage(true, formService.createViewHtml(id));
+        } catch (Exception e) {
+            return new ResponseMessage(false, e);
+        }
+    }
 }