mirror of
https://gitee.com/wujiawei1207537021/wu-lazy-cloud-network.git
synced 2025-06-07 13:57:56 +08:00
[fix] 添加流量管理
This commit is contained in:
parent
0040a97521
commit
05edb16c41
@ -1,109 +0,0 @@
|
|||||||
package wu.framework.lazy.cloud.heartbeat.server.application;
|
|
||||||
|
|
||||||
import com.wu.framework.response.Result;
|
|
||||||
import com.wu.framework.response.ResultFactory;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorFlow;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorFlowRemoveCommand;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorFlowStoryCommand;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorFlowUpdateCommand;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorFlowQueryListCommand;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorFlowQueryOneCommand;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.dto.VisitorFlowDTO;
|
|
||||||
import java.util.List;
|
|
||||||
import com.wu.framework.inner.lazy.database.expand.database.persistence.domain.LazyPage;
|
|
||||||
/**
|
|
||||||
* describe 访客端流量
|
|
||||||
*
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
* @see com.wu.framework.inner.lazy.persistence.reverse.lazy.ddd.DefaultDDDLazyApplication
|
|
||||||
**/
|
|
||||||
|
|
||||||
public interface VisitorFlowApplication {
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 新增访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowStoryCommand 新增访客端流量
|
|
||||||
* @return {@link Result<VisitorFlow>} 访客端流量新增后领域对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
Result<VisitorFlow> story(VisitorFlowStoryCommand visitorFlowStoryCommand);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 批量新增访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowStoryCommandList 批量新增访客端流量
|
|
||||||
* @return {@link Result<List<VisitorFlow>>} 访客端流量新增后领域对象集合
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
Result<List<VisitorFlow>> batchStory(List<VisitorFlowStoryCommand> visitorFlowStoryCommandList);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 更新访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowUpdateCommand 更新访客端流量
|
|
||||||
* @return {@link Result<VisitorFlow>} 访客端流量领域对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
Result<VisitorFlow> updateOne(VisitorFlowUpdateCommand visitorFlowUpdateCommand);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 查询单个访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowQueryOneCommand 查询单个访客端流量
|
|
||||||
* @return {@link Result<VisitorFlowDTO>} 访客端流量DTO对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
Result<VisitorFlowDTO> findOne(VisitorFlowQueryOneCommand visitorFlowQueryOneCommand);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 查询多个访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowQueryListCommand 查询多个访客端流量
|
|
||||||
* @return {@link Result <List<VisitorFlowDTO>>} 访客端流量DTO对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
Result <List<VisitorFlowDTO>> findList(VisitorFlowQueryListCommand visitorFlowQueryListCommand);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 分页查询多个访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowQueryListCommand 分页查询多个访客端流量
|
|
||||||
* @return {@link Result <LazyPage<VisitorFlowDTO>>} 分页访客端流量DTO对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
Result <LazyPage<VisitorFlowDTO>> findPage(int size,int current,VisitorFlowQueryListCommand visitorFlowQueryListCommand);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 删除访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowRemoveCommand 删除访客端流量
|
|
||||||
* @return {@link Result<VisitorFlow>} 访客端流量
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
Result<VisitorFlow> remove(VisitorFlowRemoveCommand visitorFlowRemoveCommand);
|
|
||||||
|
|
||||||
}
|
|
@ -0,0 +1,114 @@
|
|||||||
|
package wu.framework.lazy.cloud.heartbeat.server.application;
|
||||||
|
|
||||||
|
import com.wu.framework.response.Result;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.*;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.application.dto.VisitorFlowDTO;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.application.dto.VisitorPortFlowDTO;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorPortFlow;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorPortFlowStoryCommand;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.wu.framework.inner.lazy.database.expand.database.persistence.domain.LazyPage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 访客端流量
|
||||||
|
*
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
* @see com.wu.framework.inner.lazy.persistence.reverse.lazy.ddd.DefaultDDDLazyApplication
|
||||||
|
**/
|
||||||
|
|
||||||
|
public interface VisitorPortFlowApplication {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 新增访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowStoryCommand 新增访客端流量
|
||||||
|
* @return {@link Result< VisitorPortFlow >} 访客端流量新增后领域对象
|
||||||
|
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
Result<VisitorPortFlow> story(VisitorPortFlowStoryCommand visitorPortFlowStoryCommand);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 批量新增访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowStoryCommandList 批量新增访客端流量
|
||||||
|
* @return {@link Result<List< VisitorPortFlow >>} 访客端流量新增后领域对象集合
|
||||||
|
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
Result<List<VisitorPortFlow>> batchStory(List<VisitorPortFlowStoryCommand> visitorPortFlowStoryCommandList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 更新访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowUpdateCommand 更新访客端流量
|
||||||
|
* @return {@link Result< VisitorPortFlow >} 访客端流量领域对象
|
||||||
|
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
Result<VisitorPortFlow> updateOne(VisitorPortFlowUpdateCommand visitorPortFlowUpdateCommand);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 查询单个访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowQueryOneCommand 查询单个访客端流量
|
||||||
|
* @return {@link Result< VisitorPortFlowDTO >} 访客端流量DTO对象
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
Result<VisitorPortFlowDTO> findOne(VisitorPortFlowQueryOneCommand visitorPortFlowQueryOneCommand);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 查询多个访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowQueryListCommand 查询多个访客端流量
|
||||||
|
* @return {@link Result <List<VisitorPortFlowDTO>>} 访客端流量DTO对象
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
Result <List<VisitorPortFlowDTO>> findList(VisitorPortFlowQueryListCommand visitorPortFlowQueryListCommand);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 分页查询多个访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowQueryListCommand 分页查询多个访客端流量
|
||||||
|
* @return {@link Result <LazyPage<VisitorPortFlowDTO>>} 分页访客端流量DTO对象
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
Result <LazyPage<VisitorPortFlowDTO>> findPage(int size, int current, VisitorPortFlowQueryListCommand visitorPortFlowQueryListCommand);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 删除访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowRemoveCommand 删除访客端流量
|
||||||
|
* @return {@link Result< VisitorPortFlow >} 访客端流量
|
||||||
|
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
Result<VisitorPortFlow> remove(VisitorPortFlowRemoveCommand visitorPortFlowRemoveCommand);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客户端查询流量
|
||||||
|
* @param size 分页大小
|
||||||
|
* @param current 分页
|
||||||
|
* @param visitorPortFlowQueryListCommand 查询条件
|
||||||
|
* @return {@link Result<LazyPage< VisitorFlowDTO >>} 分页访客端流量DTO对象
|
||||||
|
*/
|
||||||
|
Result<LazyPage<VisitorFlowDTO>> findClientFlowPage(int size, int current, VisitorPortFlowQueryListCommand visitorPortFlowQueryListCommand);
|
||||||
|
}
|
@ -1,93 +0,0 @@
|
|||||||
package wu.framework.lazy.cloud.heartbeat.server.application.assembler;
|
|
||||||
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorFlow;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorFlowRemoveCommand;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorFlowStoryCommand;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorFlowUpdateCommand;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorFlowQueryListCommand;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorFlowQueryOneCommand;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.dto.VisitorFlowDTO;
|
|
||||||
import org.mapstruct.factory.Mappers;
|
|
||||||
import org.mapstruct.Mapper;
|
|
||||||
/**
|
|
||||||
* describe 访客端流量
|
|
||||||
*
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
* @see com.wu.framework.inner.lazy.persistence.reverse.lazy.ddd.DefaultDDDLazyAssembler
|
|
||||||
**/
|
|
||||||
@Mapper
|
|
||||||
public interface VisitorFlowDTOAssembler {
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe MapStruct 创建的代理对象
|
|
||||||
*
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
VisitorFlowDTOAssembler INSTANCE = Mappers.getMapper(VisitorFlowDTOAssembler.class);
|
|
||||||
/**
|
|
||||||
* describe 应用层存储入参转换成 领域对象
|
|
||||||
*
|
|
||||||
* @param visitorFlowStoryCommand 保存访客端流量对象
|
|
||||||
* @return {@link VisitorFlow} 访客端流量领域对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
VisitorFlow toVisitorFlow(VisitorFlowStoryCommand visitorFlowStoryCommand);
|
|
||||||
/**
|
|
||||||
* describe 应用层更新入参转换成 领域对象
|
|
||||||
*
|
|
||||||
* @param visitorFlowUpdateCommand 更新访客端流量对象
|
|
||||||
* @return {@link VisitorFlow} 访客端流量领域对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
VisitorFlow toVisitorFlow(VisitorFlowUpdateCommand visitorFlowUpdateCommand);
|
|
||||||
/**
|
|
||||||
* describe 应用层查询入参转换成 领域对象
|
|
||||||
*
|
|
||||||
* @param visitorFlowQueryOneCommand 查询单个访客端流量对象参数
|
|
||||||
* @return {@link VisitorFlow} 访客端流量领域对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
VisitorFlow toVisitorFlow(VisitorFlowQueryOneCommand visitorFlowQueryOneCommand);
|
|
||||||
/**
|
|
||||||
* describe 应用层查询入参转换成 领域对象
|
|
||||||
*
|
|
||||||
* @param visitorFlowQueryListCommand 查询集合访客端流量对象参数
|
|
||||||
* @return {@link VisitorFlow} 访客端流量领域对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
VisitorFlow toVisitorFlow(VisitorFlowQueryListCommand visitorFlowQueryListCommand);
|
|
||||||
/**
|
|
||||||
* describe 应用层删除入参转换成 领域对象
|
|
||||||
*
|
|
||||||
* @param visitorFlowRemoveCommand 删除访客端流量对象参数
|
|
||||||
* @return {@link VisitorFlow} 访客端流量领域对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
VisitorFlow toVisitorFlow(VisitorFlowRemoveCommand visitorFlowRemoveCommand);
|
|
||||||
/**
|
|
||||||
* describe 持久层领域对象转换成DTO对象
|
|
||||||
*
|
|
||||||
* @param visitorFlow 访客端流量领域对象
|
|
||||||
* @return {@link VisitorFlowDTO} 访客端流量DTO对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
VisitorFlowDTO fromVisitorFlow(VisitorFlow visitorFlow);
|
|
||||||
}
|
|
@ -0,0 +1,87 @@
|
|||||||
|
package wu.framework.lazy.cloud.heartbeat.server.application.assembler;
|
||||||
|
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.*;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorPortFlow;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorPortFlowQueryListCommand;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.application.dto.VisitorPortFlowDTO;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 访客端流量
|
||||||
|
*
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
* @see com.wu.framework.inner.lazy.persistence.reverse.lazy.ddd.DefaultDDDLazyAssembler
|
||||||
|
**/
|
||||||
|
@Mapper
|
||||||
|
public interface VisitorPortFlowDTOAssembler {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe MapStruct 创建的代理对象
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
VisitorPortFlowDTOAssembler INSTANCE = Mappers.getMapper(VisitorPortFlowDTOAssembler.class);
|
||||||
|
/**
|
||||||
|
* describe 应用层存储入参转换成 领域对象
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowStoryCommand 保存访客端流量对象
|
||||||
|
* @return {@link VisitorPortFlow} 访客端流量领域对象
|
||||||
|
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
VisitorPortFlow toVisitorFlow(VisitorPortFlowStoryCommand visitorPortFlowStoryCommand);
|
||||||
|
/**
|
||||||
|
* describe 应用层更新入参转换成 领域对象
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowUpdateCommand 更新访客端流量对象
|
||||||
|
* @return {@link VisitorPortFlow} 访客端流量领域对象
|
||||||
|
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
VisitorPortFlow toVisitorFlow(VisitorPortFlowUpdateCommand visitorPortFlowUpdateCommand);
|
||||||
|
/**
|
||||||
|
* describe 应用层查询入参转换成 领域对象
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowQueryOneCommand 查询单个访客端流量对象参数
|
||||||
|
* @return {@link VisitorPortFlow} 访客端流量领域对象
|
||||||
|
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
VisitorPortFlow toVisitorFlow(VisitorPortFlowQueryOneCommand visitorPortFlowQueryOneCommand);
|
||||||
|
/**
|
||||||
|
* describe 应用层查询入参转换成 领域对象
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowQueryListCommand 查询集合访客端流量对象参数
|
||||||
|
* @return {@link VisitorPortFlow} 访客端流量领域对象
|
||||||
|
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
VisitorPortFlow toVisitorFlow(VisitorPortFlowQueryListCommand visitorPortFlowQueryListCommand);
|
||||||
|
/**
|
||||||
|
* describe 应用层删除入参转换成 领域对象
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowRemoveCommand 删除访客端流量对象参数
|
||||||
|
* @return {@link VisitorPortFlow} 访客端流量领域对象
|
||||||
|
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
VisitorPortFlow toVisitorFlow(VisitorPortFlowRemoveCommand visitorPortFlowRemoveCommand);
|
||||||
|
/**
|
||||||
|
* describe 持久层领域对象转换成DTO对象
|
||||||
|
*
|
||||||
|
* @param visitorPortFlow 访客端流量领域对象
|
||||||
|
* @return {@link VisitorPortFlowDTO} 访客端流量DTO对象
|
||||||
|
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
VisitorPortFlowDTO fromVisitorFlow(VisitorPortFlow visitorPortFlow);
|
||||||
|
}
|
@ -17,8 +17,8 @@ import java.lang.Boolean;
|
|||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@Schema(title = "visitor_flow_query_List_command",description = "访客端流量")
|
@Schema(title = "visitor_port_flow_query_List_command",description = "访客端流量")
|
||||||
public class VisitorFlowQueryListCommand {
|
public class VisitorPortFlowQueryListCommand {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
@ -17,8 +17,8 @@ import java.lang.Boolean;
|
|||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@Schema(title = "visitor_flow_query_one_command",description = "访客端流量")
|
@Schema(title = "visitor_port_flow_query_one_command",description = "访客端流量")
|
||||||
public class VisitorFlowQueryOneCommand {
|
public class VisitorPortFlowQueryOneCommand {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
@ -17,8 +17,8 @@ import java.lang.Boolean;
|
|||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@Schema(title = "visitor_flow_remove_command",description = "访客端流量")
|
@Schema(title = "visitor_port_flow_remove_command",description = "访客端流量")
|
||||||
public class VisitorFlowRemoveCommand {
|
public class VisitorPortFlowRemoveCommand {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
@ -17,8 +17,8 @@ import java.lang.Boolean;
|
|||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@Schema(title = "visitor_flow_story_command",description = "访客端流量")
|
@Schema(title = "visitor_port_flow_story_command",description = "访客端流量")
|
||||||
public class VisitorFlowStoryCommand {
|
public class VisitorPortFlowStoryCommand {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
@ -17,8 +17,8 @@ import java.lang.Boolean;
|
|||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@Schema(title = "visitor_flow_update_command",description = "访客端流量")
|
@Schema(title = "visitor_port_flow_update_command",description = "访客端流量")
|
||||||
public class VisitorFlowUpdateCommand {
|
public class VisitorPortFlowUpdateCommand {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
@ -1,80 +1,66 @@
|
|||||||
package wu.framework.lazy.cloud.heartbeat.server.application.dto;
|
package wu.framework.lazy.cloud.heartbeat.server.application.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import java.lang.String;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.lang.Long;
|
import java.util.List;
|
||||||
import java.lang.Integer;
|
|
||||||
import java.lang.Boolean;
|
|
||||||
/**
|
/**
|
||||||
* describe 访客端流量
|
* describe 访客端流量
|
||||||
*
|
*
|
||||||
* @author Jia wei Wu
|
* @author Jia wei Wu
|
||||||
* @date 2024/01/24 05:19 下午
|
* @date 2024/01/24 05:19 下午
|
||||||
* @see com.wu.framework.inner.lazy.persistence.reverse.lazy.ddd.DefaultDDDLazyDTO
|
* @see com.wu.framework.inner.lazy.persistence.reverse.lazy.ddd.DefaultDDDLazyDTO
|
||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@Schema(title = "visitor_flow_command_dto",description = "访客端流量")
|
@Schema(title = "visitor_port_flow_command_dto", description = "访客端流量")
|
||||||
public class VisitorFlowDTO {
|
public class VisitorFlowDTO {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* 客户端ID
|
* 客户端ID
|
||||||
*/
|
*/
|
||||||
@Schema(description ="客户端ID",name ="clientId",example = "")
|
@Schema(description = "客户端ID", name = "clientId", example = "")
|
||||||
private String clientId;
|
private String clientId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
@Schema(description ="创建时间",name ="createTime",example = "")
|
@Schema(description = "创建时间", name = "createTime", example = "")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* 主键
|
* 主键
|
||||||
*/
|
*/
|
||||||
@Schema(description ="主键",name ="id",example = "")
|
@Schema(description = "主键", name = "id", example = "")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* 当前访客当前进口流量
|
* 当前访客当前进口流量
|
||||||
*/
|
*/
|
||||||
@Schema(description ="当前访客当前进口流量",name ="inFlow",example = "")
|
@Schema(description = "当前访客当前进口流量", name = "inFlow", example = "")
|
||||||
private Integer inFlow;
|
private Integer inFlow;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* 是否删除
|
|
||||||
*/
|
|
||||||
@Schema(description ="是否删除",name ="isDeleted",example = "")
|
|
||||||
private Boolean isDeleted;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* 当前访客出口流量
|
* 当前访客出口流量
|
||||||
*/
|
*/
|
||||||
@Schema(description ="当前访客出口流量",name ="outFlow",example = "")
|
@Schema(description = "当前访客出口流量", name = "outFlow", example = "")
|
||||||
private Integer outFlow;
|
private Integer outFlow;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* 修改时间
|
* 修改时间
|
||||||
*/
|
*/
|
||||||
@Schema(description ="修改时间",name ="updateTime",example = "")
|
@Schema(description = "修改时间", name = "updateTime", example = "")
|
||||||
private LocalDateTime updateTime;
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* 当前访客下所有端口的流量
|
||||||
* 访客端口
|
|
||||||
*/
|
*/
|
||||||
@Schema(description ="访客端口",name ="visitorPort",example = "")
|
@Schema(description = "当前访客下所有端口的流量")
|
||||||
private Integer visitorPort;
|
private List<VisitorPortFlowDTO> visitorPortFlowDTOList;
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,80 @@
|
|||||||
|
package wu.framework.lazy.cloud.heartbeat.server.application.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import java.lang.String;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.lang.Long;
|
||||||
|
import java.lang.Integer;
|
||||||
|
import java.lang.Boolean;
|
||||||
|
/**
|
||||||
|
* describe 访客端流量
|
||||||
|
*
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
* @see com.wu.framework.inner.lazy.persistence.reverse.lazy.ddd.DefaultDDDLazyDTO
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@Schema(title = "visitor_port_flow_command_dto",description = "访客端流量")
|
||||||
|
public class VisitorPortFlowDTO {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 客户端ID
|
||||||
|
*/
|
||||||
|
@Schema(description ="客户端ID",name ="clientId",example = "")
|
||||||
|
private String clientId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Schema(description ="创建时间",name ="createTime",example = "")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@Schema(description ="主键",name ="id",example = "")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 当前访客当前进口流量
|
||||||
|
*/
|
||||||
|
@Schema(description ="当前访客当前进口流量",name ="inFlow",example = "")
|
||||||
|
private Integer inFlow;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 是否删除
|
||||||
|
*/
|
||||||
|
@Schema(description ="是否删除",name ="isDeleted",example = "")
|
||||||
|
private Boolean isDeleted;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 当前访客出口流量
|
||||||
|
*/
|
||||||
|
@Schema(description ="当前访客出口流量",name ="outFlow",example = "")
|
||||||
|
private Integer outFlow;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@Schema(description ="修改时间",name ="updateTime",example = "")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 访客端口
|
||||||
|
*/
|
||||||
|
@Schema(description ="访客端口",name ="visitorPort",example = "")
|
||||||
|
private Integer visitorPort;
|
||||||
|
|
||||||
|
}
|
@ -1,144 +0,0 @@
|
|||||||
package wu.framework.lazy.cloud.heartbeat.server.application.impl;
|
|
||||||
|
|
||||||
import com.wu.framework.database.lazy.web.plus.stereotype.LazyApplication;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.VisitorFlowApplication;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import com.wu.framework.response.Result;
|
|
||||||
import com.wu.framework.response.ResultFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorFlow;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorFlowRemoveCommand;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorFlowStoryCommand;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorFlowUpdateCommand;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorFlowQueryListCommand;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorFlowQueryOneCommand;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.assembler.VisitorFlowDTOAssembler;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.dto.VisitorFlowDTO;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorFlowRepository;
|
|
||||||
import java.util.List;
|
|
||||||
import com.wu.framework.inner.lazy.database.expand.database.persistence.domain.LazyPage;
|
|
||||||
/**
|
|
||||||
* describe 访客端流量
|
|
||||||
*
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
* @see com.wu.framework.inner.lazy.persistence.reverse.lazy.ddd.DefaultDDDLazyApplicationImpl
|
|
||||||
**/
|
|
||||||
@LazyApplication
|
|
||||||
public class VisitorFlowApplicationImpl implements VisitorFlowApplication {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
VisitorFlowRepository visitorFlowRepository;
|
|
||||||
/**
|
|
||||||
* describe 新增访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowStoryCommand 新增访客端流量
|
|
||||||
* @return {@link Result<VisitorFlow>} 访客端流量新增后领域对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result<VisitorFlow> story(VisitorFlowStoryCommand visitorFlowStoryCommand) {
|
|
||||||
VisitorFlow visitorFlow = VisitorFlowDTOAssembler.INSTANCE.toVisitorFlow(visitorFlowStoryCommand);
|
|
||||||
return visitorFlowRepository.story(visitorFlow);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* describe 批量新增访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowStoryCommandList 批量新增访客端流量
|
|
||||||
* @return {@link Result<List<VisitorFlow>>} 访客端流量新增后领域对象集合
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result<List<VisitorFlow>> batchStory(List<VisitorFlowStoryCommand> visitorFlowStoryCommandList) {
|
|
||||||
List<VisitorFlow> visitorFlowList = visitorFlowStoryCommandList.stream().map( VisitorFlowDTOAssembler.INSTANCE::toVisitorFlow).collect(Collectors.toList());
|
|
||||||
return visitorFlowRepository.batchStory(visitorFlowList);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* describe 更新访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowUpdateCommand 更新访客端流量
|
|
||||||
* @return {@link Result<VisitorFlow>} 访客端流量领域对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result<VisitorFlow> updateOne(VisitorFlowUpdateCommand visitorFlowUpdateCommand) {
|
|
||||||
VisitorFlow visitorFlow = VisitorFlowDTOAssembler.INSTANCE.toVisitorFlow(visitorFlowUpdateCommand);
|
|
||||||
return visitorFlowRepository.story(visitorFlow);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 查询单个访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowQueryOneCommand 查询单个访客端流量
|
|
||||||
* @return {@link Result<VisitorFlowDTO>} 访客端流量DTO对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result<VisitorFlowDTO> findOne(VisitorFlowQueryOneCommand visitorFlowQueryOneCommand) {
|
|
||||||
VisitorFlow visitorFlow = VisitorFlowDTOAssembler.INSTANCE.toVisitorFlow(visitorFlowQueryOneCommand);
|
|
||||||
return visitorFlowRepository.findOne(visitorFlow).convert(VisitorFlowDTOAssembler.INSTANCE::fromVisitorFlow);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 查询多个访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowQueryListCommand 查询多个访客端流量
|
|
||||||
* @return {@link Result<List<VisitorFlowDTO>>} 访客端流量DTO对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result<List<VisitorFlowDTO>> findList(VisitorFlowQueryListCommand visitorFlowQueryListCommand) {
|
|
||||||
VisitorFlow visitorFlow = VisitorFlowDTOAssembler.INSTANCE.toVisitorFlow(visitorFlowQueryListCommand);
|
|
||||||
return visitorFlowRepository.findList(visitorFlow) .convert(visitorFlows -> visitorFlows.stream().map(VisitorFlowDTOAssembler.INSTANCE::fromVisitorFlow).collect(Collectors.toList())) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 分页查询多个访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowQueryListCommand 分页查询多个访客端流量
|
|
||||||
* @return {@link Result<LazyPage<VisitorFlowDTO>>} 分页访客端流量DTO对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result<LazyPage<VisitorFlowDTO>> findPage(int size,int current,VisitorFlowQueryListCommand visitorFlowQueryListCommand) {
|
|
||||||
VisitorFlow visitorFlow = VisitorFlowDTOAssembler.INSTANCE.toVisitorFlow(visitorFlowQueryListCommand);
|
|
||||||
return visitorFlowRepository.findPage(size,current,visitorFlow) .convert(page -> page.convert(VisitorFlowDTOAssembler.INSTANCE::fromVisitorFlow)) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 删除访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowRemoveCommand 删除访客端流量
|
|
||||||
* @return {@link Result<VisitorFlow>} 访客端流量
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result<VisitorFlow> remove(VisitorFlowRemoveCommand visitorFlowRemoveCommand) {
|
|
||||||
VisitorFlow visitorFlow = VisitorFlowDTOAssembler.INSTANCE.toVisitorFlow(visitorFlowRemoveCommand);
|
|
||||||
return visitorFlowRepository.remove(visitorFlow);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -0,0 +1,186 @@
|
|||||||
|
package wu.framework.lazy.cloud.heartbeat.server.application.impl;
|
||||||
|
|
||||||
|
import com.wu.framework.database.lazy.web.plus.stereotype.LazyApplication;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.application.VisitorPortFlowApplication;
|
||||||
|
import com.wu.framework.response.Result;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.application.assembler.VisitorPortFlowDTOAssembler;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.*;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.application.dto.VisitorFlowDTO;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.application.dto.VisitorPortFlowDTO;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorPortFlow;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorPortFlowQueryListCommand;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorPortFlowRepository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.wu.framework.inner.lazy.database.expand.database.persistence.domain.LazyPage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 访客端流量
|
||||||
|
*
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
* @see com.wu.framework.inner.lazy.persistence.reverse.lazy.ddd.DefaultDDDLazyApplicationImpl
|
||||||
|
**/
|
||||||
|
@LazyApplication
|
||||||
|
public class VisitorPortFlowApplicationImpl implements VisitorPortFlowApplication {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
VisitorPortFlowRepository visitorPortFlowRepository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 新增访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowStoryCommand 新增访客端流量
|
||||||
|
* @return {@link Result< VisitorPortFlow >} 访客端流量新增后领域对象
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<VisitorPortFlow> story(VisitorPortFlowStoryCommand visitorPortFlowStoryCommand) {
|
||||||
|
VisitorPortFlow visitorPortFlow = VisitorPortFlowDTOAssembler.INSTANCE.toVisitorFlow(visitorPortFlowStoryCommand);
|
||||||
|
return visitorPortFlowRepository.story(visitorPortFlow);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 批量新增访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowStoryCommandList 批量新增访客端流量
|
||||||
|
* @return {@link Result<List< VisitorPortFlow >>} 访客端流量新增后领域对象集合
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<List<VisitorPortFlow>> batchStory(List<VisitorPortFlowStoryCommand> visitorPortFlowStoryCommandList) {
|
||||||
|
List<VisitorPortFlow> visitorPortFlowList = visitorPortFlowStoryCommandList.stream().map(VisitorPortFlowDTOAssembler.INSTANCE::toVisitorFlow).collect(Collectors.toList());
|
||||||
|
return visitorPortFlowRepository.batchStory(visitorPortFlowList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 更新访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowUpdateCommand 更新访客端流量
|
||||||
|
* @return {@link Result< VisitorPortFlow >} 访客端流量领域对象
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<VisitorPortFlow> updateOne(VisitorPortFlowUpdateCommand visitorPortFlowUpdateCommand) {
|
||||||
|
VisitorPortFlow visitorPortFlow = VisitorPortFlowDTOAssembler.INSTANCE.toVisitorFlow(visitorPortFlowUpdateCommand);
|
||||||
|
return visitorPortFlowRepository.story(visitorPortFlow);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 查询单个访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowQueryOneCommand 查询单个访客端流量
|
||||||
|
* @return {@link Result< VisitorFlowDTO >} 访客端流量DTO对象
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<VisitorPortFlowDTO> findOne(VisitorPortFlowQueryOneCommand visitorPortFlowQueryOneCommand) {
|
||||||
|
VisitorPortFlow visitorPortFlow = VisitorPortFlowDTOAssembler.INSTANCE.toVisitorFlow(visitorPortFlowQueryOneCommand);
|
||||||
|
return visitorPortFlowRepository.findOne(visitorPortFlow).convert(VisitorPortFlowDTOAssembler.INSTANCE::fromVisitorFlow);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 查询多个访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorFlowQueryListCommand 查询多个访客端流量
|
||||||
|
* @return {@link Result<List< VisitorFlowDTO >>} 访客端流量DTO对象
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<List<VisitorPortFlowDTO>> findList(VisitorPortFlowQueryListCommand visitorFlowQueryListCommand) {
|
||||||
|
VisitorPortFlow visitorPortFlow = VisitorPortFlowDTOAssembler.INSTANCE.toVisitorFlow(visitorFlowQueryListCommand);
|
||||||
|
return visitorPortFlowRepository.findList(visitorPortFlow).convert(visitorFlows -> visitorFlows.stream().map(VisitorPortFlowDTOAssembler.INSTANCE::fromVisitorFlow).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 分页查询多个访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowQueryListCommand 分页查询多个访客端流量
|
||||||
|
* @return {@link Result<LazyPage< VisitorPortFlowDTO >>} 分页访客端流量DTO对象
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<LazyPage<VisitorPortFlowDTO>> findPage(int size, int current, VisitorPortFlowQueryListCommand visitorPortFlowQueryListCommand) {
|
||||||
|
VisitorPortFlow visitorPortFlow = VisitorPortFlowDTOAssembler.INSTANCE.toVisitorFlow(visitorPortFlowQueryListCommand);
|
||||||
|
return visitorPortFlowRepository.findPage(size, current, visitorPortFlow).convert(page -> page.convert(VisitorPortFlowDTOAssembler.INSTANCE::fromVisitorFlow));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 删除访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowRemoveCommand 删除访客端流量
|
||||||
|
* @return {@link Result< VisitorPortFlow >} 访客端流量
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<VisitorPortFlow> remove(VisitorPortFlowRemoveCommand visitorPortFlowRemoveCommand) {
|
||||||
|
VisitorPortFlow visitorPortFlow = VisitorPortFlowDTOAssembler.INSTANCE.toVisitorFlow(visitorPortFlowRemoveCommand);
|
||||||
|
return visitorPortFlowRepository.remove(visitorPortFlow);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客户端查询流量
|
||||||
|
*
|
||||||
|
* @param size 分页大小
|
||||||
|
* @param current 分页
|
||||||
|
* @param visitorPortFlowQueryListCommand 查询条件
|
||||||
|
* @return {@link Result<LazyPage< VisitorFlowDTO >>} 分页访客端流量DTO对象
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result<LazyPage<VisitorFlowDTO>> findClientFlowPage(int size, int current, VisitorPortFlowQueryListCommand visitorPortFlowQueryListCommand) {
|
||||||
|
VisitorPortFlow visitorPortFlow = VisitorPortFlowDTOAssembler.INSTANCE.toVisitorFlow(visitorPortFlowQueryListCommand);
|
||||||
|
return visitorPortFlowRepository.findPageGroupByClientId(size, current, visitorPortFlow).convert(visitorPortFlowLazyPage -> {
|
||||||
|
List<String> clientIdList = visitorPortFlowLazyPage.getRecord().stream().map(VisitorPortFlow::getClientId).toList();
|
||||||
|
List<VisitorPortFlow> visitorPortFlowList = visitorPortFlowRepository.findListByClientIds(clientIdList);
|
||||||
|
|
||||||
|
|
||||||
|
// 根据客户端进行分组
|
||||||
|
|
||||||
|
List<VisitorPortFlowDTO> visitorPortFlowDTOList = visitorPortFlowList.stream().map(VisitorPortFlowDTOAssembler.INSTANCE::fromVisitorFlow).toList();
|
||||||
|
|
||||||
|
|
||||||
|
Map<String/*客户端ID*/, List<VisitorPortFlowDTO>> client_port_flow_map = visitorPortFlowDTOList.stream().collect(Collectors.groupingBy(visitorPortFlowDTO -> visitorPortFlowDTO.getClientId()));
|
||||||
|
|
||||||
|
Map<String/*客户端ID*/, Integer/*客户端进口流量*/> client_in_flow = visitorPortFlowDTOList.stream()
|
||||||
|
.collect(
|
||||||
|
Collectors.groupingBy(VisitorPortFlowDTO::getClientId,
|
||||||
|
Collectors.summingInt(VisitorPortFlowDTO::getInFlow)));
|
||||||
|
|
||||||
|
Map<String/*客户端ID*/, Integer/*客户端出口流量*/> client_out_flow = visitorPortFlowDTOList.stream()
|
||||||
|
.collect(
|
||||||
|
Collectors.groupingBy(VisitorPortFlowDTO::getClientId,
|
||||||
|
Collectors.summingInt(VisitorPortFlowDTO::getOutFlow)));
|
||||||
|
|
||||||
|
return visitorPortFlowLazyPage.convert(visitorPortFlow1 -> {
|
||||||
|
String clientId = visitorPortFlow1.getClientId();
|
||||||
|
VisitorFlowDTO visitorFlowDTO = new VisitorFlowDTO();
|
||||||
|
visitorFlowDTO.setClientId(clientId);
|
||||||
|
visitorFlowDTO.setInFlow(client_in_flow.getOrDefault(clientId, 0));
|
||||||
|
visitorFlowDTO.setOutFlow(client_out_flow.getOrDefault(clientId, 0));
|
||||||
|
visitorFlowDTO.setVisitorPortFlowDTOList(client_port_flow_map.getOrDefault(clientId, new ArrayList<>()));
|
||||||
|
return visitorFlowDTO;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -1,142 +0,0 @@
|
|||||||
package wu.framework.lazy.cloud.heartbeat.server.controller;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import com.wu.framework.inner.layer.web.EasyController;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import com.wu.framework.response.Result;
|
|
||||||
import com.wu.framework.response.ResultFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorFlow;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorFlowRemoveCommand;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorFlowStoryCommand;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorFlowUpdateCommand;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorFlowQueryListCommand;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.VisitorFlowQueryOneCommand;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.VisitorFlowApplication;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.application.dto.VisitorFlowDTO;
|
|
||||||
import java.util.List;
|
|
||||||
import com.wu.framework.inner.lazy.database.expand.database.persistence.domain.LazyPage;
|
|
||||||
/**
|
|
||||||
* describe 访客端流量
|
|
||||||
*
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
* @see com.wu.framework.inner.lazy.persistence.reverse.lazy.ddd.DefaultDDDLazyController
|
|
||||||
**/
|
|
||||||
@Tag(name = "访客端流量提供者")
|
|
||||||
@EasyController("/visitor/flow")
|
|
||||||
public class VisitorFlowProvider {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private VisitorFlowApplication visitorFlowApplication;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 新增访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowStoryCommand 新增访客端流量
|
|
||||||
* @return {@link Result<VisitorFlow>} 访客端流量新增后领域对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Operation(summary = "新增访客端流量")
|
|
||||||
@PostMapping("/story")
|
|
||||||
public Result<VisitorFlow> story(@RequestBody VisitorFlowStoryCommand visitorFlowStoryCommand){
|
|
||||||
return visitorFlowApplication.story(visitorFlowStoryCommand);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* describe 批量新增访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowStoryCommandList 批量新增访客端流量
|
|
||||||
* @return {@link Result<List<VisitorFlow>>} 访客端流量新增后领域对象集合
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Operation(summary = "批量新增访客端流量")
|
|
||||||
@PostMapping("/batchStory")
|
|
||||||
public Result<List<VisitorFlow>> batchStory(@RequestBody List<VisitorFlowStoryCommand> visitorFlowStoryCommandList){
|
|
||||||
return visitorFlowApplication.batchStory(visitorFlowStoryCommandList);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* describe 更新访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowUpdateCommand 更新访客端流量
|
|
||||||
* @return {@link Result<VisitorFlow>} 访客端流量领域对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Operation(summary = "更新访客端流量")
|
|
||||||
@PutMapping("/updateOne")
|
|
||||||
public Result<VisitorFlow> updateOne(@RequestBody VisitorFlowUpdateCommand visitorFlowUpdateCommand){
|
|
||||||
return visitorFlowApplication.updateOne(visitorFlowUpdateCommand);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* describe 查询单个访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowQueryOneCommand 查询单个访客端流量
|
|
||||||
* @return {@link Result<VisitorFlowDTO>} 访客端流量DTO对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Operation(summary = "查询单个访客端流量")
|
|
||||||
@GetMapping("/findOne")
|
|
||||||
public Result<VisitorFlowDTO> findOne(@ModelAttribute VisitorFlowQueryOneCommand visitorFlowQueryOneCommand){
|
|
||||||
return visitorFlowApplication.findOne(visitorFlowQueryOneCommand);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* describe 查询多个访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowQueryListCommand 查询多个访客端流量
|
|
||||||
* @return {@link Result<List<VisitorFlowDTO>>} 访客端流量DTO对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Operation(summary = "查询多个访客端流量")
|
|
||||||
@GetMapping("/findList")
|
|
||||||
public Result<List<VisitorFlowDTO>> findList(@ModelAttribute VisitorFlowQueryListCommand visitorFlowQueryListCommand){
|
|
||||||
return visitorFlowApplication.findList(visitorFlowQueryListCommand);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* describe 分页查询多个访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowQueryListCommand 分页查询多个访客端流量
|
|
||||||
* @return {@link Result<LazyPage<VisitorFlowDTO>>} 分页访客端流量DTO对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询多个访客端流量")
|
|
||||||
@GetMapping("/findPage")
|
|
||||||
public Result<LazyPage<VisitorFlowDTO>> findPage(@Parameter(description ="分页大小") @RequestParam(defaultValue = "10", value = "size") int size,
|
|
||||||
@Parameter(description ="当前页数") @RequestParam(defaultValue = "1", value = "current") int current,@ModelAttribute VisitorFlowQueryListCommand visitorFlowQueryListCommand){
|
|
||||||
return visitorFlowApplication.findPage(size,current,visitorFlowQueryListCommand);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* describe 删除访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowRemoveCommand 删除访客端流量
|
|
||||||
* @return {@link Result<VisitorFlow>} 访客端流量
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Operation(summary = "删除访客端流量")
|
|
||||||
@DeleteMapping("/remove")
|
|
||||||
public Result<VisitorFlow> remove(@ModelAttribute VisitorFlowRemoveCommand visitorFlowRemoveCommand){
|
|
||||||
return visitorFlowApplication.remove(visitorFlowRemoveCommand);
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,154 @@
|
|||||||
|
package wu.framework.lazy.cloud.heartbeat.server.controller;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import com.wu.framework.inner.layer.web.EasyController;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import com.wu.framework.response.Result;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.application.VisitorPortFlowApplication;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.wu.framework.inner.lazy.database.expand.database.persistence.domain.LazyPage;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.application.command.visitor.flow.*;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.application.dto.VisitorFlowDTO;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.application.dto.VisitorPortFlowDTO;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorPortFlow;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 访客端流量
|
||||||
|
*
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
* @see com.wu.framework.inner.lazy.persistence.reverse.lazy.ddd.DefaultDDDLazyController
|
||||||
|
**/
|
||||||
|
@Tag(name = "访客端流量提供者")
|
||||||
|
@EasyController("/visitor/port/flow")
|
||||||
|
public class VisitorPortFlowProvider {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private VisitorPortFlowApplication visitorPortFlowApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 新增访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowStoryCommand 新增访客端流量
|
||||||
|
* @return {@link Result< VisitorPortFlow >} 访客端流量新增后领域对象
|
||||||
|
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Operation(summary = "新增访客端流量")
|
||||||
|
@PostMapping("/story")
|
||||||
|
public Result<VisitorPortFlow> story(@RequestBody VisitorPortFlowStoryCommand visitorPortFlowStoryCommand){
|
||||||
|
return visitorPortFlowApplication.story(visitorPortFlowStoryCommand);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* describe 批量新增访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowStoryCommandList 批量新增访客端流量
|
||||||
|
* @return {@link Result<List< VisitorPortFlow >>} 访客端流量新增后领域对象集合
|
||||||
|
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Operation(summary = "批量新增访客端流量")
|
||||||
|
@PostMapping("/batchStory")
|
||||||
|
public Result<List<VisitorPortFlow>> batchStory(@RequestBody List<VisitorPortFlowStoryCommand> visitorPortFlowStoryCommandList){
|
||||||
|
return visitorPortFlowApplication.batchStory(visitorPortFlowStoryCommandList);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* describe 更新访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowUpdateCommand 更新访客端流量
|
||||||
|
* @return {@link Result< VisitorPortFlow >} 访客端流量领域对象
|
||||||
|
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Operation(summary = "更新访客端流量")
|
||||||
|
@PutMapping("/updateOne")
|
||||||
|
public Result<VisitorPortFlow> updateOne(@RequestBody VisitorPortFlowUpdateCommand visitorPortFlowUpdateCommand){
|
||||||
|
return visitorPortFlowApplication.updateOne(visitorPortFlowUpdateCommand);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* describe 查询单个访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowQueryOneCommand 查询单个访客端流量
|
||||||
|
* @return {@link Result< VisitorPortFlowDTO >} 访客端流量DTO对象
|
||||||
|
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Operation(summary = "查询单个访客端流量")
|
||||||
|
@GetMapping("/findOne")
|
||||||
|
public Result<VisitorPortFlowDTO> findOne(@ModelAttribute VisitorPortFlowQueryOneCommand visitorPortFlowQueryOneCommand){
|
||||||
|
return visitorPortFlowApplication.findOne(visitorPortFlowQueryOneCommand);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* describe 查询多个访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowQueryListCommand 查询多个访客端流量
|
||||||
|
* @return {@link Result<List< VisitorPortFlowDTO >>} 访客端流量DTO对象
|
||||||
|
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Operation(summary = "查询多个访客端流量")
|
||||||
|
@GetMapping("/findList")
|
||||||
|
public Result<List<VisitorPortFlowDTO>> findList(@ModelAttribute VisitorPortFlowQueryListCommand visitorPortFlowQueryListCommand){
|
||||||
|
return visitorPortFlowApplication.findList(visitorPortFlowQueryListCommand);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* describe 分页查询多个访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowQueryListCommand 分页查询多个访客端流量
|
||||||
|
* @return {@link Result<LazyPage< VisitorPortFlowDTO >>} 分页访客端流量DTO对象
|
||||||
|
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询多个访客端流量")
|
||||||
|
@GetMapping("/findPage")
|
||||||
|
public Result<LazyPage<VisitorPortFlowDTO>> findPage(@Parameter(description ="分页大小") @RequestParam(defaultValue = "10", value = "size") int size,
|
||||||
|
@Parameter(description ="当前页数") @RequestParam(defaultValue = "1", value = "current") int current, @ModelAttribute VisitorPortFlowQueryListCommand visitorPortFlowQueryListCommand){
|
||||||
|
return visitorPortFlowApplication.findPage(size,current, visitorPortFlowQueryListCommand);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客户端查询流量
|
||||||
|
* @param size 分页大小
|
||||||
|
* @param current 分页
|
||||||
|
* @param visitorPortFlowQueryListCommand 查询条件
|
||||||
|
* @return {@link Result<LazyPage< VisitorFlowDTO >>} 分页访客端流量DTO对象
|
||||||
|
*/
|
||||||
|
@Operation(summary = "分页查询多个访客端流量")
|
||||||
|
@GetMapping("/findClientFlowPage")
|
||||||
|
public Result<LazyPage<VisitorFlowDTO>> findClientFlowPage(@Parameter(description ="分页大小") @RequestParam(defaultValue = "10", value = "size") int size,
|
||||||
|
@Parameter(description ="当前页数") @RequestParam(defaultValue = "1", value = "current") int current, @ModelAttribute VisitorPortFlowQueryListCommand visitorPortFlowQueryListCommand){
|
||||||
|
return visitorPortFlowApplication.findClientFlowPage(size,current, visitorPortFlowQueryListCommand);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* describe 删除访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowRemoveCommand 删除访客端流量
|
||||||
|
* @return {@link Result< VisitorPortFlow >} 访客端流量
|
||||||
|
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Operation(summary = "删除访客端流量")
|
||||||
|
@DeleteMapping("/remove")
|
||||||
|
public Result<VisitorPortFlow> remove(@ModelAttribute VisitorPortFlowRemoveCommand visitorPortFlowRemoveCommand){
|
||||||
|
return visitorPortFlowApplication.remove(visitorPortFlowRemoveCommand);
|
||||||
|
}
|
||||||
|
}
|
@ -1,106 +0,0 @@
|
|||||||
package wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow;
|
|
||||||
|
|
||||||
import com.wu.framework.response.Result;
|
|
||||||
import com.wu.framework.response.ResultFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorFlow;
|
|
||||||
import java.util.List;
|
|
||||||
import com.wu.framework.inner.lazy.database.expand.database.persistence.domain.LazyPage;
|
|
||||||
/**
|
|
||||||
* describe 访客端流量
|
|
||||||
*
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
* @see com.wu.framework.inner.lazy.persistence.reverse.lazy.ddd.DefaultDDDLazyDomainRepository
|
|
||||||
**/
|
|
||||||
|
|
||||||
public interface VisitorFlowRepository {
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 新增访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlow 新增访客端流量
|
|
||||||
* @return {@link Result<VisitorFlow>} 访客端流量新增后领域对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
Result<VisitorFlow> story(VisitorFlow visitorFlow);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 批量新增访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowList 批量新增访客端流量
|
|
||||||
* @return {@link Result<List<VisitorFlow>>} 访客端流量新增后领域对象集合
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
Result<List<VisitorFlow>> batchStory(List<VisitorFlow> visitorFlowList);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 查询单个访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlow 查询单个访客端流量
|
|
||||||
* @return {@link Result<VisitorFlow>} 访客端流量DTO对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
Result<VisitorFlow> findOne(VisitorFlow visitorFlow);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 查询多个访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlow 查询多个访客端流量
|
|
||||||
* @return {@link Result<List<VisitorFlow>>} 访客端流量DTO对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
Result<List<VisitorFlow>> findList(VisitorFlow visitorFlow);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 分页查询多个访客端流量
|
|
||||||
*
|
|
||||||
* @param size 当前页数
|
|
||||||
* @param current 当前页
|
|
||||||
* @param visitorFlow 分页查询多个访客端流量
|
|
||||||
* @return {@link Result<LazyPage<VisitorFlow>>} 分页访客端流量领域对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
Result<LazyPage<VisitorFlow>> findPage(int size,int current,VisitorFlow visitorFlow);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 删除访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlow 删除访客端流量
|
|
||||||
* @return {@link Result<VisitorFlow>} 访客端流量
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
Result<VisitorFlow> remove(VisitorFlow visitorFlow);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 是否存在访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlow 是否存在访客端流量
|
|
||||||
* @return {@link Result<Boolean>} 访客端流量是否存在
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
Result<Boolean> exists(VisitorFlow visitorFlow);
|
|
||||||
|
|
||||||
}
|
|
@ -17,8 +17,8 @@ import java.lang.Boolean;
|
|||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@Schema(title = "visitor_flow",description = "访客端流量")
|
@Schema(title = "visitor_port_flow",description = "访客端流量")
|
||||||
public class VisitorFlow {
|
public class VisitorPortFlow {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
@ -0,0 +1,117 @@
|
|||||||
|
package wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow;
|
||||||
|
|
||||||
|
import ch.qos.logback.classic.util.LevelToSyslogSeverity;
|
||||||
|
import com.wu.framework.response.Result;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.wu.framework.inner.lazy.database.expand.database.persistence.domain.LazyPage;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.application.dto.VisitorFlowDTO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 访客端流量
|
||||||
|
*
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
* @see com.wu.framework.inner.lazy.persistence.reverse.lazy.ddd.DefaultDDDLazyDomainRepository
|
||||||
|
**/
|
||||||
|
|
||||||
|
public interface VisitorPortFlowRepository {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 新增访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlow 新增访客端流量
|
||||||
|
* @return {@link Result< VisitorPortFlow >} 访客端流量新增后领域对象
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
Result<VisitorPortFlow> story(VisitorPortFlow visitorPortFlow);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 批量新增访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowList 批量新增访客端流量
|
||||||
|
* @return {@link Result<List< VisitorPortFlow >>} 访客端流量新增后领域对象集合
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
Result<List<VisitorPortFlow>> batchStory(List<VisitorPortFlow> visitorPortFlowList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 查询单个访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlow 查询单个访客端流量
|
||||||
|
* @return {@link Result< VisitorPortFlow >} 访客端流量DTO对象
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
Result<VisitorPortFlow> findOne(VisitorPortFlow visitorPortFlow);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 查询多个访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlow 查询多个访客端流量
|
||||||
|
* @return {@link Result<List< VisitorPortFlow >>} 访客端流量DTO对象
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
Result<List<VisitorPortFlow>> findList(VisitorPortFlow visitorPortFlow);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 分页查询多个访客端流量
|
||||||
|
*
|
||||||
|
* @param size 当前页数
|
||||||
|
* @param current 当前页
|
||||||
|
* @param visitorPortFlow 分页查询多个访客端流量
|
||||||
|
* @return {@link Result<LazyPage< VisitorPortFlow >>} 分页访客端流量领域对象
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
Result<LazyPage<VisitorPortFlow>> findPage(int size, int current, VisitorPortFlow visitorPortFlow);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 删除访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlow 删除访客端流量
|
||||||
|
* @return {@link Result< VisitorPortFlow >} 访客端流量
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
Result<VisitorPortFlow> remove(VisitorPortFlow visitorPortFlow);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 是否存在访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlow 是否存在访客端流量
|
||||||
|
* @return {@link Result<Boolean>} 访客端流量是否存在
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
Result<Boolean> exists(VisitorPortFlow visitorPortFlow);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客户端查询流量
|
||||||
|
*
|
||||||
|
* @param size 分页大小
|
||||||
|
* @param current 分页
|
||||||
|
* @param visitorPortFlow 查询条件
|
||||||
|
* @return {@link Result<LazyPage< VisitorPortFlow >>} 分页访客端流量DTO对象
|
||||||
|
*/
|
||||||
|
Result<LazyPage<VisitorPortFlow>> findPageGroupByClientId(int size, int current, VisitorPortFlow visitorPortFlow);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客户端ID查询出 客户端所有的进出口流量
|
||||||
|
* @param clientIdList 客户端ID
|
||||||
|
* @return 客户端所有的进出口流量
|
||||||
|
*/
|
||||||
|
List<VisitorPortFlow> findListByClientIds(List<String> clientIdList);
|
||||||
|
}
|
@ -1,9 +1,10 @@
|
|||||||
package wu.framework.lazy.cloud.heartbeat.server.infrastructure.converter;
|
package wu.framework.lazy.cloud.heartbeat.server.infrastructure.converter;
|
||||||
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorFlow;
|
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorPortFlow;
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.infrastructure.entity.VisitorFlowDO;
|
import wu.framework.lazy.cloud.heartbeat.server.infrastructure.entity.VisitorPortFlowDO;
|
||||||
import org.mapstruct.factory.Mappers;
|
import org.mapstruct.factory.Mappers;
|
||||||
import org.mapstruct.Mapper;
|
import org.mapstruct.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* describe 访客端流量
|
* describe 访客端流量
|
||||||
*
|
*
|
||||||
@ -12,7 +13,7 @@ import org.mapstruct.Mapper;
|
|||||||
* @see com.wu.framework.inner.lazy.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureConverter
|
* @see com.wu.framework.inner.lazy.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureConverter
|
||||||
**/
|
**/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface VisitorFlowConverter {
|
public interface VisitorPortFlowConverter {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -24,25 +25,25 @@ public interface VisitorFlowConverter {
|
|||||||
* @author Jia wei Wu
|
* @author Jia wei Wu
|
||||||
* @date 2024/01/24 05:19 下午
|
* @date 2024/01/24 05:19 下午
|
||||||
**/
|
**/
|
||||||
VisitorFlowConverter INSTANCE = Mappers.getMapper(VisitorFlowConverter.class);
|
VisitorPortFlowConverter INSTANCE = Mappers.getMapper(VisitorPortFlowConverter.class);
|
||||||
/**
|
/**
|
||||||
* describe 实体对象 转换成领域对象
|
* describe 实体对象 转换成领域对象
|
||||||
*
|
*
|
||||||
* @param visitorFlowDO 访客端流量实体对象
|
* @param visitorPortFlowDO 访客端流量实体对象
|
||||||
* @return {@link VisitorFlow} 访客端流量领域对象
|
* @return {@link VisitorPortFlow} 访客端流量领域对象
|
||||||
|
|
||||||
* @author Jia wei Wu
|
* @author Jia wei Wu
|
||||||
* @date 2024/01/24 05:19 下午
|
* @date 2024/01/24 05:19 下午
|
||||||
**/
|
**/
|
||||||
VisitorFlow toVisitorFlow(VisitorFlowDO visitorFlowDO);
|
VisitorPortFlow toVisitorFlow(VisitorPortFlowDO visitorPortFlowDO);
|
||||||
/**
|
/**
|
||||||
* describe 领域对象 转换成实体对象
|
* describe 领域对象 转换成实体对象
|
||||||
*
|
*
|
||||||
* @param visitorFlow 访客端流量领域对象
|
* @param visitorPortFlow 访客端流量领域对象
|
||||||
* @return {@link VisitorFlowDO} 访客端流量实体对象
|
* @return {@link VisitorPortFlowDO} 访客端流量实体对象
|
||||||
|
|
||||||
* @author Jia wei Wu
|
* @author Jia wei Wu
|
||||||
* @date 2024/01/24 05:19 下午
|
* @date 2024/01/24 05:19 下午
|
||||||
**/
|
**/
|
||||||
VisitorFlowDO fromVisitorFlow(VisitorFlow visitorFlow);
|
VisitorPortFlowDO fromVisitorFlow(VisitorPortFlow visitorPortFlow);
|
||||||
}
|
}
|
@ -2,14 +2,11 @@ package wu.framework.lazy.cloud.heartbeat.server.infrastructure.entity;
|
|||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import com.wu.framework.inner.lazy.stereotype.LazyTableIndex;
|
|
||||||
import com.wu.framework.inner.layer.stereotype.LayerField;
|
|
||||||
import com.wu.framework.inner.layer.stereotype.LayerField.LayerFieldType;
|
|
||||||
import com.wu.framework.inner.lazy.stereotype.LazyTable;
|
import com.wu.framework.inner.lazy.stereotype.LazyTable;
|
||||||
import com.wu.framework.inner.lazy.stereotype.LazyTableField;
|
import com.wu.framework.inner.lazy.stereotype.LazyTableField;
|
||||||
import com.wu.framework.inner.lazy.stereotype.*;
|
import com.wu.framework.inner.lazy.stereotype.*;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.lang.Long;
|
import java.lang.Long;
|
||||||
@ -24,9 +21,9 @@ import java.lang.Boolean;
|
|||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@LazyTable(tableName = "visitor_flow",schema = "wu_lazy_cloud_netty_server",comment = "访客端流量")
|
@LazyTable(tableName = "visitor_port_flow",comment = "访客端流量")
|
||||||
@Schema(title = "visitor_flow",description = "访客端流量")
|
@Schema(title = "visitor_port_flow",description = "访客端流量")
|
||||||
public class VisitorFlowDO {
|
public class VisitorPortFlowDO {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
@ -8,7 +8,7 @@ package wu.framework.lazy.cloud.heartbeat.server.infrastructure.mapper;
|
|||||||
* @see com.wu.framework.inner.lazy.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureMapper
|
* @see com.wu.framework.inner.lazy.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureMapper
|
||||||
**/
|
**/
|
||||||
|
|
||||||
public interface VisitorFlowMapper {
|
public interface VisitorPortFlowMapper {
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,152 +0,0 @@
|
|||||||
package wu.framework.lazy.cloud.heartbeat.server.infrastructure.persistence;
|
|
||||||
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.infrastructure.entity.VisitorFlowDO;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.infrastructure.converter.VisitorFlowConverter;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.infrastructure.mapper.VisitorFlowMapper;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorFlowRepository;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import com.wu.framework.inner.lazy.database.expand.database.persistence.stream.wrapper.LazyWrappers;
|
|
||||||
import com.wu.framework.response.Result;
|
|
||||||
import com.wu.framework.response.ResultFactory;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorFlow;
|
|
||||||
import com.wu.framework.inner.lazy.database.expand.database.persistence.stream.lambda.LazyLambdaStream;
|
|
||||||
import java.util.List;
|
|
||||||
import com.wu.framework.inner.lazy.database.expand.database.persistence.domain.LazyPage;
|
|
||||||
/**
|
|
||||||
* describe 访客端流量
|
|
||||||
*
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
* @see com.wu.framework.inner.lazy.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructurePersistence
|
|
||||||
**/
|
|
||||||
@Repository
|
|
||||||
public class VisitorFlowRepositoryImpl implements VisitorFlowRepository {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
LazyLambdaStream lazyLambdaStream;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 新增访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlow 新增访客端流量
|
|
||||||
* @return {@link Result<VisitorFlow>} 访客端流量新增后领域对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result<VisitorFlow> story(VisitorFlow visitorFlow) {
|
|
||||||
VisitorFlowDO visitorFlowDO = VisitorFlowConverter.INSTANCE.fromVisitorFlow(visitorFlow);
|
|
||||||
lazyLambdaStream.upsertRemoveNull(visitorFlowDO);
|
|
||||||
return ResultFactory.successOf();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 批量新增访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlowList 批量新增访客端流量
|
|
||||||
* @return {@link Result<List<VisitorFlow>>} 访客端流量新增后领域对象集合
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result<List<VisitorFlow>> batchStory(List<VisitorFlow> visitorFlowList) {
|
|
||||||
List<VisitorFlowDO> visitorFlowDOList = visitorFlowList.stream().map(VisitorFlowConverter.INSTANCE::fromVisitorFlow).collect(Collectors.toList());
|
|
||||||
lazyLambdaStream.upsert(visitorFlowDOList);
|
|
||||||
return ResultFactory.successOf();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 查询单个访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlow 查询单个访客端流量
|
|
||||||
* @return {@link Result<VisitorFlow>} 访客端流量领域对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result<VisitorFlow> findOne(VisitorFlow visitorFlow) {
|
|
||||||
VisitorFlowDO visitorFlowDO = VisitorFlowConverter.INSTANCE.fromVisitorFlow(visitorFlow);
|
|
||||||
VisitorFlow visitorFlowOne = lazyLambdaStream.selectOne(LazyWrappers.lambdaWrapperBean(visitorFlowDO), VisitorFlow.class);
|
|
||||||
return ResultFactory.successOf(visitorFlowOne);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 查询多个访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlow 查询多个访客端流量
|
|
||||||
* @return {@link Result<List<VisitorFlow>>} 访客端流量领域对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result<List<VisitorFlow>> findList(VisitorFlow visitorFlow) {
|
|
||||||
VisitorFlowDO visitorFlowDO = VisitorFlowConverter.INSTANCE.fromVisitorFlow(visitorFlow);
|
|
||||||
List<VisitorFlow> visitorFlowList = lazyLambdaStream.selectList(LazyWrappers.lambdaWrapperBean(visitorFlowDO), VisitorFlow.class);
|
|
||||||
return ResultFactory.successOf(visitorFlowList);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 分页查询多个访客端流量
|
|
||||||
*
|
|
||||||
* @param size 当前页数
|
|
||||||
* @param current 当前页
|
|
||||||
* @param visitorFlow 分页查询多个访客端流量
|
|
||||||
* @return {@link Result<LazyPage<VisitorFlow>>} 分页访客端流量领域对象
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result<LazyPage<VisitorFlow>> findPage(int size,int current,VisitorFlow visitorFlow) {
|
|
||||||
VisitorFlowDO visitorFlowDO = VisitorFlowConverter.INSTANCE.fromVisitorFlow(visitorFlow);
|
|
||||||
LazyPage<VisitorFlow> lazyPage = new LazyPage<>(current,size);
|
|
||||||
LazyPage<VisitorFlow> visitorFlowLazyPage = lazyLambdaStream.selectPage(LazyWrappers.lambdaWrapperBean(visitorFlowDO),lazyPage, VisitorFlow.class);
|
|
||||||
return ResultFactory.successOf(visitorFlowLazyPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 删除访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlow 删除访客端流量
|
|
||||||
* @return {@link Result<VisitorFlow>} 访客端流量
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result<VisitorFlow> remove(VisitorFlow visitorFlow) {
|
|
||||||
VisitorFlowDO visitorFlowDO = VisitorFlowConverter.INSTANCE.fromVisitorFlow(visitorFlow);
|
|
||||||
// lazyLambdaStream.delete(LazyWrappers.lambdaWrapperBean(visitorFlowDO));
|
|
||||||
return ResultFactory.successOf();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* describe 是否存在访客端流量
|
|
||||||
*
|
|
||||||
* @param visitorFlow 访客端流量领域对象
|
|
||||||
* @return {@link Result<Boolean>} 是否存在 true 存在,false 不存在
|
|
||||||
|
|
||||||
* @author Jia wei Wu
|
|
||||||
* @date 2024/01/24 05:19 下午
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result<Boolean> exists(VisitorFlow visitorFlow) {
|
|
||||||
VisitorFlowDO visitorFlowDO = VisitorFlowConverter.INSTANCE.fromVisitorFlow(visitorFlow);
|
|
||||||
Boolean exists=lazyLambdaStream.exists(LazyWrappers.lambdaWrapperBean(visitorFlowDO));
|
|
||||||
return ResultFactory.successOf(exists);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -0,0 +1,182 @@
|
|||||||
|
package wu.framework.lazy.cloud.heartbeat.server.infrastructure.persistence;
|
||||||
|
|
||||||
|
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorPortFlow;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.infrastructure.converter.VisitorPortFlowConverter;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorPortFlowRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import com.wu.framework.inner.lazy.database.expand.database.persistence.stream.wrapper.LazyWrappers;
|
||||||
|
import com.wu.framework.response.Result;
|
||||||
|
import com.wu.framework.response.ResultFactory;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import com.wu.framework.inner.lazy.database.expand.database.persistence.stream.lambda.LazyLambdaStream;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.wu.framework.inner.lazy.database.expand.database.persistence.domain.LazyPage;
|
||||||
|
import wu.framework.lazy.cloud.heartbeat.server.infrastructure.entity.VisitorPortFlowDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 访客端流量
|
||||||
|
*
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
* @see com.wu.framework.inner.lazy.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructurePersistence
|
||||||
|
**/
|
||||||
|
@Repository
|
||||||
|
public class VisitorPortFlowRepositoryImpl implements VisitorPortFlowRepository {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
LazyLambdaStream lazyLambdaStream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 新增访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlow 新增访客端流量
|
||||||
|
* @return {@link Result< VisitorPortFlow >} 访客端流量新增后领域对象
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<VisitorPortFlow> story(VisitorPortFlow visitorPortFlow) {
|
||||||
|
VisitorPortFlowDO visitorPortFlowDO = VisitorPortFlowConverter.INSTANCE.fromVisitorFlow(visitorPortFlow);
|
||||||
|
lazyLambdaStream.upsertRemoveNull(visitorPortFlowDO);
|
||||||
|
return ResultFactory.successOf();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 批量新增访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlowList 批量新增访客端流量
|
||||||
|
* @return {@link Result<List< VisitorPortFlow >>} 访客端流量新增后领域对象集合
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<List<VisitorPortFlow>> batchStory(List<VisitorPortFlow> visitorPortFlowList) {
|
||||||
|
List<VisitorPortFlowDO> visitorPortFlowDOList = visitorPortFlowList.stream().map(VisitorPortFlowConverter.INSTANCE::fromVisitorFlow).collect(Collectors.toList());
|
||||||
|
lazyLambdaStream.upsert(visitorPortFlowDOList);
|
||||||
|
return ResultFactory.successOf();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 查询单个访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlow 查询单个访客端流量
|
||||||
|
* @return {@link Result< VisitorPortFlow >} 访客端流量领域对象
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<VisitorPortFlow> findOne(VisitorPortFlow visitorPortFlow) {
|
||||||
|
VisitorPortFlowDO visitorPortFlowDO = VisitorPortFlowConverter.INSTANCE.fromVisitorFlow(visitorPortFlow);
|
||||||
|
VisitorPortFlow visitorPortFlowOne = lazyLambdaStream.selectOne(LazyWrappers.lambdaWrapperBean(visitorPortFlowDO), VisitorPortFlow.class);
|
||||||
|
return ResultFactory.successOf(visitorPortFlowOne);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 查询多个访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlow 查询多个访客端流量
|
||||||
|
* @return {@link Result<List< VisitorPortFlow >>} 访客端流量领域对象
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<List<VisitorPortFlow>> findList(VisitorPortFlow visitorPortFlow) {
|
||||||
|
VisitorPortFlowDO visitorPortFlowDO = VisitorPortFlowConverter.INSTANCE.fromVisitorFlow(visitorPortFlow);
|
||||||
|
List<VisitorPortFlow> visitorPortFlowList = lazyLambdaStream.selectList(LazyWrappers.lambdaWrapperBean(visitorPortFlowDO), VisitorPortFlow.class);
|
||||||
|
return ResultFactory.successOf(visitorPortFlowList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 分页查询多个访客端流量
|
||||||
|
*
|
||||||
|
* @param size 当前页数
|
||||||
|
* @param current 当前页
|
||||||
|
* @param visitorPortFlow 分页查询多个访客端流量
|
||||||
|
* @return {@link Result<LazyPage< VisitorPortFlow >>} 分页访客端流量领域对象
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<LazyPage<VisitorPortFlow>> findPage(int size, int current, VisitorPortFlow visitorPortFlow) {
|
||||||
|
VisitorPortFlowDO visitorPortFlowDO = VisitorPortFlowConverter.INSTANCE.fromVisitorFlow(visitorPortFlow);
|
||||||
|
LazyPage<VisitorPortFlow> lazyPage = new LazyPage<>(current, size);
|
||||||
|
LazyPage<VisitorPortFlow> visitorFlowLazyPage = lazyLambdaStream.selectPage(LazyWrappers.lambdaWrapperBean(visitorPortFlowDO), lazyPage, VisitorPortFlow.class);
|
||||||
|
return ResultFactory.successOf(visitorFlowLazyPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 删除访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlow 删除访客端流量
|
||||||
|
* @return {@link Result< VisitorPortFlow >} 访客端流量
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<VisitorPortFlow> remove(VisitorPortFlow visitorPortFlow) {
|
||||||
|
VisitorPortFlowDO visitorPortFlowDO = VisitorPortFlowConverter.INSTANCE.fromVisitorFlow(visitorPortFlow);
|
||||||
|
lazyLambdaStream.delete(LazyWrappers.lambdaWrapperBean(visitorPortFlowDO));
|
||||||
|
return ResultFactory.successOf();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* describe 是否存在访客端流量
|
||||||
|
*
|
||||||
|
* @param visitorPortFlow 访客端流量领域对象
|
||||||
|
* @return {@link Result<Boolean>} 是否存在 true 存在,false 不存在
|
||||||
|
* @author Jia wei Wu
|
||||||
|
* @date 2024/01/24 05:19 下午
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<Boolean> exists(VisitorPortFlow visitorPortFlow) {
|
||||||
|
VisitorPortFlowDO visitorPortFlowDO = VisitorPortFlowConverter.INSTANCE.fromVisitorFlow(visitorPortFlow);
|
||||||
|
Boolean exists = lazyLambdaStream.exists(LazyWrappers.lambdaWrapperBean(visitorPortFlowDO));
|
||||||
|
return ResultFactory.successOf(exists);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客户端查询流量
|
||||||
|
*
|
||||||
|
* @param size 分页大小
|
||||||
|
* @param current 分页
|
||||||
|
* @param visitorPortFlow 查询条件
|
||||||
|
* @return {@link Result<LazyPage< VisitorPortFlow >>} 分页访客端流量DTO对象
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result<LazyPage<VisitorPortFlow>> findPageGroupByClientId(int size, int current, VisitorPortFlow visitorPortFlow) {
|
||||||
|
VisitorPortFlowDO visitorPortFlowDO = VisitorPortFlowConverter.INSTANCE.fromVisitorFlow(visitorPortFlow);
|
||||||
|
LazyPage<VisitorPortFlow> lazyPage = new LazyPage<>(current, size);
|
||||||
|
LazyPage<VisitorPortFlow> visitorFlowLazyPage = lazyLambdaStream
|
||||||
|
.selectPage(
|
||||||
|
LazyWrappers.lambdaWrapperBean(visitorPortFlowDO)
|
||||||
|
.groupBy(VisitorPortFlowDO::getClientId),
|
||||||
|
lazyPage,
|
||||||
|
VisitorPortFlow.class);
|
||||||
|
return ResultFactory.successOf(visitorFlowLazyPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客户端ID查询出 客户端所有的进出口流量
|
||||||
|
*
|
||||||
|
* @param clientIdList 客户端ID
|
||||||
|
* @return 客户端所有的进出口流量
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<VisitorPortFlow> findListByClientIds(List<String> clientIdList) {
|
||||||
|
return lazyLambdaStream.selectList(LazyWrappers.<VisitorPortFlowDO>lambdaWrapper()
|
||||||
|
.in(VisitorPortFlowDO::getClientId,clientIdList), VisitorPortFlow.class);
|
||||||
|
}
|
||||||
|
}
|
@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="wu.framework.lazy.cloud.heartbeat.server.infrastructure.mapper.VisitorFlowMapper">
|
<mapper namespace="wu.framework.lazy.cloud.heartbeat.server.infrastructure.mapper.VisitorPortFlowMapper">
|
||||||
<resultMap id="BaseResultMap" type="wu.framework.lazy.cloud.heartbeat.server.infrastructure.entity.VisitorFlowDO">
|
<resultMap id="BaseResultMap" type="wu.framework.lazy.cloud.heartbeat.server.infrastructure.entity.VisitorPortFlowDO">
|
||||||
<result column="client_id" property="clientId" />
|
<result column="client_id" property="clientId" />
|
||||||
<result column="create_time" property="createTime" />
|
<result column="create_time" property="createTime" />
|
||||||
<id column="id" property="id" />
|
<id column="id" property="id" />
|
@ -6,7 +6,7 @@ import org.springframework.context.annotation.Bean;
|
|||||||
import org.springframework.context.annotation.Role;
|
import org.springframework.context.annotation.Role;
|
||||||
import wu.framework.lazy.cloud.heartbeat.common.adapter.ChannelFlowAdapter;
|
import wu.framework.lazy.cloud.heartbeat.common.adapter.ChannelFlowAdapter;
|
||||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.flow.HandleChannelFlowAdvanced;
|
import wu.framework.lazy.cloud.heartbeat.common.advanced.flow.HandleChannelFlowAdvanced;
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorFlowRepository;
|
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorPortFlowRepository;
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.netty.flow.ServerHandlerInFlowHandler;
|
import wu.framework.lazy.cloud.heartbeat.server.netty.flow.ServerHandlerInFlowHandler;
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.netty.flow.ServerHandlerOutFlowHandler;
|
import wu.framework.lazy.cloud.heartbeat.server.netty.flow.ServerHandlerOutFlowHandler;
|
||||||
|
|
||||||
@ -25,8 +25,8 @@ public class ServerFlowConfiguration {
|
|||||||
*/
|
*/
|
||||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||||
@Bean
|
@Bean
|
||||||
public ServerHandlerInFlowHandler serverHandlerInFlowHandler(VisitorFlowRepository visitorFlowRepository) {
|
public ServerHandlerInFlowHandler serverHandlerInFlowHandler(VisitorPortFlowRepository visitorPortFlowRepository) {
|
||||||
return new ServerHandlerInFlowHandler(visitorFlowRepository);
|
return new ServerHandlerInFlowHandler(visitorPortFlowRepository);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -36,8 +36,8 @@ public class ServerFlowConfiguration {
|
|||||||
*/
|
*/
|
||||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||||
@Bean
|
@Bean
|
||||||
public ServerHandlerOutFlowHandler serverHandlerOutFlowHandler(VisitorFlowRepository visitorFlowRepository) {
|
public ServerHandlerOutFlowHandler serverHandlerOutFlowHandler(VisitorPortFlowRepository visitorPortFlowRepository) {
|
||||||
return new ServerHandlerOutFlowHandler(visitorFlowRepository);
|
return new ServerHandlerOutFlowHandler(visitorPortFlowRepository);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,17 +5,17 @@ import org.springframework.util.ObjectUtils;
|
|||||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.flow.AbstractHandleChannelFlowAdvanced;
|
import wu.framework.lazy.cloud.heartbeat.common.advanced.flow.AbstractHandleChannelFlowAdvanced;
|
||||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.flow.ChannelFlow;
|
import wu.framework.lazy.cloud.heartbeat.common.advanced.flow.ChannelFlow;
|
||||||
import wu.framework.lazy.cloud.heartbeat.common.enums.ChannelFlowEnum;
|
import wu.framework.lazy.cloud.heartbeat.common.enums.ChannelFlowEnum;
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorFlow;
|
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorPortFlow;
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorFlowRepository;
|
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorPortFlowRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 进口流量处理
|
* 进口流量处理
|
||||||
*/
|
*/
|
||||||
public class ServerHandlerInFlowHandler extends AbstractHandleChannelFlowAdvanced {
|
public class ServerHandlerInFlowHandler extends AbstractHandleChannelFlowAdvanced {
|
||||||
private final VisitorFlowRepository visitorFlowRepository;
|
private final VisitorPortFlowRepository visitorPortFlowRepository;
|
||||||
|
|
||||||
public ServerHandlerInFlowHandler(VisitorFlowRepository visitorFlowRepository) {
|
public ServerHandlerInFlowHandler(VisitorPortFlowRepository visitorPortFlowRepository) {
|
||||||
this.visitorFlowRepository = visitorFlowRepository;
|
this.visitorPortFlowRepository = visitorPortFlowRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -42,25 +42,25 @@ public class ServerHandlerInFlowHandler extends AbstractHandleChannelFlowAdvance
|
|||||||
Integer flow = channelFlow.flow();
|
Integer flow = channelFlow.flow();
|
||||||
|
|
||||||
// 进口流量处理
|
// 进口流量处理
|
||||||
VisitorFlow visitorFlow = new VisitorFlow();
|
VisitorPortFlow visitorPortFlow = new VisitorPortFlow();
|
||||||
visitorFlow.setInFlow(flow);
|
visitorPortFlow.setInFlow(flow);
|
||||||
visitorFlow.setClientId(clientId);
|
visitorPortFlow.setClientId(clientId);
|
||||||
visitorFlow.setVisitorPort(port);
|
visitorPortFlow.setVisitorPort(port);
|
||||||
visitorFlow.setIsDeleted(false);
|
visitorPortFlow.setIsDeleted(false);
|
||||||
// 查询是否存在已有流量 而后进行统计汇总
|
// 查询是否存在已有流量 而后进行统计汇总
|
||||||
VisitorFlow findOneVisitorFlowQuery = new VisitorFlow();
|
VisitorPortFlow findOneVisitorPortFlowQuery = new VisitorPortFlow();
|
||||||
findOneVisitorFlowQuery.setClientId(clientId);
|
findOneVisitorPortFlowQuery.setClientId(clientId);
|
||||||
findOneVisitorFlowQuery.setVisitorPort(port);
|
findOneVisitorPortFlowQuery.setVisitorPort(port);
|
||||||
visitorFlowRepository.findOne(findOneVisitorFlowQuery).accept(existVisitorFlow -> {
|
visitorPortFlowRepository.findOne(findOneVisitorPortFlowQuery).accept(existVisitorFlow -> {
|
||||||
Integer inFlow = existVisitorFlow.getInFlow();
|
Integer inFlow = existVisitorFlow.getInFlow();
|
||||||
Integer outFlow = existVisitorFlow.getOutFlow();
|
Integer outFlow = existVisitorFlow.getOutFlow();
|
||||||
if(!ObjectUtils.isEmpty(inFlow)){
|
if(!ObjectUtils.isEmpty(inFlow)){
|
||||||
visitorFlow.setInFlow(visitorFlow.getInFlow()+inFlow);
|
visitorPortFlow.setInFlow(visitorPortFlow.getInFlow()+inFlow);
|
||||||
}
|
}
|
||||||
if (!ObjectUtils.isEmpty(outFlow)) {
|
if (!ObjectUtils.isEmpty(outFlow)) {
|
||||||
visitorFlow.setOutFlow( outFlow);
|
visitorPortFlow.setOutFlow( outFlow);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
visitorFlowRepository.story(visitorFlow);
|
visitorPortFlowRepository.story(visitorPortFlow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,17 +5,17 @@ import org.springframework.util.ObjectUtils;
|
|||||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.flow.AbstractHandleChannelFlowAdvanced;
|
import wu.framework.lazy.cloud.heartbeat.common.advanced.flow.AbstractHandleChannelFlowAdvanced;
|
||||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.flow.ChannelFlow;
|
import wu.framework.lazy.cloud.heartbeat.common.advanced.flow.ChannelFlow;
|
||||||
import wu.framework.lazy.cloud.heartbeat.common.enums.ChannelFlowEnum;
|
import wu.framework.lazy.cloud.heartbeat.common.enums.ChannelFlowEnum;
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorFlow;
|
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorPortFlow;
|
||||||
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorFlowRepository;
|
import wu.framework.lazy.cloud.heartbeat.server.domain.model.visitor.flow.VisitorPortFlowRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 出口流量处理
|
* 出口流量处理
|
||||||
*/
|
*/
|
||||||
public class ServerHandlerOutFlowHandler extends AbstractHandleChannelFlowAdvanced {
|
public class ServerHandlerOutFlowHandler extends AbstractHandleChannelFlowAdvanced {
|
||||||
private final VisitorFlowRepository visitorFlowRepository;
|
private final VisitorPortFlowRepository visitorPortFlowRepository;
|
||||||
|
|
||||||
public ServerHandlerOutFlowHandler(VisitorFlowRepository visitorFlowRepository) {
|
public ServerHandlerOutFlowHandler(VisitorPortFlowRepository visitorPortFlowRepository) {
|
||||||
this.visitorFlowRepository = visitorFlowRepository;
|
this.visitorPortFlowRepository = visitorPortFlowRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -42,25 +42,25 @@ public class ServerHandlerOutFlowHandler extends AbstractHandleChannelFlowAdvanc
|
|||||||
Integer flow = channelFlow.flow();
|
Integer flow = channelFlow.flow();
|
||||||
|
|
||||||
// 进口流量处理
|
// 进口流量处理
|
||||||
VisitorFlow visitorFlow = new VisitorFlow();
|
VisitorPortFlow visitorPortFlow = new VisitorPortFlow();
|
||||||
visitorFlow.setOutFlow(flow);
|
visitorPortFlow.setOutFlow(flow);
|
||||||
visitorFlow.setClientId(clientId);
|
visitorPortFlow.setClientId(clientId);
|
||||||
visitorFlow.setVisitorPort(port);
|
visitorPortFlow.setVisitorPort(port);
|
||||||
visitorFlow.setIsDeleted(false);
|
visitorPortFlow.setIsDeleted(false);
|
||||||
// 查询是否存在已有流量 而后进行统计汇总
|
// 查询是否存在已有流量 而后进行统计汇总
|
||||||
VisitorFlow findOneVisitorFlowQuery = new VisitorFlow();
|
VisitorPortFlow findOneVisitorPortFlowQuery = new VisitorPortFlow();
|
||||||
findOneVisitorFlowQuery.setClientId(clientId);
|
findOneVisitorPortFlowQuery.setClientId(clientId);
|
||||||
findOneVisitorFlowQuery.setVisitorPort(port);
|
findOneVisitorPortFlowQuery.setVisitorPort(port);
|
||||||
visitorFlowRepository.findOne(findOneVisitorFlowQuery).accept(existVisitorFlow -> {
|
visitorPortFlowRepository.findOne(findOneVisitorPortFlowQuery).accept(existVisitorFlow -> {
|
||||||
Integer outFlow = existVisitorFlow.getOutFlow();
|
Integer outFlow = existVisitorFlow.getOutFlow();
|
||||||
Integer inFlow = existVisitorFlow.getInFlow();
|
Integer inFlow = existVisitorFlow.getInFlow();
|
||||||
if (!ObjectUtils.isEmpty(outFlow)) {
|
if (!ObjectUtils.isEmpty(outFlow)) {
|
||||||
visitorFlow.setOutFlow(visitorFlow.getOutFlow() + outFlow);
|
visitorPortFlow.setOutFlow(visitorPortFlow.getOutFlow() + outFlow);
|
||||||
}
|
}
|
||||||
if (!ObjectUtils.isEmpty(inFlow)) {
|
if (!ObjectUtils.isEmpty(inFlow)) {
|
||||||
visitorFlow.setInFlow( inFlow);
|
visitorPortFlow.setInFlow( inFlow);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
visitorFlowRepository.story(visitorFlow);
|
visitorPortFlowRepository.story(visitorPortFlow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,10 @@ module.exports = {
|
|||||||
type: "put",
|
type: "put",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
visitorClientFlowPage: {
|
||||||
|
url: "/visitor/port/flow/findClientFlowPage",
|
||||||
|
type: "get",
|
||||||
|
},
|
||||||
networkMappingPage: {
|
networkMappingPage: {
|
||||||
url: "/internal/network/penetration/mapping/findPage",
|
url: "/internal/network/penetration/mapping/findPage",
|
||||||
type: "get",
|
type: "get",
|
||||||
|
@ -37,21 +37,10 @@
|
|||||||
total: total,
|
total: total,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template #tool_bar>
|
|
||||||
<el-button
|
|
||||||
title="弹窗式"
|
|
||||||
v-permission="['add']"
|
|
||||||
size="small"
|
|
||||||
type="primary"
|
|
||||||
@click="handleEdit(buttons.add.name)"
|
|
||||||
>
|
|
||||||
{{ buttons.add.name }}
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
<el-table-column prop="clientId" label="客户端ID"></el-table-column>
|
<el-table-column prop="clientId" label="客户端ID"></el-table-column>
|
||||||
<el-table-column prop="onLineState" label="客户端在线状态">
|
<el-table-column prop="outFlow" label="客户端出口流量">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="stagingState" label="暂存状态">
|
<el-table-column prop="inFlow" label="客户端进口流量">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column fixed="right" label="操作">
|
<el-table-column fixed="right" label="操作">
|
||||||
<template v-slot:default="{ row }">
|
<template v-slot:default="{ row }">
|
||||||
@ -63,24 +52,9 @@
|
|||||||
>
|
>
|
||||||
{{ buttons.offLine.name }}
|
{{ buttons.offLine.name }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
|
||||||
v-permission="['sendMessage']"
|
|
||||||
@click.prevent="handleArouse2SendMessage(row)"
|
|
||||||
type="primary"
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
{{ buttons.sendMessage.name }}
|
|
||||||
</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</ve-table>
|
</ve-table>
|
||||||
<!--发送消息到客户端-->
|
|
||||||
<cloud-server-send-message2-clinet
|
|
||||||
v-if="showDialog"
|
|
||||||
:rowData="rowData"
|
|
||||||
:showDialog="showDialog"
|
|
||||||
@closeDialog="handelDialog($event)"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@ -107,7 +81,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, toRefs, ref, onMounted, getCurrentInstance } from "vue";
|
import { reactive, toRefs, ref, onMounted } from "vue";
|
||||||
//?导入公共查询方法
|
//?导入公共查询方法
|
||||||
import {
|
import {
|
||||||
onSubmit,
|
onSubmit,
|
||||||
@ -115,13 +89,13 @@ import {
|
|||||||
handleSizeChange,
|
handleSizeChange,
|
||||||
handleCurrentChange,
|
handleCurrentChange,
|
||||||
} from "@/views/layoutpages/common";
|
} from "@/views/layoutpages/common";
|
||||||
import CloudServerSendMessage2Clinet from "@/views/layoutpages/cloud_network/components/CloudServerSendMessage2Clinet.vue";
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
|
||||||
const queryForm = ref(null);
|
const queryForm = ref(null);
|
||||||
const tableData = ref([]);
|
const tableData = ref([]);
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
const rowData = ref(null);
|
const rowData = ref(null);
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
const showDialog = ref(false);
|
const showDialog = ref(false);
|
||||||
|
|
||||||
const params = reactive({
|
const params = reactive({
|
||||||
@ -132,52 +106,6 @@ const params = reactive({
|
|||||||
});
|
});
|
||||||
const { clientId, size, current, total } = toRefs(params);
|
const { clientId, size, current, total } = toRefs(params);
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: dialog事件
|
|
||||||
* @param {*}
|
|
||||||
* @return {*}
|
|
||||||
*/
|
|
||||||
const handelDialog = (e) => {
|
|
||||||
showDialog.value = e;
|
|
||||||
getDataList();
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* @description:添加or编辑事件
|
|
||||||
* @param {*}
|
|
||||||
* @return {*}
|
|
||||||
*/
|
|
||||||
const handleArouse2SendMessage = (row = null) => {
|
|
||||||
showDialog.value = true;
|
|
||||||
rowData.value = row;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**删除行数据
|
|
||||||
* @description:
|
|
||||||
* @param {*}
|
|
||||||
* @return {*}
|
|
||||||
*/
|
|
||||||
const handleOffLine = (clientId) => {
|
|
||||||
proxy
|
|
||||||
.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "error",
|
|
||||||
})
|
|
||||||
.then(async () => {
|
|
||||||
const { code } = await VE_API.cloudNetwork.cloudClientDelete({
|
|
||||||
clientId,
|
|
||||||
});
|
|
||||||
if (code == "00") {
|
|
||||||
getDataList();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
proxy.$message({
|
|
||||||
type: "info",
|
|
||||||
message: "已取消删除",
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/**
|
/**
|
||||||
* @description: 获取列表数据
|
* @description: 获取列表数据
|
||||||
* @param {*}
|
* @param {*}
|
||||||
@ -185,7 +113,7 @@ const handleOffLine = (clientId) => {
|
|||||||
*/
|
*/
|
||||||
const getDataList = async () => {
|
const getDataList = async () => {
|
||||||
const { code, data } =
|
const { code, data } =
|
||||||
await VE_API.cloudNetwork.cloudClientFindPage(params);
|
await VE_API.cloudNetwork.visitorClientFlowPage(params);
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
const { size, current, total, record } = data;
|
const { size, current, total, record } = data;
|
||||||
params.size = size;
|
params.size = size;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user