class AssetController {

    @ApiOperation(httpMethod = "POST", value = "Save or Append User Recently Viewed Asset Groups")
    @PostMapping(value = "/v1/appendToRecentlyViewedAG")
    public ResponseEntity<Object> appendToRecentlyViewedAG(
            @RequestParam(name = "userId", required = true) String userId,
            @RequestParam(name = "ag", required = true) String assetGroup) {
        if (Strings.isNullOrEmpty(assetGroup) || Strings.isNullOrEmpty(userId)) {
            return ResponseUtils.buildFailureResponse(new Exception("Asset group/userId is Mandatory"));
        }
        Response response;
        try {
            response = new Response(assetService.saveAndAppendToRecentlyViewedAG(userId, assetGroup));
        } catch (Exception e) {
            return ResponseUtils.buildFailureResponse(e);
        }
        return ResponseUtils.buildSucessResponse(response);
    }

}