提交 50e8d298 编写于 作者: A atsuc

ddd frame

上级 d028c9bf
......@@ -4,12 +4,12 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>xfg-frame-ddd</artifactId>
<groupId>cn.bugstack</groupId>
<artifactId>atsuc-frame-ddd</artifactId>
<groupId>cn.atsuc</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>xfg-frame-api</artifactId>
<artifactId>atsuc-frame-api</artifactId>
<dependencies>
<dependency>
......@@ -23,14 +23,14 @@
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>cn.bugstack</groupId>
<artifactId>xfg-frame-types</artifactId>
<groupId>cn.atsuc</groupId>
<artifactId>atsuc-frame-types</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<finalName>xfg-frame-api</finalName>
<finalName>atsuc-frame-api</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
......
package cn.atsuc.frame.api;
import cn.atsuc.frame.api.model.request.DecisionMatterRequest;
import cn.atsuc.frame.api.model.response.DecisionMatterResponse;
import cn.atsuc.frame.types.Response;
/**
* @description 规则服务
*/
public interface IRuleService {
Response<DecisionMatterResponse> doRule(DecisionMatterRequest request);
}
package cn.bugstack.xfg.frame.api.model.request;
package cn.atsuc.frame.api.model.request;
import lombok.AllArgsConstructor;
import lombok.Data;
......@@ -7,10 +7,7 @@ import lombok.NoArgsConstructor;
import java.util.Map;
/**
* @author 小傅哥,微信:fustack
* @description 决策请求对象
* @github https://github.com/fuzhengwei
* @Copyright 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Data
@AllArgsConstructor
......
package cn.bugstack.xfg.frame.api.model.response;
package cn.atsuc.frame.api.model.response;
import lombok.AllArgsConstructor;
import lombok.Builder;
......@@ -6,10 +6,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author 小傅哥,微信:fustack
* @description 决策结果
* @github https://github.com/fuzhengwei
* @Copyright 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Data
@AllArgsConstructor
......
/**
* RPC 接口网关定义
*/
package cn.bugstack.xfg.frame.api;
\ No newline at end of file
package cn.atsuc.frame.api;
\ No newline at end of file
# 基础镜像
FROM openjdk:8-jre-slim
# 作者
MAINTAINER xiaofuge
MAINTAINER atsuc
# 配置
ENV PARAMS=""
# 时区
ENV TZ=PRC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# 添加应用
ADD /target/xfg-frame-app.jar /xfg-frame-app.jar
ADD /target/atsuc-frame-app.jar /atsuc-frame-app.jar
## 在镜像运行为容器后执行的命令
ENTRYPOINT ["java", "-Xmx512m", "-javaagent:/Users/fuzhengwei1/Documents/develop/skywalking/skywalking-agent-8-9/skywalking-agent.jar", "-Dskywalking.agent.service_name=xfg-frame", "-Dskywalking.collector.backend_service=10.253.3.8:11800", "-jar", "/xfg-frame-app.jar"]
\ No newline at end of file
docker build -f ./Dockerfile -t demowhite/atsuc-frame-app:1.3 .
\ No newline at end of file
......@@ -3,13 +3,13 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>xfg-frame-ddd</artifactId>
<groupId>cn.bugstack</groupId>
<artifactId>atsuc-frame-ddd</artifactId>
<groupId>cn.atsuc</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>xfg-frame-app</artifactId>
<artifactId>atsuc-frame-app</artifactId>
<packaging>jar</packaging>
......@@ -94,20 +94,20 @@
</dependency>
<!-- 自身模块 begin -->
<dependency>
<groupId>cn.bugstack</groupId>
<artifactId>xfg-frame-trigger</artifactId>
<groupId>cn.atsuc</groupId>
<artifactId>atsuc-frame-trigger</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.bugstack</groupId>
<artifactId>xfg-frame-infrastructure</artifactId>
<groupId>cn.atsuc</groupId>
<artifactId>atsuc-frame-infrastructure</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- 自身模块 end -->
</dependencies>
<build>
<finalName>xfg-frame-app</finalName>
<finalName>atsuc-frame-app</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
......@@ -143,7 +143,7 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>cn.bugstack.xfg.frame.Application</mainClass>
<mainClass>cn.atsuc.frame.Application</mainClass>
<layout>JAR</layout>
</configuration>
</plugin>
......
CONTAINER_NAME=xfg-frame
IMAGE_NAME=fuzhengwei/xfg-frame-app:1.3
CONTAINER_NAME=demowhite-frame
IMAGE_NAME=demowhite/demowhite-frame-app:1.3
PORT=8090
echo "容器部署开始 ${CONTAINER_NAME}"
......
docker stop atsuc-frame-app
\ No newline at end of file
package cn.bugstack.xfg.frame;
package cn.atsuc.frame;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.beans.factory.annotation.Configurable;
......
package cn.bugstack.xfg.frame.aop;
package cn.atsuc.frame.aop;
import cn.bugstack.xfg.frame.types.Constants;
import cn.bugstack.xfg.frame.types.Response;
import cn.atsuc.frame.types.Constants;
import cn.atsuc.frame.types.Response;
import lombok.extern.slf4j.Slf4j;
import org.apache.curator.shaded.com.google.common.util.concurrent.RateLimiter;
import org.aspectj.lang.JoinPoint;
......@@ -29,7 +30,7 @@ public class RateLimiterAop {
this.limiter = RateLimiter.create(permitsPerSecond);
}
@Pointcut("execution(* cn.bugstack.xfg.frame.trigger..*.*(..))")
@Pointcut("execution(* cn.atsuc.xfg.frame.trigger..*.*(..))")
public void pointCut() {
}
......
/**
* 统一切面管理
*/
package cn.bugstack.xfg.frame.aop;
\ No newline at end of file
package cn.atsuc.frame.aop;
\ No newline at end of file
package cn.bugstack.xfg.frame.config;
package cn.atsuc.frame.config;
import cn.bugstack.xfg.frame.aop.RateLimiterAop;
import cn.atsuc.frame.aop.RateLimiterAop;
import lombok.extern.slf4j.Slf4j;
import org.apache.curator.shaded.com.google.common.util.concurrent.RateLimiter;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import java.util.concurrent.ThreadPoolExecutor;
@Slf4j
@EnableAsync
@Configuration
......
package cn.bugstack.xfg.frame.config;
package cn.atsuc.frame.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
......
package cn.bugstack.xfg.frame.config;
package cn.atsuc.frame.config;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
......
package cn.bugstack.xfg.frame.config;
package cn.atsuc.frame.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
......
......@@ -6,7 +6,7 @@ spring:
username: root
password: 123456
url: jdbc:mysql://127.0.0.1:3306/road-map?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&serverTimezone=UTC&useSSL=true
driver-class-name: com.mysql.jdbc.Driver
driver-class-name: com.mysql.cj.jdbc.Driver
mybatis:
mapper-locations: classpath:/mybatis/mapper/*.xml
......@@ -31,7 +31,7 @@ rate-limiter:
# Dubbo
dubbo:
application:
name: xfg-frame-dev
name: atsuc-frame-dev
version: 1.0.0
registry:
address: zookeeper://127.0.0.1:2181
......@@ -39,7 +39,7 @@ dubbo:
name: dubbo
port: 20883
scan:
base-packages: cn.bugstack.xfg.frame.api
base-packages: cn.atsuc.frame.api
# 日志
logging:
......
......@@ -3,7 +3,7 @@ server:
dubbo:
application:
name: xfg-frame
name: atsuc-frame
version: 1.0.0
registry:
address: zookeeper://127.0.0.1:9181
......@@ -11,7 +11,7 @@ dubbo:
name: dubbo
port: 20881
scan:
base-packages: cn.bugstack.xfg.frame.api
base-packages: cn.atsuc.frame.api
logging:
level:
......
......@@ -3,7 +3,7 @@ server:
dubbo:
application:
name: xfg-frame
name: atsuc-frame
version: 1.0.0
registry:
address: zookeeper://192.168.1.100:9181
......@@ -11,7 +11,7 @@ dubbo:
name: dubbo
port: 20881
scan:
base-packages: cn.bugstack.xfg.frame.api
base-packages: cn.atsuc.frame.api
logging:
level:
......
<?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">
<mapper namespace="cn.bugstack.xfg.frame.infrastructure.dao.RuleTreeNodeLineDao">
<mapper namespace="cn.atsuc.frame.infrastructure.dao.RuleTreeNodeLineDao">
<resultMap id="ruleTreeNodeLineResultMap" type="cn.bugstack.xfg.frame.infrastructure.po.RuleTreeNodeLinePO">
<resultMap id="ruleTreeNodeLineResultMap" type="cn.atsuc.frame.infrastructure.po.RuleTreeNodeLinePO">
<id column="id" property="id"/>
<result column="tree_id" property="treeId"/>
<result column="node_id_from" property="nodeIdFrom"/>
......
<?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">
<mapper namespace="cn.bugstack.xfg.frame.infrastructure.dao.RuleTreeNodeDao">
<mapper namespace="cn.atsuc.frame.infrastructure.dao.RuleTreeNodeDao">
<resultMap id="ruleTreeNodeMap" type="cn.bugstack.xfg.frame.infrastructure.po.RuleTreeNodePO">
<resultMap id="ruleTreeNodeMap" type="cn.atsuc.frame.infrastructure.po.RuleTreeNodePO">
<id column="id" property="id"/>
<result column="tree_id" property="treeId"/>
<result column="node_type" property="nodeType"/>
......
<?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">
<mapper namespace="cn.bugstack.xfg.frame.infrastructure.dao.RuleTreeDao">
<mapper namespace="cn.atsuc.frame.infrastructure.dao.RuleTreeDao">
<resultMap id="ruleTreeMap" type="cn.bugstack.xfg.frame.infrastructure.po.RuleTreePO">
<resultMap id="ruleTreeMap" type="cn.atsuc.frame.infrastructure.po.RuleTreePO">
<id column="id" property="id"/>
<result column="tree_name" property="treeName"/>
<result column="tree_desc" property="treeDesc"/>
......
package cn.bugstack.xfg.frame.test;
package cn.atsuc.frame.test;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.util.Base64;
/**
* @author Fuzhengwei bugstack.cn @小傅哥
* @description
* @create 2023-07-18 22:08
*/
public class AESTest {
/**
......
package cn.bugstack.xfg.frame.test;
package cn.atsuc.frame.test;
import cn.bugstack.xfg.frame.domain.rule.model.entity.DecisionMatterEntity;
import cn.bugstack.xfg.frame.domain.rule.model.entity.EngineResultEntity;
import cn.bugstack.xfg.frame.domain.rule.service.engine.EngineFilter;
import cn.atsuc.frame.domain.rule.model.entity.DecisionMatterEntity;
import cn.atsuc.frame.domain.rule.model.entity.EngineResultEntity;
import cn.atsuc.frame.domain.rule.service.engine.EngineFilter;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
......
package cn.bugstack.xfg.frame.test;
package cn.atsuc.frame.test;
import org.apache.dubbo.config.ApplicationConfig;
import org.apache.dubbo.config.ReferenceConfig;
......@@ -21,7 +21,7 @@ public class RpcTest {
public static void main(String[] args) {
ApplicationConfig application = new ApplicationConfig();
application.setName("xfg-frame");
application.setName("atsuc-frame");
application.setQosEnable(false);
RegistryConfig registry = new RegistryConfig();
......@@ -29,7 +29,7 @@ public class RpcTest {
registry.setRegister(false);
ReferenceConfig<GenericService> reference = new ReferenceConfig<>();
reference.setInterface("cn.bugstack.xfg.frame.api.IAccountService");
reference.setInterface("cn.atsuc.frame.api.IAccountService");
reference.setVersion("1.0.0");
reference.setGeneric("true");
......
......@@ -3,13 +3,13 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>xfg-frame-ddd</artifactId>
<groupId>cn.bugstack</groupId>
<artifactId>atsuc-frame-ddd</artifactId>
<groupId>cn.atsuc</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>xfg-frame-domain</artifactId>
<artifactId>atsuc-frame-domain</artifactId>
<dependencies>
<dependency>
......@@ -34,15 +34,15 @@
</dependency>
<!-- 自身模块 begin -->
<dependency>
<groupId>cn.bugstack</groupId>
<artifactId>xfg-frame-types</artifactId>
<groupId>cn.atsuc</groupId>
<artifactId>atsuc-frame-types</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- 自身模块 end -->
</dependencies>
<build>
<finalName>xfg-frame-domain</finalName>
<finalName>atsuc-frame-domain</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
......
package cn.atsuc.frame.domain.order.model.aggregates;
import cn.atsuc.frame.domain.order.model.entity.OrderItemEntity;
import cn.atsuc.frame.domain.order.model.valobj.OrderIdVO;
import java.util.List;
/**
* @description 订单聚合对象
*/
public class OrderAggregate {
private OrderIdVO orderId;
private List<OrderItemEntity> items;
}
package cn.atsuc.frame.domain.order.model.entity;
/**
* @description 订单条目实体
*/
public class OrderItemEntity {
}
package cn.bugstack.xfg.frame.domain.order.model.entity;
package cn.atsuc.frame.domain.order.model.entity;
import cn.bugstack.xfg.frame.domain.order.model.valobj.ProductDescriptionVO;
import cn.bugstack.xfg.frame.domain.order.model.valobj.ProductNameVO;
import cn.atsuc.frame.domain.order.model.valobj.ProductDescriptionVO;
import cn.atsuc.frame.domain.order.model.valobj.ProductNameVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author 小傅哥,微信:fustack
* @description 产品实体
* @github https://github.com/fuzhengwei
* @Copyright 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Data
@AllArgsConstructor
......
......@@ -10,4 +10,4 @@
* 在聚合中,逻辑应该是与聚合根相关的业务逻辑,而不是将所有的服务功能都放到聚合对象中。聚合对象应该包含与聚合根相关的操作和规则,例如聚合根的创建、修改和删除等操作,以及聚合根的不变量验证等规则。聚合对象还可以包含一些与聚合根相关的查询操作,但是这些查询操作应该是只读的,不应该对聚合根的状态进行修改。
* 至于服务功能,它们可以被实现为应用服务或领域服务,它们可以与聚合对象协同工作,但不应该被包含在聚合对象中。应用服务和领域服务可以调用聚合对象来完成业务逻辑,但是它们不应该直接修改聚合根的状态。
*/
package cn.bugstack.xfg.frame.domain.order.model;
\ No newline at end of file
package cn.atsuc.frame.domain.order.model;
\ No newline at end of file
package cn.bugstack.xfg.frame.domain.order.model.valobj;
package cn.atsuc.frame.domain.order.model.valobj;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author 小傅哥,微信:fustack
* @description
* @github https://github.com/fuzhengwei
* @Copyright 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Data
@AllArgsConstructor
......
package cn.bugstack.xfg.frame.domain.order.model.valobj;
package cn.atsuc.frame.domain.order.model.valobj;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author 小傅哥,微信:fustack
* @description 产品明细值信息
* @github https://github.com/fuzhengwei
* @Copyright 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Data
@AllArgsConstructor
......
package cn.bugstack.xfg.frame.domain.order.model.valobj;
package cn.atsuc.frame.domain.order.model.valobj;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author 小傅哥,微信:fustack
* @description 产品值信息
* @github https://github.com/fuzhengwei
* @Copyright 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Data
@AllArgsConstructor
......
package cn.atsuc.frame.domain.order.repository;
public interface IOrderRepository {
}
/**
* 仓储接口
*/
package cn.bugstack.xfg.frame.domain.rule.repository;
\ No newline at end of file
package cn.atsuc.frame.domain.order.repository;
\ No newline at end of file
package cn.atsuc.frame.domain.order.service;
import org.springframework.stereotype.Service;
@Service
public class OrderService {
}
/**
* 具体业务实现
*/
package cn.bugstack.xfg.frame.domain.rule.service;
\ No newline at end of file
package cn.atsuc.frame.domain.order.service;
\ No newline at end of file
package cn.bugstack.xfg.frame.domain.rule.model.aggregates;
package cn.atsuc.frame.domain.rule.model.aggregates;
import cn.bugstack.xfg.frame.domain.rule.model.valobj.TreeNodeVO;
import cn.bugstack.xfg.frame.domain.rule.model.valobj.TreeRootVO;
import cn.atsuc.frame.domain.rule.model.valobj.TreeNodeVO;
import cn.atsuc.frame.domain.rule.model.valobj.TreeRootVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
......@@ -10,10 +11,7 @@ import lombok.NoArgsConstructor;
import java.util.Map;
/**
* @description: 规则树聚合
* @author: 小傅哥,微信:fustack
* @github: https://github.com/fuzhengwei
* @Copyright: 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Data
@AllArgsConstructor
......
package cn.bugstack.xfg.frame.domain.rule.model.entity;
package cn.atsuc.frame.domain.rule.model.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
......@@ -8,10 +8,7 @@ import lombok.NoArgsConstructor;
import java.util.Map;
/**
* @author 小傅哥,微信:fustack
* @description 决策物料实体
* @github https://github.com/fuzhengwei
* @Copyright 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Data
@AllArgsConstructor
......
package cn.bugstack.xfg.frame.domain.rule.model.entity;
package cn.atsuc.frame.domain.rule.model.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
......@@ -7,10 +7,6 @@ import lombok.NoArgsConstructor;
/**
* @description: 决策结果实体
* @author: 小傅哥,微信:fustack
* @date: 2021/10/8
* @github: https://github.com/fuzhengwei
* @Copyright: 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Data
@AllArgsConstructor
......
/**
* 模型;vo、dto、entity、aggregate
*/
package cn.bugstack.xfg.frame.domain.rule.model;
\ No newline at end of file
package cn.atsuc.frame.domain.rule.model;
\ No newline at end of file
package cn.bugstack.xfg.frame.domain.rule.model.valobj;
package cn.atsuc.frame.domain.rule.model.valobj;
import lombok.AllArgsConstructor;
import lombok.Builder;
......@@ -7,9 +7,6 @@ import lombok.NoArgsConstructor;
/**
* @description: 规则树线信息
* @author: 小傅哥,微信:fustack
* @github: https://github.com/fuzhengwei
* @Copyright: 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Data
@AllArgsConstructor
......
package cn.bugstack.xfg.frame.domain.rule.model.valobj;
package cn.atsuc.frame.domain.rule.model.valobj;
import lombok.AllArgsConstructor;
import lombok.Builder;
......@@ -9,9 +9,6 @@ import java.util.List;
/**
* @description: 规则树节点信息
* @author: 小傅哥,微信:fustack
* @github: https://github.com/fuzhengwei
* @Copyright: 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Data
@AllArgsConstructor
......
package cn.bugstack.xfg.frame.domain.rule.model.valobj;
package cn.atsuc.frame.domain.rule.model.valobj;
import lombok.AllArgsConstructor;
import lombok.Builder;
......@@ -7,9 +7,6 @@ import lombok.NoArgsConstructor;
/**
* @description: 规则树根配置
* @author: 小傅哥,微信:fustack
* @github: https://github.com/fuzhengwei
* @Copyright: 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Data
@AllArgsConstructor
......
package cn.bugstack.xfg.frame.domain.rule.repository;
package cn.atsuc.frame.domain.rule.repository;
import cn.bugstack.xfg.frame.domain.rule.model.aggregates.TreeRuleAggregate;
import cn.atsuc.frame.domain.rule.model.aggregates.TreeRuleAggregate;
/**
* @description: 规则信息仓储服务接口
* @author: 小傅哥,微信:fustack
* @date: 2021/10/8
* @github: https://github.com/fuzhengwei
* @Copyright: 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
public interface IRuleRepository {
......
/**
* 仓储接口
*/
package cn.bugstack.xfg.frame.domain.order.repository;
\ No newline at end of file
package cn.atsuc.frame.domain.rule.repository;
\ No newline at end of file
package cn.bugstack.xfg.frame.domain.rule.service.engine;
import cn.bugstack.xfg.frame.domain.rule.model.aggregates.TreeRuleAggregate;
import cn.bugstack.xfg.frame.domain.rule.model.entity.DecisionMatterEntity;
import cn.bugstack.xfg.frame.domain.rule.model.entity.EngineResultEntity;
import cn.bugstack.xfg.frame.domain.rule.model.valobj.TreeNodeVO;
import cn.bugstack.xfg.frame.domain.rule.model.valobj.TreeRootVO;
import cn.bugstack.xfg.frame.domain.rule.service.logic.LogicFilter;
import cn.bugstack.xfg.frame.types.Constants;
package cn.atsuc.frame.domain.rule.service.engine;
import cn.atsuc.frame.domain.rule.model.aggregates.TreeRuleAggregate;
import cn.atsuc.frame.domain.rule.model.valobj.TreeNodeVO;
import cn.atsuc.frame.domain.rule.model.valobj.TreeRootVO;
import cn.atsuc.frame.types.Constants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -14,20 +11,17 @@ import java.util.Map;
/**
* @description: 规则引擎基础类
* @author: 小傅哥,微信:fustack
* @github: https://github.com/fuzhengwei
* @Copyright: 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
public abstract class EngineBase extends EngineConfig implements EngineFilter {
public abstract class EngineBase extends EngineConfig implements cn.atsuc.frame.domain.rule.service.engine.EngineFilter {
private Logger logger = LoggerFactory.getLogger(EngineBase.class);
@Override
public EngineResultEntity process(DecisionMatterEntity matter) {
public cn.atsuc.frame.domain.rule.model.entity.EngineResultEntity process(cn.atsuc.frame.domain.rule.model.entity.DecisionMatterEntity matter) {
throw new RuntimeException("未实现规则引擎服务");
}
protected TreeNodeVO engineDecisionMaker(TreeRuleAggregate treeRuleRich, DecisionMatterEntity matter) {
protected TreeNodeVO engineDecisionMaker(TreeRuleAggregate treeRuleRich, cn.atsuc.frame.domain.rule.model.entity.DecisionMatterEntity matter) {
TreeRootVO treeRoot = treeRuleRich.getTreeRoot();
Map<Long, TreeNodeVO> treeNodeMap = treeRuleRich.getTreeNodeMap();
......@@ -38,7 +32,7 @@ public abstract class EngineBase extends EngineConfig implements EngineFilter {
// 节点类型[NodeType];1子叶、2果实
while (Constants.NodeType.STEM.equals(treeNodeInfo.getNodeType())) {
String ruleKey = treeNodeInfo.getRuleKey();
LogicFilter logicFilter = logicFilterMap.get(ruleKey);
cn.atsuc.frame.domain.rule.service.logic.LogicFilter logicFilter = logicFilterMap.get(ruleKey);
String matterValue = logicFilter.matterValue(matter);
Long nextNode = logicFilter.filter(matterValue, treeNodeInfo.getTreeNodeLineInfoList());
treeNodeInfo = treeNodeMap.get(nextNode);
......
package cn.bugstack.xfg.frame.domain.rule.service.engine;
package cn.atsuc.frame.domain.rule.service.engine;
import cn.bugstack.xfg.frame.domain.rule.service.logic.LogicFilter;
import cn.bugstack.xfg.frame.domain.rule.service.logic.impl.UserAgeFilter;
import cn.bugstack.xfg.frame.domain.rule.service.logic.impl.UserGenderFilter;
import cn.atsuc.frame.domain.rule.service.logic.LogicFilter;
import cn.atsuc.frame.domain.rule.service.logic.impl.UserAgeFilter;
import cn.atsuc.frame.domain.rule.service.logic.impl.UserGenderFilter;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
......@@ -11,9 +11,6 @@ import java.util.concurrent.ConcurrentHashMap;
/**
* @description: 规则配置
* @author: 小傅哥,微信:fustack
* @github: https://github.com/fuzhengwei
* @Copyright: 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
public class EngineConfig {
......
package cn.bugstack.xfg.frame.domain.rule.service.engine;
package cn.atsuc.frame.domain.rule.service.engine;
import cn.bugstack.xfg.frame.domain.rule.model.entity.DecisionMatterEntity;
import cn.bugstack.xfg.frame.domain.rule.model.entity.EngineResultEntity;
import cn.atsuc.frame.domain.rule.model.entity.DecisionMatterEntity;
import cn.atsuc.frame.domain.rule.model.entity.EngineResultEntity;
/**
* @description: 规则过滤器引擎
* @author: 小傅哥,微信:fustack
* @github: https://github.com/fuzhengwei
* @Copyright: 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
public interface EngineFilter {
......
package cn.bugstack.xfg.frame.domain.rule.service.engine.impl;
import cn.bugstack.xfg.frame.domain.rule.model.aggregates.TreeRuleAggregate;
import cn.bugstack.xfg.frame.domain.rule.model.entity.DecisionMatterEntity;
import cn.bugstack.xfg.frame.domain.rule.model.entity.EngineResultEntity;
import cn.bugstack.xfg.frame.domain.rule.model.valobj.TreeNodeVO;
import cn.bugstack.xfg.frame.domain.rule.repository.IRuleRepository;
import cn.bugstack.xfg.frame.domain.rule.service.engine.EngineBase;
package cn.atsuc.frame.domain.rule.service.engine.impl;
import cn.atsuc.frame.domain.rule.model.aggregates.TreeRuleAggregate;
import cn.atsuc.frame.domain.rule.model.valobj.TreeNodeVO;
import cn.atsuc.frame.domain.rule.repository.IRuleRepository;
import cn.atsuc.frame.domain.rule.service.engine.EngineBase;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @description: 规则引擎处理器
* @author: 小傅哥,微信:fustack
* @github: https://github.com/fuzhengwei
* @Copyright: 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Service("ruleEngineHandle")
public class RuleEngineHandle extends EngineBase {
......@@ -23,7 +18,7 @@ public class RuleEngineHandle extends EngineBase {
private IRuleRepository ruleRepository;
@Override
public EngineResultEntity process(DecisionMatterEntity matter) {
public cn.atsuc.frame.domain.rule.model.entity.EngineResultEntity process(cn.atsuc.frame.domain.rule.model.entity.DecisionMatterEntity matter) {
// 决策规则树
TreeRuleAggregate treeRuleRich = ruleRepository.queryTreeRuleRich(matter.getTreeId());
if (null == treeRuleRich) {
......@@ -34,7 +29,7 @@ public class RuleEngineHandle extends EngineBase {
TreeNodeVO treeNodeInfo = engineDecisionMaker(treeRuleRich, matter);
// 决策结果
return new EngineResultEntity(matter.getUserId(), treeNodeInfo.getTreeId(), treeNodeInfo.getTreeNodeId(), treeNodeInfo.getNodeValue());
return new cn.atsuc.frame.domain.rule.model.entity.EngineResultEntity(matter.getUserId(), treeNodeInfo.getTreeId(), treeNodeInfo.getTreeNodeId(), treeNodeInfo.getNodeValue());
}
}
package cn.bugstack.xfg.frame.domain.rule.service.logic;
package cn.atsuc.frame.domain.rule.service.logic;
import cn.bugstack.xfg.frame.domain.rule.model.entity.DecisionMatterEntity;
import cn.bugstack.xfg.frame.domain.rule.model.valobj.TreeNodeLineVO;
import cn.bugstack.xfg.frame.types.Constants;
import cn.atsuc.frame.domain.rule.model.valobj.TreeNodeLineVO;
import cn.atsuc.frame.types.Constants;
import java.util.List;
/**
* @description: 规则基础抽象类
* @author: 小傅哥,微信:fustack
* @github: https://github.com/fuzhengwei
* @Copyright: 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
public abstract class BaseLogic implements LogicFilter {
public abstract class BaseLogic implements cn.atsuc.frame.domain.rule.service.logic.LogicFilter {
@Override
public Long filter(String matterValue, List<TreeNodeLineVO> treeNodeLineInfoList) {
......@@ -30,7 +27,7 @@ public abstract class BaseLogic implements LogicFilter {
* @return 比对值
*/
@Override
public abstract String matterValue(DecisionMatterEntity decisionMatter);
public abstract String matterValue(cn.atsuc.frame.domain.rule.model.entity.DecisionMatterEntity decisionMatter);
private boolean decisionLogic(String matterValue, TreeNodeLineVO nodeLine) {
switch (nodeLine.getRuleLimitType()) {
......
package cn.bugstack.xfg.frame.domain.rule.service.logic;
package cn.atsuc.frame.domain.rule.service.logic;
import cn.bugstack.xfg.frame.domain.rule.model.entity.DecisionMatterEntity;
import cn.bugstack.xfg.frame.domain.rule.model.valobj.TreeNodeLineVO;
import cn.atsuc.frame.domain.rule.model.valobj.TreeNodeLineVO;
import java.util.List;
/**
* @description: 规则过滤器接口
* @author: 小傅哥,微信:fustack
* @github: https://github.com/fuzhengwei
* @Copyright: 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
public interface LogicFilter {
......@@ -27,6 +24,6 @@ public interface LogicFilter {
* @param decisionMatter 决策物料
* @return 决策值
*/
String matterValue(DecisionMatterEntity decisionMatter);
String matterValue(cn.atsuc.frame.domain.rule.model.entity.DecisionMatterEntity decisionMatter);
}
package cn.bugstack.xfg.frame.domain.rule.service.logic.impl;
package cn.atsuc.frame.domain.rule.service.logic.impl;
import cn.bugstack.xfg.frame.domain.rule.model.entity.DecisionMatterEntity;
import cn.bugstack.xfg.frame.domain.rule.service.logic.BaseLogic;
import cn.atsuc.frame.domain.rule.model.entity.DecisionMatterEntity;
import cn.atsuc.frame.domain.rule.service.logic.BaseLogic;
import org.springframework.stereotype.Component;
/**
* @description: 年龄规则
* @author: 小傅哥,微信:fustack
* @github: https://github.com/fuzhengwei
* @Copyright: 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Component
public class UserAgeFilter extends BaseLogic {
......
package cn.bugstack.xfg.frame.domain.rule.service.logic.impl;
package cn.atsuc.frame.domain.rule.service.logic.impl;
import cn.bugstack.xfg.frame.domain.rule.model.entity.DecisionMatterEntity;
import cn.bugstack.xfg.frame.domain.rule.service.logic.BaseLogic;
import cn.atsuc.frame.domain.rule.model.entity.DecisionMatterEntity;
import cn.atsuc.frame.domain.rule.service.logic.BaseLogic;
import org.springframework.stereotype.Component;
/**
* @description: 性别规则
* @author: 小傅哥,微信:fustack
* @github: https://github.com/fuzhengwei
* @Copyright: 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Component
public class UserGenderFilter extends BaseLogic {
......
/**
* 具体业务实现
*/
package cn.bugstack.xfg.frame.domain.order.service;
\ No newline at end of file
package cn.atsuc.frame.domain.rule.service;
\ No newline at end of file
package cn.bugstack.xfg.frame.domain.user.model.valobj;
package cn.atsuc.xfg.frame.domain.user.model.valobj;
import lombok.AllArgsConstructor;
import lombok.Builder;
......
package cn.atsuc.xfg.frame.domain.user.repository;
import cn.atsuc.xfg.frame.domain.user.model.valobj.UserVO;
import java.util.List;
/**
* @description 仓储接口
*/
public interface IUserRepository {
List<UserVO> queryUserList();
}
package cn.atsuc.xfg.frame.domain.user.service;
import cn.atsuc.xfg.frame.domain.user.model.valobj.UserVO;
import java.util.List;
public interface UserService {
List<UserVO> queryUserList();
}
package cn.bugstack.xfg.frame.domain.user.service.impl;
package cn.atsuc.xfg.frame.domain.user.service.impl;
import cn.bugstack.xfg.frame.domain.user.model.valobj.UserVO;
import cn.bugstack.xfg.frame.domain.user.repository.IUserRepository;
import cn.bugstack.xfg.frame.domain.user.service.UserService;
import org.springframework.stereotype.Repository;
import cn.atsuc.xfg.frame.domain.user.model.valobj.UserVO;
import cn.atsuc.xfg.frame.domain.user.repository.IUserRepository;
import cn.atsuc.xfg.frame.domain.user.service.UserService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* @author 小傅哥,微信:fustack
* @description
* @github https://github.com/fuzhengwei
* @Copyright 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Service
public class UserServiceImpl implements UserService {
......
......@@ -3,14 +3,14 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>xfg-frame-ddd</artifactId>
<groupId>cn.bugstack</groupId>
<artifactId>atsuc-frame-ddd</artifactId>
<groupId>cn.atsuc</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>xfg-frame-infrastructure</artifactId>
<artifactId>atsuc-frame-infrastructure</artifactId>
<dependencies>
<dependency>
......@@ -23,20 +23,20 @@
</dependency>
<!-- 自身模块 begin -->
<dependency>
<groupId>cn.bugstack</groupId>
<artifactId>xfg-frame-domain</artifactId>
<groupId>cn.atsuc</groupId>
<artifactId>atsuc-frame-domain</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.bugstack</groupId>
<artifactId>xfg-frame-types</artifactId>
<groupId>cn.atsuc</groupId>
<artifactId>atsuc-frame-types</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- 自身模块 end -->
</dependencies>
<build>
<finalName>xfg-frame-infrastructure</finalName>
<finalName>atsuc-frame-infrastructure</finalName>
<plugins>
<!-- 编译plugin -->
<plugin>
......
package cn.bugstack.xfg.frame.infrastructure.dao;
package cn.atsuc.xfg.frame.infrastructure.dao;
import cn.bugstack.xfg.frame.infrastructure.po.UserPO;
import cn.atsuc.xfg.frame.infrastructure.po.UserPO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
......
package cn.bugstack.xfg.frame.infrastructure.dao;
import cn.bugstack.xfg.frame.infrastructure.po.RuleTreePO;
package cn.atsuc.xfg.frame.infrastructure.dao;
import cn.atsuc.xfg.frame.infrastructure.po.RuleTreePO;
import org.apache.ibatis.annotations.Mapper;
/**
* @description: 规则树配置DAO
* @author: 小傅哥,微信:fustack
* @date: 2021/9/22
* @github: https://github.com/fuzhengwei
* @Copyright: 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Mapper
public interface RuleTreeDao {
......
package cn.bugstack.xfg.frame.infrastructure.dao;
import cn.bugstack.xfg.frame.infrastructure.po.RuleTreeNodePO;
package cn.atsuc.xfg.frame.infrastructure.dao;
import cn.atsuc.xfg.frame.infrastructure.po.RuleTreeNodePO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @description: 规则树节点DAO
* @author: 小傅哥,微信:fustack
* @date: 2021/9/22
* @github: https://github.com/fuzhengwei
* @Copyright: 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Mapper
public interface RuleTreeNodeDao {
......
package cn.bugstack.xfg.frame.infrastructure.dao;
package cn.atsuc.xfg.frame.infrastructure.dao;
import cn.bugstack.xfg.frame.infrastructure.po.RuleTreeNodeLinePO;
import cn.atsuc.xfg.frame.infrastructure.po.RuleTreeNodeLinePO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @description: 规则树节点连线DAO
* @author: 小傅哥,微信:fustack
* @date: 2021/9/22
* @github: https://github.com/fuzhengwei
* @Copyright: 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Mapper
public interface RuleTreeNodeLineDao {
......
/**
* 数据库操作
*/
package cn.bugstack.xfg.frame.infrastructure;
\ No newline at end of file
package cn.atsuc.xfg.frame.infrastructure;
\ No newline at end of file
package cn.bugstack.xfg.frame.infrastructure.po;
package cn.atsuc.xfg.frame.infrastructure.po;
import lombok.AllArgsConstructor;
import lombok.Data;
......@@ -6,9 +6,6 @@ import lombok.NoArgsConstructor;
/**
* @description: 规则树节点连线
* @author: 小傅哥,微信:fustack
* @github: https://github.com/fuzhengwei
* @Copyright: 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Data
@AllArgsConstructor
......
package cn.bugstack.xfg.frame.infrastructure.po;
package cn.atsuc.xfg.frame.infrastructure.po;
import lombok.AllArgsConstructor;
import lombok.Data;
......@@ -6,9 +6,6 @@ import lombok.NoArgsConstructor;
/**
* @description: 规则树节点
* @author: 小傅哥,微信:fustack
* @github: https://github.com/fuzhengwei
* @Copyright: 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Data
@AllArgsConstructor
......
package cn.bugstack.xfg.frame.infrastructure.po;
package cn.atsuc.xfg.frame.infrastructure.po;
import lombok.AllArgsConstructor;
import lombok.Data;
......@@ -8,10 +8,6 @@ import java.util.Date;
/**
* @description: 规则树
* @author: 小傅哥,微信:fustack
* @date: 2021/9/22
* @github: https://github.com/fuzhengwei
* @Copyright: 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Data
@AllArgsConstructor
......
package cn.bugstack.xfg.frame.infrastructure.po;
package cn.atsuc.xfg.frame.infrastructure.po;
import lombok.AllArgsConstructor;
import lombok.Data;
......
package cn.bugstack.xfg.frame.infrastructure.repository;
package cn.atsuc.frame.infrastructure.repository;
import cn.bugstack.xfg.frame.domain.rule.model.aggregates.TreeRuleAggregate;
import cn.bugstack.xfg.frame.domain.rule.model.valobj.TreeNodeLineVO;
import cn.bugstack.xfg.frame.domain.rule.model.valobj.TreeNodeVO;
import cn.bugstack.xfg.frame.domain.rule.model.valobj.TreeRootVO;
import cn.bugstack.xfg.frame.domain.rule.repository.IRuleRepository;
import cn.bugstack.xfg.frame.infrastructure.dao.RuleTreeDao;
import cn.bugstack.xfg.frame.infrastructure.dao.RuleTreeNodeDao;
import cn.bugstack.xfg.frame.infrastructure.dao.RuleTreeNodeLineDao;
import cn.bugstack.xfg.frame.infrastructure.po.RuleTreeNodeLinePO;
import cn.bugstack.xfg.frame.infrastructure.po.RuleTreeNodePO;
import cn.bugstack.xfg.frame.infrastructure.po.RuleTreePO;
import cn.bugstack.xfg.frame.types.Constants;
import cn.atsuc.frame.domain.rule.model.aggregates.TreeRuleAggregate;
import cn.atsuc.frame.domain.rule.model.valobj.TreeNodeLineVO;
import cn.atsuc.frame.domain.rule.model.valobj.TreeNodeVO;
import cn.atsuc.frame.domain.rule.model.valobj.TreeRootVO;
import cn.atsuc.frame.domain.rule.repository.IRuleRepository;
import cn.atsuc.frame.types.Constants;
import cn.atsuc.xfg.frame.infrastructure.dao.RuleTreeDao;
import cn.atsuc.xfg.frame.infrastructure.dao.RuleTreeNodeDao;
import cn.atsuc.xfg.frame.infrastructure.dao.RuleTreeNodeLineDao;
import cn.atsuc.xfg.frame.infrastructure.po.RuleTreeNodeLinePO;
import cn.atsuc.xfg.frame.infrastructure.po.RuleTreeNodePO;
import cn.atsuc.xfg.frame.infrastructure.po.RuleTreePO;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
......@@ -22,10 +22,6 @@ import java.util.Map;
/**
* @description: 规则信息仓储服务
* @author: 小傅哥,微信:fustack
* @date: 2021/10/8
* @github: https://github.com/fuzhengwei
* @Copyright: 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Repository
public class RuleRepository implements IRuleRepository {
......
package cn.bugstack.xfg.frame.infrastructure.repository;
package cn.atsuc.xfg.frame.infrastructure.repository;
import cn.bugstack.xfg.frame.domain.user.model.valobj.UserVO;
import cn.bugstack.xfg.frame.domain.user.repository.IUserRepository;
import cn.bugstack.xfg.frame.infrastructure.dao.IUserDao;
import cn.bugstack.xfg.frame.infrastructure.po.UserPO;
import cn.atsuc.xfg.frame.domain.user.model.valobj.UserVO;
import cn.atsuc.xfg.frame.domain.user.repository.IUserRepository;
import cn.atsuc.xfg.frame.infrastructure.dao.IUserDao;
import cn.atsuc.xfg.frame.infrastructure.po.UserPO;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* @author 小傅哥,微信:fustack
* @description
* @github https://github.com/fuzhengwei
* @Copyright 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Repository
public class UserRepository implements IUserRepository {
......
......@@ -3,13 +3,13 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>xfg-frame-ddd</artifactId>
<groupId>cn.bugstack</groupId>
<artifactId>atsuc-frame-ddd</artifactId>
<groupId>cn.atsuc</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>xfg-frame-trigger</artifactId>
<artifactId>atsuc-frame-trigger</artifactId>
<dependencies>
<dependency>
......@@ -39,25 +39,25 @@
<!-- 自身模块 begin -->
<dependency>
<groupId>cn.bugstack</groupId>
<artifactId>xfg-frame-domain</artifactId>
<groupId>cn.atsuc</groupId>
<artifactId>atsuc-frame-domain</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.bugstack</groupId>
<artifactId>xfg-frame-api</artifactId>
<groupId>cn.atsuc</groupId>
<artifactId>atsuc-frame-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.bugstack</groupId>
<artifactId>xfg-frame-types</artifactId>
<groupId>cn.atsuc</groupId>
<artifactId>atsuc-frame-types</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- 自身模块 end -->
</dependencies>
<build>
<finalName>xfg-frame-trigger</finalName>
<finalName>atsuc-frame-trigger</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
......
package cn.bugstack.xfg.frame.trigger.http;
package cn.atsuc.frame.trigger.http;
import cn.bugstack.xfg.frame.types.Constants;
import cn.bugstack.xfg.frame.types.Response;
import cn.atsuc.frame.types.Constants;
import cn.atsuc.frame.types.Response;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......
/**
* 触发器;接收http请求
*/
package cn.bugstack.xfg.frame.trigger.http;
\ No newline at end of file
package cn.atsuc.frame.trigger.http;
\ No newline at end of file
/**
* 触发器;接收mq消费
*/
package cn.bugstack.xfg.frame.trigger.mq;
\ No newline at end of file
package cn.atsuc.frame.trigger.mq;
\ No newline at end of file
package cn.bugstack.xfg.frame.trigger.rpc;
package cn.atsuc.frame.trigger.rpc;
import cn.bugstack.xfg.frame.api.IAccountService;
import cn.atsuc.frame.api.IAccountService;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
......
package cn.bugstack.xfg.frame.trigger.rpc;
package cn.atsuc.frame.trigger.rpc;
import cn.bugstack.xfg.frame.api.IRuleService;
import cn.bugstack.xfg.frame.api.model.request.DecisionMatterRequest;
import cn.bugstack.xfg.frame.api.model.response.DecisionMatterResponse;
import cn.bugstack.xfg.frame.domain.rule.model.entity.DecisionMatterEntity;
import cn.bugstack.xfg.frame.domain.rule.model.entity.EngineResultEntity;
import cn.bugstack.xfg.frame.domain.rule.service.engine.EngineFilter;
import cn.bugstack.xfg.frame.types.Constants;
import cn.bugstack.xfg.frame.types.Response;
import cn.atsuc.frame.api.IRuleService;
import cn.atsuc.frame.api.model.request.DecisionMatterRequest;
import cn.atsuc.frame.api.model.response.DecisionMatterResponse;
import cn.atsuc.frame.domain.rule.model.entity.DecisionMatterEntity;
import cn.atsuc.frame.domain.rule.model.entity.EngineResultEntity;
import cn.atsuc.frame.domain.rule.service.engine.EngineFilter;
import cn.atsuc.frame.types.Constants;
import cn.atsuc.frame.types.Response;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import javax.annotation.Resource;
/**
* @author 小傅哥,微信:fustack
* @description
* @github https://github.com/fuzhengwei
* @Copyright 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Slf4j
@DubboService(version = "1.0.0")
public class RuleService implements IRuleService {
......
/**
* 触发器;接收rpc调用
*/
package cn.bugstack.xfg.frame.trigger.rpc;
\ No newline at end of file
package cn.atsuc.frame.trigger.rpc;
\ No newline at end of file
/**
* 触发器;接收调度任务
*/
package cn.bugstack.xfg.frame.trigger.task;
\ No newline at end of file
package cn.atsuc.frame.trigger.task;
\ No newline at end of file
......@@ -3,13 +3,13 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>xfg-frame-ddd</artifactId>
<groupId>cn.bugstack</groupId>
<artifactId>atsuc-frame-ddd</artifactId>
<groupId>cn.atsuc</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>xfg-frame-types</artifactId>
<artifactId>atsuc-frame-types</artifactId>
<dependencies>
<dependency>
......@@ -25,7 +25,7 @@
</dependencies>
<build>
<finalName>xfg-frame-types</finalName>
<finalName>atsuc-frame-types</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
......
package cn.bugstack.xfg.frame.types;
package cn.atsuc.frame.types;
import lombok.AllArgsConstructor;
import lombok.Getter;
......
package cn.bugstack.xfg.frame.types;
package cn.atsuc.frame.types;
import lombok.AllArgsConstructor;
import lombok.Builder;
......
/**
* 通用类型设定
*/
package cn.bugstack.xfg.frame.types;
\ No newline at end of file
package cn.atsuc.frame.types;
\ No newline at end of file
......@@ -3,7 +3,7 @@ version: '3'
services:
# MySQL 5.7
mysql:
image: mysql:5.7
image: mysql:8.0.29
container_name: mysql
restart: always
environment:
......
......@@ -4,17 +4,17 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cn.bugstack</groupId>
<artifactId>xfg-frame-ddd</artifactId>
<groupId>cn.atsuc</groupId>
<artifactId>atsuc-frame-ddd</artifactId>
<version>1.0-SNAPSHOT</version>
<modules>
<module>xfg-frame-api</module>
<module>xfg-frame-app</module>
<module>xfg-frame-domain</module>
<module>xfg-frame-trigger</module>
<module>xfg-frame-infrastructure</module>
<module>xfg-frame-types</module>
<module>atsuc-frame-api</module>
<module>atsuc-frame-app</module>
<module>atsuc-frame-domain</module>
<module>atsuc-frame-trigger</module>
<module>atsuc-frame-infrastructure</module>
<module>atsuc-frame-types</module>
</modules>
<packaging>pom</packaging>
......@@ -47,7 +47,7 @@
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.34</version>
<version>8.0.29</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
......@@ -120,7 +120,7 @@
</dependencyManagement>
<build>
<finalName>xfg-frame</finalName>
<finalName>atsuc-frame</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
......
package cn.bugstack.xfg.frame.api;
import cn.bugstack.xfg.frame.api.model.request.DecisionMatterRequest;
import cn.bugstack.xfg.frame.api.model.response.DecisionMatterResponse;
import cn.bugstack.xfg.frame.types.Response;
/**
* @author 小傅哥,微信:fustack
* @description 规则服务
* @github https://github.com/fuzhengwei
* @Copyright 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
public interface IRuleService {
Response<DecisionMatterResponse> doRule(DecisionMatterRequest request);
}
docker build -f ./Dockerfile -t fuzhengwei/xfg-frame-app:1.3 .
\ No newline at end of file
docker stop xfg-frame-app
\ No newline at end of file
package cn.bugstack.xfg.frame.domain.order.model.aggregates;
import cn.bugstack.xfg.frame.domain.order.model.entity.OrderItemEntity;
import cn.bugstack.xfg.frame.domain.order.model.valobj.OrderIdVO;
import java.util.List;
/**
* @author 小傅哥,微信:fustack
* @description 订单聚合对象
* @github https://github.com/fuzhengwei
* @Copyright 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
public class OrderAggregate {
private OrderIdVO orderId;
private List<OrderItemEntity> items;
}
package cn.bugstack.xfg.frame.domain.order.model.entity;
/**
* @author 小傅哥,微信:fustack
* @description 订单条目实体
* @github https://github.com/fuzhengwei
* @Copyright 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
public class OrderItemEntity {
}
package cn.bugstack.xfg.frame.domain.order.repository;
/**
* @author 小傅哥,微信:fustack
* @description
* @github https://github.com/fuzhengwei
* @Copyright 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
public interface IOrderRepository {
}
package cn.bugstack.xfg.frame.domain.order.service;
import org.springframework.stereotype.Service;
/**
* @author 小傅哥,微信:fustack
* @description
* @github https://github.com/fuzhengwei
* @Copyright 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
@Service
public class OrderService {
}
package cn.bugstack.xfg.frame.domain.user.repository;
import cn.bugstack.xfg.frame.domain.user.model.valobj.UserVO;
import java.util.List;
/**
* @author 小傅哥,微信:fustack
* @description 仓储接口
* @github https://github.com/fuzhengwei
* @Copyright 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
public interface IUserRepository {
List<UserVO> queryUserList();
}
package cn.bugstack.xfg.frame.domain.user.service;
import cn.bugstack.xfg.frame.domain.user.model.valobj.UserVO;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author 小傅哥,微信:fustack
* @description
* @github https://github.com/fuzhengwei
* @Copyright 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
*/
public interface UserService {
List<UserVO> queryUserList();
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册