Commit 5d8c4110 by carrieyzzhang

decode

parent 60bbba95
......@@ -7,11 +7,14 @@ import com.reyun.security.annotation.CurrentAccount;
import com.reyun.service.EventService;
import com.reyun.service.VirtualEventService;
import com.reyun.util.ResultModel;
import com.reyun.util.StringUtil;
import org.json.JSONException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.List;
/**
......@@ -29,6 +32,13 @@ public class EventController {
@RequestMapping(value = "find/param", method = RequestMethod.GET)
@ResponseBody
public ResultModel findAll(@PathVariable Long app, @RequestParam String names, @RequestParam(required = false) String params) throws JSONException {
if (!StringUtil.isEmpty(params)) {
try {
params = URLDecoder.decode(params, "UTF-8");
} catch (UnsupportedEncodingException e) {
}
}
return ResultModel.OK(eventService.listAllNew(app, names, params));
}
......
......@@ -6,6 +6,7 @@ import com.reyun.security.annotation.CurrentAccount;
import com.reyun.service.IntelligentPathService;
import com.reyun.util.ResultModel;
import com.reyun.util.ResultStatus;
import com.reyun.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
......@@ -15,6 +16,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
/**
* Created by sunhao on 17/7/18.
......@@ -56,6 +59,13 @@ public class IntelligentPathController {
return ResultModel.ERROR(ResultStatus.PARAM_INVALID);
}
if (!StringUtil.isEmpty(eventCondition)) {
try {
eventCondition = URLDecoder.decode(eventCondition, "UTF-8");
} catch (UnsupportedEncodingException e) {
}
}
IntelligentPath intelligentPath = new IntelligentPath(appId, events, startOrEnd, targetEvent, Long.parseLong(session), Long.parseLong(sessionUnit), eventCondition, startDate, endDate);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment