Mark 6 年之前
父节点
当前提交
5021492e57

+ 1 - 0
README.md

@ -1,5 +1,6 @@
1 1
**项目说明** 
2 2
- renren-fast是一个轻量级的,前后端分离的Java快速开发平台,能快速开发项目并交付【接私活利器】
3
- 支持MySQL、Oracle、SQL Server、PostgreSQL等主流数据库
3 4
- 前端地址:https://github.com/daxiongYang/renren-fast-vue
4 5
<br> 
5 6
<br>

+ 195 - 2
db/mssql.sql

@ -1,6 +1,198 @@
1
2
1
-- 菜单
2
CREATE TABLE sys_menu (
3
  menu_id bigint NOT NULL IDENTITY(1,1),
4
  parent_id bigint,
5
  name varchar(50),
6
  url varchar(200),
7
  perms varchar(500),
8
  type int,
9
  icon varchar(50),
10
  order_num int,
11
  PRIMARY KEY (menu_id)
12
);
13
14
-- 系统用户
15
CREATE TABLE sys_user (
16
  user_id bigint NOT NULL IDENTITY(1,1),
17
  username varchar(50) NOT NULL,
18
  password varchar(100),
19
  salt varchar(20),
20
  email varchar(100),
21
  mobile varchar(100),
22
  status tinyint,
23
  create_user_id bigint,
24
  create_time datetime,
25
  PRIMARY KEY (user_id),
26
  UNIQUE (username)
27
);
28
29
-- 系统用户Token
30
CREATE TABLE sys_user_token (
31
  user_id bigint NOT NULL IDENTITY(1,1),
32
  token varchar(100) NOT NULL,
33
  expire_time datetime,
34
  update_time datetime,
35
  PRIMARY KEY (user_id),
36
  UNIQUE (token)
37
);
38
39
-- 系统验证码
40
CREATE TABLE sys_captcha (
41
  uuid varchar(36) NOT NULL,
42
  code varchar(6) NOT NULL,
43
  expire_time datetime,
44
  PRIMARY KEY (uuid)
45
);
46
47
-- 角色
48
CREATE TABLE sys_role (
49
  role_id bigint NOT NULL IDENTITY(1,1),
50
  role_name varchar(100),
51
  remark varchar(100),
52
  create_user_id bigint,
53
  create_time datetime,
54
PRIMARY KEY (role_id)
55
);
56
57
-- 用户与角色对应关系
58
CREATE TABLE sys_user_role (
59
  id bigint NOT NULL IDENTITY(1,1),
60
  user_id bigint,
61
  role_id bigint,
62
PRIMARY KEY (id)
63
);
64
65
-- 角色与菜单对应关系
66
CREATE TABLE sys_role_menu (
67
  id bigint NOT NULL IDENTITY(1,1),
68
  role_id bigint,
69
  menu_id bigint,
70
PRIMARY KEY (id)
71
);
72
73
-- 系统配置信息
74
CREATE TABLE sys_config (
75
  id bigint NOT NULL IDENTITY(1,1),
76
  param_key varchar(50),
77
  param_value varchar(2000),
78
  status tinyint DEFAULT 1,
79
  remark varchar(500),
80
  PRIMARY KEY (id),
81
  UNIQUE (param_key)
82
);
83
84
-- 系统日志
85
CREATE TABLE sys_log (
86
  id bigint NOT NULL IDENTITY(1,1),
87
  username varchar(50),
88
  operation varchar(50),
89
  method varchar(200),
90
  params varchar(5000),
91
  time bigint NOT NULL,
92
  ip varchar(64),
93
  create_date datetime,
94
PRIMARY KEY (id)
95
);
96
97
-- 文件上传
98
CREATE TABLE sys_oss (
99
  id bigint NOT NULL IDENTITY(1,1),
100
  url varchar(200),
101
  create_date datetime,
102
  PRIMARY KEY (id)
103
);
104
105
-- 定时任务
106
CREATE TABLE schedule_job (
107
  job_id bigint NOT NULL IDENTITY(1,1),
108
  bean_name varchar(200),
109
  method_name varchar(100),
110
  params varchar(2000),
111
  cron_expression varchar(100),
112
  status tinyint,
113
  remark varchar(255),
114
  create_time datetime,
115
  PRIMARY KEY (job_id)
116
);
117
118
-- 定时任务日志
119
CREATE TABLE schedule_job_log (
120
  log_id bigint NOT NULL IDENTITY(1,1),
121
  job_id bigint NOT NULL,
122
  bean_name varchar(200),
123
  method_name varchar(100),
124
  params varchar(2000),
125
  status tinyint NOT NULL,
126
  error varchar(2000),
127
  times int NOT NULL,
128
  create_time datetime,
129
  PRIMARY KEY (log_id),
130
  INDEX job_id (job_id)
131
);
132
133
-- 用户表
134
CREATE TABLE tb_user (
135
  user_id bigint NOT NULL IDENTITY(1,1),
136
  username varchar(50) NOT NULL,
137
  mobile varchar(20) NOT NULL,
138
  password varchar(64),
139
  create_time datetime,
140
  PRIMARY KEY (user_id),
141
  UNIQUE (username)
142
);
143
144
SET IDENTITY_INSERT sys_user ON;
145
INSERT INTO sys_user (user_id, username, password, salt, email, mobile, status, create_user_id, create_time) VALUES ('1', 'admin', '9ec9750e709431dad22365cabc5c625482e574c74adaebba7dd02f1129e4ce1d', 'YzcmCZNvbXocrsz9dm8e', 'root@renren.io', '13612345678', '1', '1', '2016-11-11 11:11:11');
146
SET IDENTITY_INSERT sys_user OFF;
147
148
SET IDENTITY_INSERT sys_menu ON;
149
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (1, 0, '系统管理', NULL, NULL, 0, 'system', 0);
150
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (2, 1, '管理员列表', 'sys/user', NULL, 1, 'admin', 1);
151
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (3, 1, '角色管理', 'sys/role', NULL, 1, 'role', 2);
152
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (4, 1, '菜单管理', 'sys/menu', NULL, 1, 'menu', 3);
153
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (5, 1, 'SQL监控', 'http://localhost:8080/renren-fast/druid/sql.html', NULL, 1, 'sql', 4);
154
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (6, 1, '定时任务', 'job/schedule', NULL, 1, 'job', 5);
155
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (7, 6, '查看', NULL, 'sys:schedule:list,sys:schedule:info', 2, NULL, 0);
156
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (8, 6, '新增', NULL, 'sys:schedule:save', 2, NULL, 0);
157
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (9, 6, '修改', NULL, 'sys:schedule:update', 2, NULL, 0);
158
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (10, 6, '删除', NULL, 'sys:schedule:delete', 2, NULL, 0);
159
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (11, 6, '暂停', NULL, 'sys:schedule:pause', 2, NULL, 0);
160
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (12, 6, '恢复', NULL, 'sys:schedule:resume', 2, NULL, 0);
161
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (13, 6, '立即执行', NULL, 'sys:schedule:run', 2, NULL, 0);
162
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (14, 6, '日志列表', NULL, 'sys:schedule:log', 2, NULL, 0);
163
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (15, 2, '查看', NULL, 'sys:user:list,sys:user:info', 2, NULL, 0);
164
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (16, 2, '新增', NULL, 'sys:user:save,sys:role:select', 2, NULL, 0);
165
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (17, 2, '修改', NULL, 'sys:user:update,sys:role:select', 2, NULL, 0);
166
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (18, 2, '删除', NULL, 'sys:user:delete', 2, NULL, 0);
167
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (19, 3, '查看', NULL, 'sys:role:list,sys:role:info', 2, NULL, 0);
168
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (20, 3, '新增', NULL, 'sys:role:save,sys:menu:list', 2, NULL, 0);
169
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (21, 3, '修改', NULL, 'sys:role:update,sys:menu:list', 2, NULL, 0);
170
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (22, 3, '删除', NULL, 'sys:role:delete', 2, NULL, 0);
171
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (23, 4, '查看', NULL, 'sys:menu:list,sys:menu:info', 2, NULL, 0);
172
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (24, 4, '新增', NULL, 'sys:menu:save,sys:menu:select', 2, NULL, 0);
173
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (25, 4, '修改', NULL, 'sys:menu:update,sys:menu:select', 2, NULL, 0);
174
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (26, 4, '删除', NULL, 'sys:menu:delete', 2, NULL, 0);
175
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (27, 1, '参数管理', 'sys/config', 'sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete', 1, 'config', 6);
176
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (29, 1, '系统日志', 'sys/log', 'sys:log:list', 1, 'log', 7);
177
INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (30, 1, '文件上传', 'oss/oss', 'sys:oss:all', 1, 'oss', 6);
178
179
SET IDENTITY_INSERT sys_menu OFF;
180
181
182
INSERT INTO sys_config (param_key, param_value, status, remark) VALUES ('CLOUD_STORAGE_CONFIG_KEY',  '{"aliyunAccessKeyId":"","aliyunAccessKeySecret":"","aliyunBucketName":"","aliyunDomain":"","aliyunEndPoint":"","aliyunPrefix":"","qcloudBucketName":"","qcloudDomain":"","qcloudPrefix":"","qcloudSecretId":"","qcloudSecretKey":"","qiniuAccessKey":"NrgMfABZxWLo5B-YYSjoE8-AZ1EISdi1Z3ubLOeZ","qiniuBucketName":"ios-app","qiniuDomain":"http://7xlij2.com1.z0.glb.clouddn.com","qiniuPrefix":"upload","qiniuSecretKey":"uIwJHevMRWU0VLxFvgy0tAcOdGqasdtVlJkdy6vV","type":1}', '0', '云存储配置信息');
183
184
INSERT INTO schedule_job (bean_name, method_name, params, cron_expression, status, remark, create_time) VALUES ('testTask', 'test', 'renren', '0 0/30 * * * ?', '0', '有参数测试', '2016-12-01 23:16:46');
185
INSERT INTO schedule_job (bean_name, method_name, params, cron_expression, status, remark, create_time) VALUES ('testTask', 'test2', NULL, '0 0/30 * * * ?', '1', '无参数测试', '2016-12-03 14:55:56');
186
187
188
-- 账号:13612345678  密码:admin
189
INSERT INTO tb_user (username, mobile, password, create_time) VALUES ('mark', '13612345678', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', '2017-03-23 22:37:41');
190
191
192
193
194
195
--  quartz自带表结构
3 196
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1)
4 197
  ALTER TABLE [dbo].[QRTZ_TRIGGERS] DROP CONSTRAINT FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS
5 198
GO

+ 4 - 0
db/oracle.sql

@ -1,8 +1,11 @@
1 1
2 2
3 3
4 4
5
6
7
8
--  quartz自带表结构
5 9
delete from qrtz_fired_triggers;
6 10
delete from qrtz_simple_triggers;
7 11
delete from qrtz_simprop_triggers;

+ 4 - 0
db/postgresql.sql

@ -1,7 +1,10 @@
1 1
2 2
3 3
4
5
6
7
--  quartz自带表结构
4 8
drop table qrtz_fired_triggers;
5 9
DROP TABLE QRTZ_PAUSED_TRIGGER_GRPS;
6 10
DROP TABLE QRTZ_SCHEDULER_STATE;

+ 20 - 1
pom.xml

@ -4,7 +4,7 @@
4 4
	<modelVersion>4.0.0</modelVersion>
5 5
	<groupId>io.renren</groupId>
6 6
	<artifactId>renren-fast</artifactId>
7
	<version>2.0.0</version>
7
	<version>2.1.0</version>
8 8
	<packaging>jar</packaging>
9 9
	<description>renren-fast</description>
10 10
@ -21,6 +21,8 @@
21 21
		<mybatisplus.spring.boot.version>1.0.5</mybatisplus.spring.boot.version>
22 22
		<mybatisplus.version>2.1.9</mybatisplus.version>
23 23
		<mysql.version>5.1.38</mysql.version>
24
		<mssql.version>4.0</mssql.version>
25
		<oracle.version>11.2.0.3</oracle.version>
24 26
		<druid.version>1.1.9</druid.version>
25 27
		<quartz.version>2.3.0</quartz.version>
26 28
		<commons.lang.version>2.6</commons.lang.version>
@ -97,6 +99,23 @@
97 99
			<groupId>mysql</groupId>
98 100
			<artifactId>mysql-connector-java</artifactId>
99 101
			<version>${mysql.version}</version>
102
		</dependency>
103
		 <!--oracle驱动-->
104
		<dependency>
105
		<groupId>com.oracle</groupId>
106
		<artifactId>ojdbc6</artifactId>
107
		<version>${oracle.version}</version>
108
		</dependency>
109
		 <!--mssql驱动-->
110
		<dependency>
111
		<groupId>com.microsoft.sqlserver</groupId>
112
		<artifactId>sqljdbc4</artifactId>
113
		<version>${mssql.version}</version>
114
		</dependency>
115
		 <!--postgresql驱动-->
116
		<dependency>
117
		<groupId>org.postgresql</groupId>
118
		<artifactId>postgresql</artifactId>
100 119
		</dependency>
101 120
		<dependency>
102 121
			<groupId>com.alibaba</groupId>

+ 7 - 0
src/main/java/io/renren/common/exception/RRExceptionHandler.java

@ -7,6 +7,7 @@ import org.slf4j.LoggerFactory;
7 7
import org.springframework.dao.DuplicateKeyException;
8 8
import org.springframework.web.bind.annotation.ExceptionHandler;
9 9
import org.springframework.web.bind.annotation.RestControllerAdvice;
10
import org.springframework.web.servlet.NoHandlerFoundException;
10 11
11 12
/**
12 13
 * 异常处理器
@ -31,6 +32,12 @@ public class RRExceptionHandler {
31 32
		return r;
32 33
	}
33 34
35
	@ExceptionHandler(NoHandlerFoundException.class)
36
	public R handlerNoFoundException(Exception e) {
37
		logger.error(e.getMessage(), e);
38
		return R.error(404, "路径不存在,请检查路径是否正确");
39
	}
40
34 41
	@ExceptionHandler(DuplicateKeyException.class)
35 42
	public R handleDuplicateKeyException(DuplicateKeyException e){
36 43
		logger.error(e.getMessage(), e);

+ 2 - 2
src/main/java/io/renren/modules/app/config/WebMvcConfig.java

@ -6,7 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
6 6
import org.springframework.context.annotation.Configuration;
7 7
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
8 8
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
9
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
9
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
10 10
11 11
import java.util.List;
12 12
@ -18,7 +18,7 @@ import java.util.List;
18 18
 * @date 2017-04-20 22:30
19 19
 */
20 20
@Configuration
21
public class WebMvcConfig extends WebMvcConfigurerAdapter {
21
public class WebMvcConfig implements WebMvcConfigurer {
22 22
    @Autowired
23 23
    private AuthorizationInterceptor authorizationInterceptor;
24 24
    @Autowired

+ 4 - 0
src/main/java/io/renren/modules/job/config/ScheduleConfig.java

@ -55,6 +55,10 @@ public class ScheduleConfig {
55 55
        prop.put("org.quartz.jobStore.misfireThreshold", "12000");
56 56
        prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_");
57 57
        prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?");
58
59
        //PostgreSQL数据库,需要打开此注释
60
        //prop.put("org.quartz.jobStore.driverDelegateClass", "org.quartz.impl.jdbcjobstore.PostgreSQLDelegate");
61
58 62
        factory.setQuartzProperties(prop);
59 63
60 64
        factory.setSchedulerName("RenrenScheduler");

+ 1 - 1
src/main/java/io/renren/modules/sys/dao/SysConfigDao.java

@ -40,6 +40,6 @@ public interface SysConfigDao extends BaseMapper<SysConfigEntity> {
40 40
	/**
41 41
	 * 根据key,更新value
42 42
	 */
43
	int updateValueByKey(@Param("key") String key, @Param("value") String value);
43
	int updateValueByKey(@Param("paramKey") String paramKey, @Param("paramValue") String paramValue);
44 44
	
45 45
}

+ 18 - 12
src/main/java/io/renren/modules/sys/entity/SysConfigEntity.java

@ -18,7 +18,8 @@ package io.renren.modules.sys.entity;
18 18
19 19
import com.baomidou.mybatisplus.annotations.TableId;
20 20
import com.baomidou.mybatisplus.annotations.TableName;
21
import org.hibernate.validator.constraints.NotBlank;
21
22
import javax.validation.constraints.NotBlank;
22 23
23 24
/**
24 25
 * 系统配置信息
@ -32,29 +33,34 @@ public class SysConfigEntity {
32 33
	@TableId
33 34
	private Long id;
34 35
	@NotBlank(message="参数名不能为空")
35
	private String key;
36
	private String paramKey;
36 37
	@NotBlank(message="参数值不能为空")
37
	private String value; 
38
	private String paramValue;
38 39
	private String remark;
39
	
40
40 41
	public Long getId() {
41 42
		return id;
42 43
	}
43 44
	public void setId(Long id) {
44 45
		this.id = id;
45 46
	}
46
	public String getKey() {
47
		return key;
47
48
	public String getParamKey() {
49
		return paramKey;
48 50
	}
49
	public void setKey(String key) {
50
		this.key = key;
51
52
	public void setParamKey(String paramKey) {
53
		this.paramKey = paramKey;
51 54
	}
52
	public String getValue() {
53
		return value;
55
56
	public String getParamValue() {
57
		return paramValue;
54 58
	}
55
	public void setValue(String value) {
56
		this.value = value;
59
60
	public void setParamValue(String paramValue) {
61
		this.paramValue = paramValue;
57 62
	}
63
58 64
	public String getRemark() {
59 65
		return remark;
60 66
	}

+ 18 - 1
src/main/java/io/renren/modules/sys/redis/SysConfigRedis.java

@ -1,5 +1,22 @@
1
/**
2
 * Copyright 2018 人人开源 http://www.renren.io
3
 * <p>
4
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5
 * use this file except in compliance with the License. You may obtain a copy of
6
 * the License at
7
 * <p>
8
 * http://www.apache.org/licenses/LICENSE-2.0
9
 * <p>
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
 * License for the specific language governing permissions and limitations under
14
 * the License.
15
 */
16
1 17
package io.renren.modules.sys.redis;
2 18
19
3 20
import io.renren.common.utils.RedisKeys;
4 21
import io.renren.common.utils.RedisUtils;
5 22
import io.renren.modules.sys.entity.SysConfigEntity;
@ -22,7 +39,7 @@ public class SysConfigRedis {
22 39
        if(config == null){
23 40
            return ;
24 41
        }
25
        String key = RedisKeys.getSysConfigKey(config.getKey());
42
        String key = RedisKeys.getSysConfigKey(config.getParamKey());
26 43
        redisUtils.set(key, config);
27 44
    }
28 45

+ 5 - 5
src/main/java/io/renren/modules/sys/service/impl/SysConfigServiceImpl.java

@ -42,12 +42,12 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigDao, SysConfigEnt
42 42
43 43
	@Override
44 44
	public PageUtils queryPage(Map<String, Object> params) {
45
		String key = (String)params.get("key");
45
		String paramKey = (String)params.get("paramKey");
46 46
47 47
		Page<SysConfigEntity> page = this.selectPage(
48 48
				new Query<SysConfigEntity>(params).getPage(),
49 49
				new EntityWrapper<SysConfigEntity>()
50
					.like(StringUtils.isNotBlank(key),"key", key)
50
					.like(StringUtils.isNotBlank(paramKey),"param_key", paramKey)
51 51
					.eq("status", 1)
52 52
		);
53 53
@ -63,7 +63,7 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigDao, SysConfigEnt
63 63
	@Override
64 64
	@Transactional(rollbackFor = Exception.class)
65 65
	public void update(SysConfigEntity config) {
66
		this.updateById(config);
66
		this.updateAllColumnById(config);
67 67
		sysConfigRedis.saveOrUpdate(config);
68 68
	}
69 69
@ -79,7 +79,7 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigDao, SysConfigEnt
79 79
	public void deleteBatch(Long[] ids) {
80 80
		for(Long id : ids){
81 81
			SysConfigEntity config = this.selectById(id);
82
			sysConfigRedis.delete(config.getKey());
82
			sysConfigRedis.delete(config.getParamKey());
83 83
		}
84 84
85 85
		this.deleteBatchIds(Arrays.asList(ids));
@ -93,7 +93,7 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigDao, SysConfigEnt
93 93
			sysConfigRedis.saveOrUpdate(config);
94 94
		}
95 95
96
		return config == null ? null : config.getValue();
96
		return config == null ? null : config.getParamValue();
97 97
	}
98 98
	
99 99
	@Override

+ 1 - 1
src/main/java/io/renren/modules/sys/service/impl/SysRoleServiceImpl.java

@ -70,7 +70,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> i
70 70
    @Override
71 71
    @Transactional(rollbackFor = Exception.class)
72 72
    public void update(SysRoleEntity role) {
73
        this.updateById(role);
73
        this.updateAllColumnById(role);
74 74
75 75
        //检查权限是否越权
76 76
        checkPrems(role);

+ 8 - 5
src/main/resources/application.yml

@ -4,8 +4,8 @@ server:
4 4
        uri-encoding: UTF-8
5 5
        max-threads: 1000
6 6
        min-spare-threads: 30
7
    port: 8082
8
    connection-timeout: 5000
7
    port: 8080
8
    connection-timeout: 5000ms
9 9
    servlet:
10 10
      context-path: /renren-fast
11 11
@ -29,14 +29,17 @@ spring:
29 29
        host: localhost
30 30
        port: 6379
31 31
        password:   Nannan2017JK    # 密码(默认为空)
32
        timeout: 6000  # 连接超时时长(毫秒)
32
        timeout: 6000ms  # 连接超时时长(毫秒)
33 33
        jedis:
34 34
          pool:
35 35
              max-active: 1000  # 连接池最大连接数(使用负值表示没有限制)
36
              max-wait: -1      # 连接池最大阻塞等待时间(使用负值表示没有限制)
36
              max-wait: -1ms      # 连接池最大阻塞等待时间(使用负值表示没有限制)
37 37
              max-idle: 10      # 连接池中的最大空闲连接
38 38
              min-idle: 5       # 连接池中的最小空闲连接
39
39
    mvc:
40
        throw-exception-if-no-handler-found: true
41
    resources:
42
        add-mappings: false
40 43
41 44
#mybatis
42 45
mybatis-plus:

+ 5 - 5
src/main/resources/mapper/sys/SysConfigDao.xml

@ -1,15 +1,15 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
1
<?xml version="1.0" encoding="UTF-8"?>  
2
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">    
3 3
<mapper namespace="io.renren.modules.sys.dao.SysConfigDao">
4 4
5 5
	<!-- 根据key,更新value -->
6 6
	<update id="updateValueByKey" parameterType="map">
7
		update sys_config set `value` = #{value} where `key` = #{key}
7
		update sys_config set param_value = #{paramValue} where param_key = #{paramKey}
8 8
	</update>
9 9
10 10
	<!-- 根据key,查询value -->
11 11
	<select id="queryByKey" parameterType="string" resultType="io.renren.modules.sys.entity.SysConfigEntity">
12
		select * from sys_config where `key` = #{key}
12
		select * from sys_config where param_key = #{paramKey}
13 13
	</select>
14
14
	
15 15
</mapper>