package com.eactive.eai.rms.onl.apim.portalstatistics;

import com.eactive.eai.rms.common.base.BaseAnnotationController;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.Map;

@Controller
public class PortalStatisticsManController extends BaseAnnotationController {
	
	private final PortalStatisticsManService portalStaticsManService;
	
	public PortalStatisticsManController (PortalStatisticsManService portalStaticsManService) {
		this.portalStaticsManService = portalStaticsManService;
	}

	@GetMapping(value = "/onl/apim/portalstatistics/portalStatisticsMan.view")
	public void view() {
		// view
	}

	@PostMapping(value = "/onl/apim/portalstatistics/portalStatisticsMan.json", params = "cmd=INSERT")
	public ResponseEntity<Map<String, Object>> createTenMinuteData(PortalStatisticsUI portalStatisticsUI)  {
		Map<String, Object> result = portalStaticsManService.createTenMinuteData(portalStatisticsUI);
		return ResponseEntity.ok(result);
	}

}
