|
@@ -8,9 +8,7 @@ import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
-import org.springframework.web.bind.annotation.CrossOrigin;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
@@ -102,9 +100,9 @@ public class ItemController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "/saveAnswer")
|
|
|
+ @RequestMapping(value = "/saveAnswer", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
- public void saveAnswer(String item_id, String worker_id,String job_id,List<String>answers,List<String> attachment_location, HttpServletResponse response){
|
|
|
+ public void saveAnswer(String item_id, String worker_id,String job_id, @RequestParam("answers")List<String>answers, @RequestParam("attachment_location") List<String> attachment_location, HttpServletResponse response){
|
|
|
JSONObject result = new JSONObject();
|
|
|
String id = iservice.saveAnswer(item_id, worker_id, job_id, answers, attachment_location);
|
|
|
if(id.equals("")) {
|
|
@@ -125,9 +123,9 @@ public class ItemController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "/updateAnswer")
|
|
|
+ @RequestMapping(value = "/updateAnswer", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
- public void updateAnswer(String id, String item_id, String worker_id, String job_id, List<String>answers,List<String> attachment_location, HttpServletResponse response){
|
|
|
+ public void updateAnswer(String id, String item_id, String worker_id, String job_id, @RequestParam("answers")List<String>answers,@RequestParam("attachment_location") List<String> attachment_location, HttpServletResponse response){
|
|
|
JSONObject result = new JSONObject();
|
|
|
if(iservice.updateAnswer(id, item_id, worker_id, job_id, answers, attachment_location)){
|
|
|
result.put("status", "200");
|