Skip to content

Commit

Permalink
jfinal cms 4.1.4 release~!~
Browse files Browse the repository at this point in the history
  • Loading branch information
FLY的狐狸 committed Jan 26, 2017
1 parent 82c4896 commit 94705ea
Show file tree
Hide file tree
Showing 34 changed files with 1,268 additions and 82 deletions.
9 changes: 9 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
Change Log 更新说明
------------------------------

## 2016-12-17 jfinal cms4.1.4
> 1. 加入系统参数配置模块。
> 2. api配置迁移到系统参数配置中。
> 3. 修复登陆后可以跳过菜单限制,加入菜单权限拦截。
## 2016-11-15
> 1. api接口调用加入了登陆验证以及验证开关。
## 2016-10-03 jfinal cms4.1.3
> 1. 完善api功能。
Expand Down
81 changes: 71 additions & 10 deletions doc/api文档.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* 接口方法扩展方便。只需要在接口IApiLogic中添加方法,完善各个版本实现即可。
* 支持多版本并行。只需要实现接口IApiLogic,集成上一个版本,将需要修改的方法重写即可。
* 支持接口开关、黑名单、版本控制功能。
* 接口验证功能暂时未实现
* 支持接口登陆验证以及验证开关

## 接口使用说明
------------------------
Expand Down Expand Up @@ -34,7 +34,10 @@ String p; // 参数
3. 分页有默认值pageNo=1,pageSize=20
4. 验证功能后续完善
4. 登陆验证功能说明
> 1)通过login接口进行登陆,获取key。
> 2)其他接口调用需要携带两个公共请求参数:apiUser为用户名,checkSum为登陆接口返回key。
> 3)如果退出调用logout接口。
5. p为json参数,携带我们接口想要的自定义参数。
p={siteId:1,test:"ok"}
Expand All @@ -57,7 +60,7 @@ p={siteId:1,test:"ok"}
* 请求参数

```
version:1.0.0 版本号
```

* 示例
Expand Down Expand Up @@ -86,7 +89,7 @@ version:1.0.0 版本号
* 请求参数

```
version:1.0.0 版本号
```

* 示例
Expand All @@ -106,6 +109,64 @@ version:1.0.0 版本号
msg: "success"
}
```
#### 登陆接口

* 接口说明:获取配置信息
* 请求方式: **_GET/POST_**
* 请求地址:**_/api/action/login_**
* 请求参数

```
username:用户名
password:密码
```

* 示例

```
/api/action/login?version=1.0.1&p={username:"admin",password:"123"}
```

* 返回结果

```json
{
data: {
key: "oTkt"
},
code: 0,
msg: "success"
}
```

#### 登出接口

* 接口说明:获取配置信息
* 请求方式: **_GET/POST_**
* 请求地址:**_/api/action/logout_**
* 请求参数

```
```

* 示例

```
/api/action/logout?version=1.0.1&apiUser=admin&checkSum=YBrs
```

* 返回结果

```json
{
data: {
r: "ok"
},
code: 0,
msg: "success"
}
```

#### 配置接口

Expand All @@ -115,13 +176,13 @@ version:1.0.0 版本号
* 请求参数

```
version:1.0.0 版本号
```

* 示例

```
/api/action/config?version=1.0.0
/api/action/config?version=1.0.0&apiUser=admin&checkSum=YBrs
```

* 返回结果
Expand Down Expand Up @@ -152,7 +213,7 @@ siteId:1 站点ID
* 示例

```
/api/action/folders?version=1.0.1&siteId=1
/api/action/folders?version=1.0.1&apiUser=admin&checkSum=YBrs&p={siteId:2}
```

* 返回结果
Expand Down Expand Up @@ -207,7 +268,7 @@ siteId:1 站点ID
* 示例

```
/api/action/pageArticleSite?version=1.0.1&pageNo=1&pageSize=20&p={siteId:1}
/api/action/pageArticleSite?version=1.0.1&apiUser=admin&checkSum=YBrs&pageNo=1&pageSize=20&p={siteId:2}
```

* 返回结果
Expand Down Expand Up @@ -268,7 +329,7 @@ siteId:1 站点ID
* 示例

```
/api/action/pageArticle?version=1.0.1&pageNo=1&pageSize=1&p={folderId:1}
/api/action/pageArticle?version=1.0.1&apiUser=admin&checkSum=YBrs&pageNo=1&pageSize=1&p={folderId:2}
```

* 返回结果
Expand Down Expand Up @@ -329,7 +390,7 @@ siteId:1 站点ID
* 示例

```
/api/action/article?version=1.0.1&p={articleId:1}
/api/action/article?version=1.0.1&apiUser=admin&checkSum=YBrs&p={articleId:1}
```

* 返回结果
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.jflyfox</groupId>
<artifactId>jfinal_cms</artifactId>
<packaging>war</packaging>
<version>4.1.3</version>
<version>4.1.4</version>

<properties>
<!-- 文件拷贝时的编码 -->
Expand Down
44 changes: 37 additions & 7 deletions sql/jfinal_cms_v4.sql
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,18 @@ CREATE TABLE `sys_menu` (
-- Records of sys_menu
-- ----------------------------
INSERT INTO `sys_menu` VALUES ('1', '0', '系统管理', 'system_root', null, '1', '1', '90', '1', '2015-04-27 17:28:06', '1');
INSERT INTO `sys_menu` VALUES ('2', '1', '组织机构', 'department', 'system/department/list', '1', '1', '91', '2', '2015-04-27 17:28:25', '1');
INSERT INTO `sys_menu` VALUES ('3', '1', '用户管理', 'user', 'system/user/list', '1', '1', '92', '2', '2015-04-27 17:28:46', '1');
INSERT INTO `sys_menu` VALUES ('4', '1', '角色管理', 'role', 'system/role/list', '1', '1', '94', '2', '2015-04-27 17:29:13', '1');
INSERT INTO `sys_menu` VALUES ('5', '1', '菜单管理', 'menu', 'system/menu/list', '1', '1', '96', '2', '2015-04-27 17:29:43', '1');
INSERT INTO `sys_menu` VALUES ('6', '1', '数据字典', 'dict', 'system/dict/list', '1', '1', '97', '2', '2015-04-27 17:30:05', '1');
INSERT INTO `sys_menu` VALUES ('2', '1', '组织机构', 'department', 'system/department', '1', '1', '91', '2', '2015-04-27 17:28:25', '1');
INSERT INTO `sys_menu` VALUES ('3', '1', '用户管理', 'user', 'system/user', '1', '1', '92', '2', '2015-04-27 17:28:46', '1');
INSERT INTO `sys_menu` VALUES ('4', '1', '角色管理', 'role', 'system/role', '1', '1', '94', '2', '2015-04-27 17:29:13', '1');
INSERT INTO `sys_menu` VALUES ('5', '1', '菜单管理', 'menu', 'system/menu', '1', '1', '96', '2', '2015-04-27 17:29:43', '1');
INSERT INTO `sys_menu` VALUES ('6', '1', '数据字典', 'dict', 'system/dict', '1', '1', '97', '2', '2015-04-27 17:30:05', '1');
INSERT INTO `sys_menu` VALUES ('7', '20', '联系人管理', 'contact', 'admin/contact/list', '1', '1', '38', '2', '2015-04-28 12:38:04', '1');
INSERT INTO `sys_menu` VALUES ('8', '18', '栏目管理', 'folder', 'admin/folder/list', '1', '1', '11', '2', '2015-04-28 22:34:46', '1');
INSERT INTO `sys_menu` VALUES ('9', '18', '文章管理', 'article', 'admin/article/list', '1', '1', '14', '2', '2015-04-28 22:35:24', '1');
INSERT INTO `sys_menu` VALUES ('10', '20', '友情链接', 'friendlylink', 'admin/friendlylink/list', '1', '1', '32', '2', '2015-04-28 22:35:56', '1');
INSERT INTO `sys_menu` VALUES ('11', '20', '访问量统计', 'pageview', 'admin/pageview', '1', '1', '33', '2', '2015-04-28 22:36:34', '1');
INSERT INTO `sys_menu` VALUES ('12', '19', '回复管理', 'comment', 'admin/comment/list', '1', '1', '21', '2', '2015-05-06 09:40:46', '1');
INSERT INTO `sys_menu` VALUES ('13', '20', '缓存更新', 'operation', 'admin/operation', '1', '1', '32', '2', '2015-05-06 11:41:33', '1');
INSERT INTO `sys_menu` VALUES ('13', '20', '缓存更新', 'operation', 'admin/operation', '1', '1', '31', '2', '2015-05-06 11:41:33', '1');
INSERT INTO `sys_menu` VALUES ('14', '1', '日志管理', 'log', 'system/log/list', '1', '1', '98', '2', '2016-01-03 18:09:18', '1');
INSERT INTO `sys_menu` VALUES ('15', '19', '意见反馈', 'advicefeedback', 'admin/advicefeedback/list', '1', '1', '22', '2', '2016-01-29 01:06:46', '1');
INSERT INTO `sys_menu` VALUES ('16', '18', '栏目公告', 'foldernotice', 'admin/foldernotice/list', '1', '1', '12', '2', '2016-01-29 01:07:35', '1');
Expand All @@ -196,7 +196,7 @@ INSERT INTO `sys_menu` VALUES ('27', '22', '视频管理', 'video', 'admin/video
INSERT INTO `sys_menu` VALUES ('28', '0', '模板管理', 'filemanager', 'admin/filemanager/list', '1', '1', '60', '1', '2016-03-06 09:36:36', '1');
INSERT INTO `sys_menu` VALUES ('29', '18', '文章审核', 'article_approve', 'admin/article/list_approve', '1', '1', '15', '2', '2016-03-16 00:21:12', '1');
INSERT INTO `sys_menu` VALUES ('30', '20', '站点管理', 'site', 'admin/site/list', '1', '1', '31', '2', '2016-04-02 22:26:33', '1');

INSERT INTO `sys_menu` VALUES ('31', '1', '参数配置', 'config', 'system/config', '1', '1', '97', '2', '2016-12-17 23:34:13', '1');
-- ----------------------------
-- Table structure for `sys_role`
-- ----------------------------
Expand Down Expand Up @@ -1412,3 +1412,33 @@ CREATE TABLE `tb_video_tags` (
-- ----------------------------
-- Records of tb_video_tags
-- ----------------------------

-- ----------------------------
-- Table structure for `sys_config`
-- ----------------------------
DROP TABLE IF EXISTS `sys_config`;
CREATE TABLE `sys_config` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(32) NOT NULL COMMENT '名称',
`key` varchar(64) NOT NULL COMMENT '键',
`value` varchar(1000) NOT NULL COMMENT '值',
`code` varchar(64) DEFAULT NULL COMMENT '编码',
`type` int(11) NOT NULL DEFAULT '0' COMMENT '类型',
`sort` int(11) NOT NULL DEFAULT '10' COMMENT '排序号',
`update_time` varchar(64) DEFAULT NULL COMMENT '更新时间',
`update_id` int(11) DEFAULT '0' COMMENT '更新人',
`create_time` varchar(64) DEFAULT NULL COMMENT '创建时间',
`create_id` int(11) DEFAULT '0' COMMENT '创建者',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='系统配置表';

-- ----------------------------
-- Records of sys_config
-- ----------------------------
INSERT INTO `sys_config` VALUES ('1', '系统参数', 'systemParam', '0', null, '0', '10', '2016-12-17 22:32:35', '1', '2016-12-17 22:32:35', '1');
INSERT INTO `sys_config` VALUES ('2', 'API参数', 'apiParam', '0', null, '0', '11', '2016-12-17 22:33:41', '1', '2016-12-17 22:33:41', '1');
INSERT INTO `sys_config` VALUES ('4', '版权', 'copyright', '©FLY的狐狸 版权所有', null, '1', '10', '2016-12-17 23:07:21', '1', '2016-12-17 23:07:21', '1');
INSERT INTO `sys_config` VALUES ('5', 'API是否开启', 'API.FLAG', 'true', null, '2', '110', '2016-12-17 23:12:26', '1', '2016-12-17 23:12:26', '1');
INSERT INTO `sys_config` VALUES ('6', 'ip黑名单,逗号分隔', 'API.IP.BLACK', '127.0.0.122,localhost22', null, '2', '111', '2016-12-17 23:16:29', '1', '2016-12-17 23:16:29', '1');
INSERT INTO `sys_config` VALUES ('7', '支持的版本,逗号分隔', 'API.VERSIONS', '1.0.0,1.0.1', null, '2', '112', '2016-12-17 23:17:00', '1', '2016-12-17 23:17:00', '1');
INSERT INTO `sys_config` VALUES ('8', '登陆验证是否开启', 'API.LOGIN.VALID', 'false', null, '2', '114', '2016-12-17 23:17:23', '1', '2016-12-17 23:17:23', '1');
21 changes: 16 additions & 5 deletions src/main/java/com/jflyfox/api/constant/ApiConstant.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ public class ApiConstant {
*/
public static final int CODE_VERSION_ERROR = -101;
/**
* 方法调用错误
* 调用方法不存在
*/
public static final int CODE_METHOD_ERROR = -103;
/**
* 调用方法异常
*/
public static final int CODE_METHOD_HANDLER_ERROR = -103;
/**
* 传递参数异常
*/
Expand All @@ -30,12 +34,19 @@ public class ApiConstant {
* IP黑名单
*/
public static final int CODE_IP_BLACK = -201;


/**
* 登陆验证异常
*/
public static final int CODE_LOGIN_VALID_ERROR = -501;

public static final String MSG_SUCCESS = "success";
public static final String MSG_FAIL = "fail";
public static final String MSG_VERSION_ERROR = "版本号错误";
public static final String MSG_METHOD_ERROR = "方法调用错误";
public static final String MSG_METHOD_ERROR = "调用方法不存在";
public static final String MSG_METHOD_HANDLER_ERROR = "调用方法异常";
public static final String MSG_PARAM_ERROR = "传递参数异常";
public static final String MSG_IP_BLACK = "传递参数异常";
public static final String MSG_SERVER_MAINTAIN = "API服务维护中";
public static final String MSG_IP_BLACK = "IP黑名单拦截";
public static final String MSG_SERVER_MAINTAIN = "API服务维护中";
public static final String MSG_LOGIN_VALID_ERROR = "登陆验证失败";
}
Loading

0 comments on commit 94705ea

Please sign in to comment.