Authored by qianjun

refactor

@@ -30,7 +30,8 @@ public class QuestionController { @@ -30,7 +30,8 @@ public class QuestionController {
30 @RequestParam("startTime") int startTime, 30 @RequestParam("startTime") int startTime,
31 @RequestParam("sourceType") String sourceType, 31 @RequestParam("sourceType") String sourceType,
32 @RequestParam("endTime") int endTime, @RequestParam("frontAnswers") String frontAnswers) { 32 @RequestParam("endTime") int endTime, @RequestParam("frontAnswers") String frontAnswers) {
33 - logger.info("Enter submitQuestions rest."); 33 + logger.info("Enter submitQuestions rest. questionId={}, uid={}, startTime={}, sourceType={}, endTime={} and frontAnswers={}" ,
  34 + id, uid, startTime, sourceType, endTime, frontAnswers);
34 SubmitQuestionReqBO submitQuestionReqBO=new SubmitQuestionReqBO(); 35 SubmitQuestionReqBO submitQuestionReqBO=new SubmitQuestionReqBO();
35 36
36 submitQuestionReqBO.setId(id); 37 submitQuestionReqBO.setId(id);
@@ -60,8 +61,6 @@ public class QuestionController { @@ -60,8 +61,6 @@ public class QuestionController {
60 int code = Integer.parseInt(result.get("code").toString()); 61 int code = Integer.parseInt(result.get("code").toString());
61 String message = result.get("message").toString(); 62 String message = result.get("message").toString();
62 Object data = result.get("data"); 63 Object data = result.get("data");
63 -// String jsonpStr = "callback(" + data + ")";  
64 -  
65 return new ApiResponse.ApiResponseBuilder().code(code).message(message).data(data).build(); 64 return new ApiResponse.ApiResponseBuilder().code(code).message(message).data(data).build();
66 } 65 }
67 66
@@ -74,8 +73,6 @@ public class QuestionController { @@ -74,8 +73,6 @@ public class QuestionController {
74 int code = Integer.parseInt(result.get("code").toString()); 73 int code = Integer.parseInt(result.get("code").toString());
75 String message = result.get("message").toString(); 74 String message = result.get("message").toString();
76 Object data = result.get("data"); 75 Object data = result.get("data");
77 -// String jsonpStr = "callback(" + data + ")";  
78 -  
79 return new ApiResponse.ApiResponseBuilder().code(code).message(message).data(data).build(); 76 return new ApiResponse.ApiResponseBuilder().code(code).message(message).data(data).build();
80 } 77 }
81 78
@@ -28,7 +28,7 @@ public interface IQuestionService { @@ -28,7 +28,7 @@ public interface IQuestionService {
28 28
29 /** 29 /**
30 * 问卷验证接口 30 * 问卷验证接口
31 - * @return 31 + *
32 */ 32 */
33 JSONObject questionValidate(ValidateQuestionReqBO reqBO); 33 JSONObject questionValidate(ValidateQuestionReqBO reqBO);
34 } 34 }
1 package com.yoho.activity.service.impl; 1 package com.yoho.activity.service.impl;
2 2
3 -import com.yoho.activity.service.IQuestionService;  
4 import com.alibaba.fastjson.JSONObject; 3 import com.alibaba.fastjson.JSONObject;
  4 +import com.yoho.activity.service.IQuestionService;
5 import com.yoho.core.rest.client.ServiceCaller; 5 import com.yoho.core.rest.client.ServiceCaller;
6 import com.yoho.error.ServiceError; 6 import com.yoho.error.ServiceError;
7 import com.yoho.error.exception.ServiceException; 7 import com.yoho.error.exception.ServiceException;
8 import com.yoho.service.model.activity.crm.request.*; 8 import com.yoho.service.model.activity.crm.request.*;
9 -  
10 import org.slf4j.Logger; 9 import org.slf4j.Logger;
11 import org.slf4j.LoggerFactory; 10 import org.slf4j.LoggerFactory;
12 import org.springframework.beans.factory.annotation.Autowired; 11 import org.springframework.beans.factory.annotation.Autowired;
@@ -70,11 +69,7 @@ public class QuestionServiceImpl implements IQuestionService { @@ -70,11 +69,7 @@ public class QuestionServiceImpl implements IQuestionService {
70 @Override 69 @Override
71 public JSONObject getQuestionList(QuestionListReqBO reqBO) { 70 public JSONObject getQuestionList(QuestionListReqBO reqBO) {
72 logger.info("Enter getQuestionList impl. reqBO is {}", reqBO); 71 logger.info("Enter getQuestionList impl. reqBO is {}", reqBO);
73 -  
74 -// if (1 > reqBO.getUid()){  
75 -// throw new ServiceException(ServiceError.USER_ID_ERROR);  
76 -// }  
77 - 72 +
78 String url = crmDns + "/FrontQuestionnaireController/getList4Questionnaire.do"; 73 String url = crmDns + "/FrontQuestionnaireController/getList4Questionnaire.do";
79 74
80 JSONObject result = serviceCaller.post("crm.questionList", url, reqBO, JSONObject.class, null).get(10); 75 JSONObject result = serviceCaller.post("crm.questionList", url, reqBO, JSONObject.class, null).get(10);