|
@@ -0,0 +1,38 @@
|
|
|
|
|
+package com.zhiqiyun.open.router.apis;
|
|
|
|
|
+
|
|
|
|
|
+import com.dliyun.oap.framework.annotation.ServiceMethod;
|
|
|
|
|
+import com.dliyun.oap.framework.annotation.ServiceMethodBean;
|
|
|
|
|
+import com.dliyun.oap.framework.response.OapResponse;
|
|
|
|
|
+import com.zhiqiyun.open.core.models.statistics.HyMonitor;
|
|
|
|
|
+import com.zhiqiyun.open.core.service.HyMonitorService;
|
|
|
|
|
+import com.zhiqiyun.open.core.service.SequenceService;
|
|
|
|
|
+import com.zhiqiyun.open.router.request.statistics.SaveHyMonitorRequest;
|
|
|
|
|
+import com.zhiqiyun.open.utils.DateUtil;
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+
|
|
|
|
|
+@Slf4j
|
|
|
|
|
+@ServiceMethodBean
|
|
|
|
|
+public class MonitorApi {
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private HyMonitorService hyMonitorService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private SequenceService sequenceService;
|
|
|
|
|
+
|
|
|
|
|
+ @ServiceMethod(method = "hy.monitor.add", title = "各机构客流量提交")
|
|
|
|
|
+ public OapResponse save(SaveHyMonitorRequest request) {
|
|
|
|
|
+
|
|
|
|
|
+ HyMonitor entity = new HyMonitor();
|
|
|
|
|
+ BeanUtils.copyProperties(request, entity);
|
|
|
|
|
+
|
|
|
|
|
+ entity.setCreateDate(DateUtil.current());
|
|
|
|
|
+ entity.setId(this.sequenceService.nextId());
|
|
|
|
|
+
|
|
|
|
|
+ this.hyMonitorService.save(entity);
|
|
|
|
|
+
|
|
|
|
|
+ return OapResponse.success().setBody(entity);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|