# app **Repository Path**: qul/app ## Basic Information - **Project Name**: app - **Description**: 后台继承快速开发框架 - **Primary Language**: Java - **License**: MulanPSL-1.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 12 - **Forks**: 1 - **Created**: 2020-05-14 - **Last Updated**: 2025-01-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # app ## 项目介绍 ​ app为简易开发框架,目的为减少开发工作量提供的企业开发方案。 ## 组织结构 app ├── frame-core-- 基础框架公共模块 ├── frame-web --web框架公共模块 ├── frame-web-service --用户、角色、菜单管理 ├── frame-flow -- 业务组件流程引擎 ├── frame-mq -- 集成原生rocketmq服务 ├── frame-redis -- 集成原生redis服务 ├── frame-file -- 文件上传下载 ├── frame-batch -- 批量调度 ├── procnode -- 计算节点示例 └── webapp -- web工程示例 ### 后端技术选型 | 技术 | 名称 | 官网 | | ----------------- | ------------------- | ------------------------------------------------------------ | | Springboot | 基础框架 | [http://projects.spring.io/spring-framework/](http://projects.spring.io/spring-framework/) | | Apache Shiro | 安全框架 | [http://shiro.apache.org/](http://shiro.apache.org/) | | MyBatis | ORM框架 | [http://www.mybatis.org/mybatis-3/zh/index.html](http://www.mybatis.org/mybatis-3/zh/index.html) | | MyBatis Generator | 代码生成 | [http://www.mybatis.org/generator/index.html](http://www.mybatis.org/generator/index.html) | | PageHelper | MyBatis物理分页插件 | [http://git.oschina.net/free/Mybatis_PageHelper](http://git.oschina.net/free/Mybatis_PageHelper) | | Druid | 数据库连接池 | [https://github.com/alibaba/druid](https://github.com/alibaba/druid) | | Freemarker | 模板引擎 | | | Redis | 分布式缓存数据库 | [https://redis.io/](https://redis.io/) | | RocketMQ | 消息队列 | [http://activemq.apache.org/](http://activemq.apache.org/) | | Log4J | 日志组件 | [http://logging.apache.org/log4j/1.2/](http://logging.apache.org/log4j/1.2/) | ## 软件架构 ![输入图片说明](https://images.gitee.com/uploads/images/2020/0515/000701_4d6a6726_1377366.png "微信图片_20200515000644.png") ## 模块依赖 ![输入图片说明](https://images.gitee.com/uploads/images/2021/0510/235734_c9d1163f_1377366.png "屏幕截图.png") ## 模块介绍 > frame-core frame-core 基础框架公共模块由springboot Redis mybatis 组成,包括 通用dao、数据库二级缓存、异常捕获、服务切面、雪花序列、工具类等。 > frame-web frame-web web框架公共模块由springboot shiro 组成,包括 通用filter、shiro集成。 > frame-web-service frame-web-service 用户权限管理、资源管理、菜单管理等功能。 > frame-flow frame-flow 业务组件编排和流程执行引擎。 (目前支持xml 后续会支持 json) 详细说明在完整示例下面: ```xml ``` 标签说明: | 标签 | 作用 | | ------------- | ------------------------------------------------------------ | | app:flow | 定义业务流程顺序: 根据标签属性id生成bean,包含多个app:block | | app:block | 业务组件集合块:内包含多个业务组件和判断组件,通过transaction标签判断本业务块是否开启事务,本业务块执行完成则提交事物。 | | app:component | 业务组件:根据beanId 和method找到对应bean的方法,方法入参由app:dataConvert 从上下文中映射获得,属性asyn判断是否异步执行 | | app:futures | 并发异步组件:包含多个app:future 异步业务组件,由completableFutures实现 属性procMode和completableFutures阻塞模式相同,nullOf不阻塞 | | app:future | 异步组件:必须包含在app:futures内并发执行 参数和app:component相同 | | app:if | 逻辑判断组件:内包含多个业务组件集合块(app:block) 根据属性expression的表达式是否成立判断执行。 | | app:stop | 终止判断组件: 根据属性expression的表达式是否成立判断是否终止,expression为空则直接终止 | > frame-redis frame-redis 自动集成 单例redis和集群jediscluster 服务,提供有序序列服务。 > frame-feign(废弃) spring boot引用 openfeign自认为上下文完全隔离和切换,感觉过重 ,但使用nacos为注册中心为feign动态获取服务列表需要用到ribbon,nacos在springboot组件里 并没有NacosServerList功能维护服务列表 所以不在继续封装,直接引用openfeign或者dubbo,后续可以为nacos-spring开发一个组件 。 > frame-mq frame-mq 远程rocketmq封装,使用示例如下: 消费端:集成AbstractRocketConsumer 启动时加载监听 ```java public class DefRocketConsumer extends AbstractRocketConsumer { @Value( "${rocketmq.def.topic}") public String topic; @Value( "${rocketmq.def.tags}") public String tags; @Value( "${rocketmq.def.consumerTitel}") public String consumerTitel; // 设置消费队列信息 @PostConstruct public void init() { super.init(topic, tags, consumerTitel, "1"); } @Override public void messageHander(MessageExt msg) { log.info(msg.toString()); //业务处理 } } ``` 生产端:集成AbstractRocketProducer 配置多队列生产者 ```java public class DefRocketProducer extends AbstractRocketProducer { @Value("${rocketmq.namesrvAddr}") String namesrvAddr; @Value("${rocketmq.groupName}") String groupName; @PostConstruct public void init() throws MQClientException { super.init(groupName, namesrvAddr); } } ```