Authored by ken.hu

u

@@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
8 import org.springframework.web.bind.annotation.RequestBody; 8 import org.springframework.web.bind.annotation.RequestBody;
9 import org.springframework.web.bind.annotation.RequestMapping; 9 import org.springframework.web.bind.annotation.RequestMapping;
10 import org.springframework.web.bind.annotation.RequestMethod; 10 import org.springframework.web.bind.annotation.RequestMethod;
  11 +import org.springframework.web.bind.annotation.RequestParam;
11 import org.springframework.web.bind.annotation.ResponseBody; 12 import org.springframework.web.bind.annotation.ResponseBody;
12 import org.springframework.web.bind.annotation.RestController; 13 import org.springframework.web.bind.annotation.RestController;
13 14
@@ -41,4 +42,19 @@ public class ResourcesController { @@ -41,4 +42,19 @@ public class ResourcesController {
41 return new ApiResponse.ApiResponseBuilder().data(data).code(200).message("resources data").build(); 42 return new ApiResponse.ApiResponseBuilder().data(data).code(200).message("resources data").build();
42 43
43 } 44 }
  45 +
  46 + @RequestMapping(params = "method=ufo.resource.get")
  47 + public ApiResponse payment(@RequestParam(name = "contentCode") String contentCode,
  48 + @RequestParam(name = "clientType") String clientType) {
  49 +
  50 + ResourcesRequestBody request = new ResourcesRequestBody();
  51 + request.setClientType(clientType);
  52 + request.setContentCode(contentCode);
  53 + logger.info("Get resources by content code[{}] and client type [{}].", request.getContentCode(),
  54 + request.getClientType());
  55 + List<Object> data = resourcesService.get(request);
  56 + logger.info("Get resources by content code[{}] and client type [{}] success.", request.getContentCode(),
  57 + request.getClientType());
  58 + return new ApiResponse.ApiResponseBuilder().data(data).code(200).message("resources data").build();
  59 + }
44 } 60 }