|
|
@@ -9,6 +9,7 @@ import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
|
import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@Controller
|
|
|
@@ -18,7 +19,23 @@ public class DataController {
|
|
|
|
|
|
|
|
|
@PostMapping("/data/uv")
|
|
|
- public SingleResult<Map> getUV(@DateTimeFormat(pattern = "yyyy-MM-dd") Date start, @DateTimeFormat(pattern = "yyyy-MM-dd")Date end){
|
|
|
+ public SingleResult<?> getUV(@DateTimeFormat(pattern = "yyyy-MM-dd") Date start, @DateTimeFormat(pattern = "yyyy-MM-dd")Date end){
|
|
|
+ long uv = dateService.calculateUV(start,end);
|
|
|
+ Map<String,Object> map =new HashMap<>();
|
|
|
+ map.put("uvResult",uv);
|
|
|
+ map.put("uvStartDate",start);
|
|
|
+ map.put("uvEndDate",end);
|
|
|
+ return SingleResult.success(map);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/data/dau")
|
|
|
+ public SingleResult<?> getDAU(@DateTimeFormat(pattern = "yyyy-MM-dd") Date start, @DateTimeFormat(pattern = "yyyy-MM-dd")Date end) {
|
|
|
+ long dau = dateService.calculateDAU(start,end);
|
|
|
+ Map<String,Object> map =new HashMap<>();
|
|
|
+ map.put("dauResult",dau);
|
|
|
+ map.put("dauStartDate",start);
|
|
|
+ map.put("dauEndDate",end);
|
|
|
+ return SingleResult.success(map);
|
|
|
+ }
|
|
|
|
|
|
- })
|
|
|
}
|