Commit d07ba824 by carrieyzzhang

appkey param

parent 4afbb013
package com.reyun.controller; package com.reyun.controller;
import com.reyun.model.Account; import com.reyun.model.Account;
import com.reyun.model.App;
import com.reyun.model.Event4Web; import com.reyun.model.Event4Web;
import com.reyun.model.VirtualEvent; import com.reyun.model.VirtualEvent;
import com.reyun.repository.AppRepository;
import com.reyun.security.annotation.CurrentAccount; import com.reyun.security.annotation.CurrentAccount;
import com.reyun.service.EventService; import com.reyun.service.EventService;
import com.reyun.service.VirtualEventService; import com.reyun.service.VirtualEventService;
...@@ -29,6 +31,9 @@ public class EventController { ...@@ -29,6 +31,9 @@ public class EventController {
@Autowired @Autowired
private VirtualEventService virtualService; private VirtualEventService virtualService;
@Autowired
private AppRepository appRepository;
@RequestMapping(value = "find/param", method = RequestMethod.GET) @RequestMapping(value = "find/param", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public ResultModel findAll(@PathVariable Long app, @RequestParam String names, @RequestParam(required = false) String params) throws JSONException { public ResultModel findAll(@PathVariable Long app, @RequestParam String names, @RequestParam(required = false) String params) throws JSONException {
...@@ -92,6 +97,13 @@ public class EventController { ...@@ -92,6 +97,13 @@ public class EventController {
} }
@ResponseBody @ResponseBody
@RequestMapping(value = "find4tracking", method = RequestMethod.GET)
public ResultModel findAllEvent4Tracking(@PathVariable Long app, @RequestParam String appkey) {
App appObject = appRepository.findByAppkey(appkey);
return ResultModel.OK(eventService.listAllEvent(appObject.getId()));
}
@ResponseBody
@RequestMapping(value = "find/callback", method = RequestMethod.GET) @RequestMapping(value = "find/callback", method = RequestMethod.GET)
public ResultModel findAllEventToCallback(@PathVariable Long app) { public ResultModel findAllEventToCallback(@PathVariable Long app) {
return ResultModel.OK(eventService.listAllEventToCallback(app)); return ResultModel.OK(eventService.listAllEventToCallback(app));
......
...@@ -37,4 +37,7 @@ public interface AppRepository extends JpaRepository<App, Long> ...@@ -37,4 +37,7 @@ public interface AppRepository extends JpaRepository<App, Long>
@Query(value="select categoryname from category where categoryid=(select app_genre from app where id=?1);",nativeQuery=true) @Query(value="select categoryname from category where categoryid=(select app_genre from app where id=?1);",nativeQuery=true)
String findAppGenreNameByAppID(Long id); String findAppGenreNameByAppID(Long id);
@Query(value = "select * from app where appkey = ?1", nativeQuery = true)
App findByAppkey(String appkeys);
} }
...@@ -81,7 +81,7 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter { ...@@ -81,7 +81,7 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
|| request.getRequestURL().indexOf("external/download") != -1 || request.getRequestURL().indexOf("external/download") != -1
|| request.getRequestURL().indexOf("openapi/toutiao") != -1 || request.getRequestURL().indexOf("openapi/toutiao") != -1
// || request.getRequestURL().indexOf("event/find") != -1 // || request.getRequestURL().indexOf("event/find") != -1
|| request.getRequestURI().endsWith("event/find") || request.getRequestURI().endsWith("event/find4tracking")
|| request.getRequestURI().startsWith("/api/reged") || request.getRequestURI().startsWith("/api/reged")
|| request.getRequestURI().startsWith("/api/demo") || request.getRequestURI().startsWith("/api/demo")
|| request.getRequestURI().startsWith("/api/messagecode") || request.getRequestURI().startsWith("/api/messagecode")
......
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