浏览代码

完善文档

zhou-hao 7 年之前
父节点
当前提交
3ff746a623

+ 1 - 0
README.md

@@ -42,3 +42,4 @@
 |[hsweb-message](hsweb-message)|mq,websocket...| 80%|
 |[hsweb-starter](hsweb-starter)|模块启动器| 90%|
 |[hsweb-system](hsweb-system)|**系统常用功能**| 80%|
+|[hsweb-thirdparty](hsweb-thirdparty)| 第三方插件 | 100% |

+ 0 - 58
docs/dev-guide/README.md

@@ -1,58 +0,0 @@
-# hsweb 开发手册
-
-## 框架基础设施
-主要为框架提供的常用工具
-1. [增删改查](crud)
-    * [通用增删改查](crud#通用增删改查)
-    * [动态条件](crud#动态条件)
-    * [表关联动态条件](crud#表关联)
-    * [拓展自定义字段](crud/custom-field.md)
-2. 权限控制
-    * 常用API
-    * 使用注解声明权限控制
-    * 自定义声明权限控制
-    * 拓展数据权限控制
-3. [访问日志](logging)
-    * [声明记录访问日志](logging#声明记录访问日志)
-    * [监听访问日志](logging#监听访问日志)
-    * [日志序列化](logging#日志序列化)
-4. 动态数据源
-    * 在配置文件中添加动态数据源
-    * 通过自定义,在数据库或其他地方添加动态数据源
-    * 注解方式切换动态数据源
-    * 编程方式切换动态数据源
-5. 常用并发工具
-    * 锁,分布式锁
-    * 计数器
-    * 异步任务,批量任务,事务
-6. 消息封装
-    * 消息队列
-    * websocket
-7. 其他工具
-    * 智能日期格式化
-    * excel,word操作
-    * 动态脚本引擎
-
-## 系统功能
-主要为框架实现的常用功能
-1. 权限配置
-2. 组织架构
-    * 组织架构数据权限控制
-    * 人员关系
-3. 数据字典
-4. 动态表单
-   * 设计表单
-   * 增删改查
-   * 验证器
-   * 触发器
-5. 文件上传下载
-    * 本地文件上传下载
-    * 文件秒传
-    * 静态文件上传下载
-    * 拓展其他文件上传
-6. 定时调度
-    * 动态脚本编写定时调度任务
-    * 集群下指定固定节点执行任务
-7. 动态脚本
-8. 工作流引擎
-    * flowable工作流设计器

+ 0 - 1
docs/dev-guide/autz/README.md

@@ -1 +0,0 @@
-# 

+ 0 - 79
docs/dev-guide/crud/README.md

@@ -1,79 +0,0 @@
-# 通用增删改查
-hsweb 中提供了一套通用的增删改查封装([hsweb-commons](../../../hsweb-commons)),实现增删改查以及动态查询。
-
-接口约定: 
-1. 实体类需要实现`Entity`接口, 通用实体类继承`GenericEntity<主键>`类.
-2. Dao继承`Dao`接口, 通用增删改查继承`CrudDao<实体类,主键>`.
-3. Service继承`Service`接口,通用增删改查继承`CrudService`.
-4. Controller,通用增删改查实现`SimpleGenericEntityController<实体类,主键,动态查询参数>`
-
-实现约定:
-1. 框架提供的实体都是接口形式,使用`EntityFactory`来创建实例,便于拓展属性. 实际业务中,可能并不需要这么做.
-2. Dao通用增删改查目前提供mybatis实现,可参照[UserMapper.xml](https://github.com/hs-web/hsweb-framework/blob/master/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-dao/hsweb-system-authorization-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/authorization/UserMapper.xml#L23-L69)
-   使用xml方式,提供了动态条件的同时保留了灵活性.
-3. Service提供了dsl的方式构造动态条件,继承`GenericEntityService<实体类,主键>`即可.注意:框架未使用dao来生成主键,而是在service中通过IDGenerator来生成.
-
-# 动态条件
-
-### Service中使用dsl进行动态条件
-继承`GenericEntityService`后可获得dsl方式动态条件功能:
-
-```java
-    public void method(){
-       //where name=? or name = ?
-       createQuery().where("name","张三").or("name","李四").list();
-       //set status=? where id = ?
-       createUpdate().set("status",1).where("id",id).exec(); //注意需要调用exec()
-    }
-```
-更多用法,详见:[hsweb-commons-service-simple](https://github.com/hs-web/hsweb-framework/tree/master/hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple)
-
-### 前端传参,动态查询
-目前仅实现了一种动态条件从参数:`QueryParamEntity`,
-因此Controller实现`SimpleGenericEntityController<实体类,主键,QueryParamEntity>`接口. 获得动态查询功能
-
-```bash
-  GET /user?terms[0].column=name&terms[0].termType=like&terms[0].value=张三
-  // 等同于 where name like ?
-```
-更多用法,详见:[hsweb-commons-controller](https://github.com/hs-web/hsweb-framework/tree/master/hsweb-commons/hsweb-commons-controller)
-
-# 表关联
-由于动态条件实现较简单,目前动态条件需要修改mybatis dao实现的的mapper.xml,局部代码如下
-```xml
- <resultMap id="CardDataResultMap" type="com.zmcsoft.apsp.api.card.entity.SimpleCardDataEntity">
-        <id property="id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
-        <result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
-        
-        <!--关联表的信息-->
-        <result property="detail.email" column="detail.email" javaType="String" jdbcType="VARCHAR"/>
-        <result property="detail.phoneNumber" column="detail.phone_number" javaType="String" jdbcType="VARCHAR"/>
-</resultMap>
-
- <select id="query" parameterType="org.hswebframework.web.commons.entity.Entity" resultMap="CardDataResultMap">
-        <include refid="config"/>
-        select
-        <include refid="BasicMapper.buildSelectField"/>
-        from user 
-        left join user_detail detail on detail.user_id = user.id
-        <where>
-            <include refid="BasicMapper.buildWhere"/>
-        </where>
-        <include refid="BasicMapper.buildSortField"/>
-</select>
-
-<select id="count" parameterType="org.hswebframework.web.commons.entity.Entity" resultMap="CardDataResultMap">
-        <include refid="config"/>
-        select count(1) from user 
-        left join user_detail detail on detail.user_id = user.id
-        <where>
-            <include refid="BasicMapper.buildWhere"/>
-        </where>
-        <include refid="BasicMapper.buildSortField"/>
-</select>
-```
-
-然后就可以通过动态查询来查询了
-```java
-createQuery().where("detail.email","admin@hsweb.me").single(); 
-```

+ 0 - 0
docs/dev-guide/crud/custom-field.md


+ 0 - 63
docs/dev-guide/logging/README.md

@@ -1,63 +0,0 @@
-## 声明记录访问日志
-
-1. 如果你是maven工程
-    * 引入私服配置
-    
-            <repositories>
-                <repository>
-                    <id>hsweb-nexus</id>
-                    <name>Nexus Release Repository</name>
-                    <url>http://nexus.hsweb.me/content/groups/public/</url>
-                    <snapshots>
-                        <enabled>true</enabled>
-                    </snapshots>
-                </repository>
-            </repositories>
-    
-    * 直接引入依赖
-
-            <dependency>
-                <groupId>org.hswebframework.web</groupId>
-                <artifactId>hsweb-access-logging-aop</artifactId>
-                <version>3.0-SNAPSHOT</version>
-            </dependency>
-		
-	
-2. 如果你是非maven工程,[请自行去以下地址](http://nexus.hsweb.me/)下载jar包
-		
-## 监听访问日志
-
-1. 开启访问日志
-    * 在启动类中注解@EnableAccessLogger
-    
-            @SpringBootApplication
-            @EnableAccessLogger
-            public class AppApplication {
-                public static void main(String[] args) {
-                    SpringApplication.run(AppApplication.class, args);
-                }	
-            }
-2. 访问日志 API
-
-    * controller类或者方法上,注解 @AccessLogger("功能描述")
-    
-            @AccessLogger("hello")
-            @RequestMapping(value = "/",method = RequestMethod.GET)
-            public String  hello() {
-                return "Hello World ! ";
-            }        
-    
-3. 日志监听
-
-    * 创建类,实现: AccessLoggerListener接口并注入到spring容器, 当有日志产生时,会调用接口方法onLogger,并传入日志信息
-    
-            @Component
-            public class MyLoggingListener implements AccessLoggerListener {
-                @Override
-                public void onLogger(AccessLoggerInfo loggerInfo) {
-                    System.out.println(loggerInfo.toString());
-                }
-            }
-    
- 
-## 日志序列化

+ 0 - 6
docs/help/submit-code-issues.md

@@ -1,6 +0,0 @@
-# 提交包含代码的 issues
-
-1. 在github中打开代码,点击行号选择代码(按住shift多选);或者使用idea,选中代码段,右键-open on github.
-2. 右侧出现 ... 的图标,点击,选择open new issue按钮. 或者直接复制浏览器地址栏中的地址到issue中.
-3. 描述问题
-4. 提交

二进制
docs/hsweb3.png


+ 6 - 0
hsweb-thirdparty/README.md

@@ -0,0 +1,6 @@
+# 对一些第三方插件的封装
+
+```bash
+--------hsweb-thirdparty-ueditor        # 百度ueditor的封装
+
+```

+ 42 - 0
hsweb-thirdparty/hsweb-thirdparty-ueditor/README.md

@@ -0,0 +1,42 @@
+# 百度UEditor spring-boot集成
+
+对[百度UEditor](http://ueditor.baidu.com/website/)后台服务的封装
+
+# 使用:
+
+在pom.xml引入模块:
+
+```xml
+<dependency>
+   <dependency>
+        <groupId>org.hswebframework.web</groupId>
+        <artifactId>hsweb-thirdparty-ueditor</artifactId>
+        <version>${hsweb.framework.version}</version>
+    </dependency>
+</dependency>
+```
+
+⚠️ 注意: 此模块使用`hsweb-system-file-api`模块进行文件管理. 
+所以在使用此模块之前需要提供`hsweb-system-file-api`的实现模块.
+你可以查看[hsweb-system-file](../../hsweb-system/hsweb-system-file)的文档进行引入.
+
+### 后端配置
+
+在`src/main/resources` 下建立`ueditor-config.json`文件,此文件为ueditor的配置文件.例如:
+[ueditor-config.json](https://github.com/hs-web/hsweb3-demo/blob/master/src/main/resources/ueditor-config.json)
+你也可以参照[官方的配置](http://fex.baidu.com/ueditor/#server-config)
+
+### 前端配置
+修改`ueditor.config.js`中的配置项: `window.UEDITOR_CONFIG.serverUrl`. 例如:
+
+```js
+ /**
+     * 配置项主体。注意,此处所有涉及到路径的配置别遗漏URL变量。
+     */
+    window.UEDITOR_CONFIG = {
+
+        // 服务器统一请求接口路径
+          serverUrl: "/ueditor"
+        //** 更多配置项
+        }
+```

+ 9 - 0
hsweb-thirdparty/hsweb-thirdparty-ueditor/pom.xml

@@ -6,35 +6,44 @@
         <artifactId>hsweb-thirdparty</artifactId>
         <groupId>org.hswebframework.web</groupId>
         <version>3.0.0-RC-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>hsweb-thirdparty-ueditor</artifactId>
 
+    <description>对百度UEditor后台服务的拓展和封装</description>
+
     <dependencies>
+        <!--文件服务API-->
         <dependency>
             <groupId>org.hswebframework.web</groupId>
             <artifactId>hsweb-system-file-api</artifactId>
             <version>${project.version}</version>
         </dependency>
+
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter</artifactId>
         </dependency>
+
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-webmvc</artifactId>
         </dependency>
+
         <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>javax.servlet-api</artifactId>
             <scope>provided</scope>
         </dependency>
+
         <dependency>
             <groupId>commons-fileupload</groupId>
             <artifactId>commons-fileupload</artifactId>
             <version>1.3.2</version>
             <optional>true</optional>
         </dependency>
+
     </dependencies>
 </project>