param = new HashMap<>(16);
- param.put(SecureUtil.USER_ID, Func.toStr(user.getId()));
- param.put(SecureUtil.ROLE_ID, user.getRoleId());
- param.put(SecureUtil.TENANT_CODE, user.getTenantCode());
- param.put(SecureUtil.ACCOUNT, user.getAccount());
- param.put(SecureUtil.USER_NAME, user.getRealName());
- param.put(SecureUtil.ROLE_NAME, Func.join(res.getData().getRoles()));
+ param.put(TokenConstant.USER_ID, Func.toStr(user.getId()));
+ param.put(TokenConstant.ROLE_ID, user.getRoleId());
+ param.put(TokenConstant.TENANT_CODE, user.getTenantCode());
+ param.put(TokenConstant.ACCOUNT, user.getAccount());
+ param.put(TokenConstant.USER_NAME, user.getRealName());
+ param.put(TokenConstant.ROLE_NAME, Func.join(res.getData().getRoles()));
//拼装accessToken
String accessToken = SecureUtil.createJWT(param, "audience", "issuser", true);
@@ -83,7 +84,7 @@ public class AuthController {
authInfo.setUserName(user.getRealName());
authInfo.setAuthority(Func.join(res.getData().getRoles()));
authInfo.setAccessToken(accessToken);
- authInfo.setTokenType(SecureUtil.BEARER);
+ authInfo.setTokenType(TokenConstant.BEARER);
//设置token过期时间
authInfo.setExpiresIn(SecureUtil.getExpire());
return R.data(authInfo);
diff --git a/blade-auth/src/main/resources/application-dev.yml b/blade-auth/src/main/resources/application-dev.yml
new file mode 100644
index 0000000..883acb7
--- /dev/null
+++ b/blade-auth/src/main/resources/application-dev.yml
@@ -0,0 +1,11 @@
+#服务器端口
+server:
+ port: 8100
+
+#数据源配置
+spring:
+ datasource:
+ driver-class-name: com.mysql.jdbc.Driver
+ url: ${blade.datasource.dev.url}
+ username: ${blade.datasource.dev.username}
+ password: ${blade.datasource.dev.password}
diff --git a/blade-auth/src/main/resources/application-prod.yml b/blade-auth/src/main/resources/application-prod.yml
new file mode 100644
index 0000000..70bf2f4
--- /dev/null
+++ b/blade-auth/src/main/resources/application-prod.yml
@@ -0,0 +1,11 @@
+#服务器端口
+server:
+ port: 8100
+
+#数据源配置
+spring:
+ datasource:
+ driver-class-name: com.mysql.jdbc.Driver
+ url: ${blade.datasource.prod.url}
+ username: ${blade.datasource.prod.username}
+ password: ${blade.datasource.prod.password}
diff --git a/blade-auth/src/main/resources/application-test.yml b/blade-auth/src/main/resources/application-test.yml
new file mode 100644
index 0000000..2255872
--- /dev/null
+++ b/blade-auth/src/main/resources/application-test.yml
@@ -0,0 +1,11 @@
+#服务器端口
+server:
+ port: 8100
+
+#数据源配置
+spring:
+ datasource:
+ driver-class-name: com.mysql.jdbc.Driver
+ url: ${blade.datasource.test.url}
+ username: ${blade.datasource.test.username}
+ password: ${blade.datasource.test.password}
diff --git a/blade-auth/src/main/resources/bootstrap.yml b/blade-auth/src/main/resources/bootstrap.yml
deleted file mode 100644
index 64cec20..0000000
--- a/blade-auth/src/main/resources/bootstrap.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-server:
- port: 8100
diff --git a/blade-common/pom.xml b/blade-common/pom.xml
index c0e4754..e4b5955 100644
--- a/blade-common/pom.xml
+++ b/blade-common/pom.xml
@@ -5,7 +5,7 @@
SpringBlade
org.springblade
- 2.1.0
+ 2.2.0
4.0.0
diff --git a/blade-common/src/main/java/org/springblade/common/constant/CommonConstant.java b/blade-common/src/main/java/org/springblade/common/constant/CommonConstant.java
index 6a0d9d6..ed5782d 100644
--- a/blade-common/src/main/java/org/springblade/common/constant/CommonConstant.java
+++ b/blade-common/src/main/java/org/springblade/common/constant/CommonConstant.java
@@ -15,7 +15,7 @@ public interface CommonConstant {
/**
* nacos prod 地址
*/
- String NACOS_PROD_ADDR = "192.168.186.129:8848";
+ String NACOS_PROD_ADDR = "172.30.0.48:8848";
/**
* sentinel dev 地址
@@ -25,7 +25,7 @@ public interface CommonConstant {
/**
* sentinel prod 地址
*/
- String SENTINEL_PROD_ADDR = "192.168.186.129:8858";
+ String SENTINEL_PROD_ADDR = "172.30.0.58:8858";
/**
* sword 系统名
diff --git a/blade-gateway/pom.xml b/blade-gateway/pom.xml
index 190e197..bf9d62b 100644
--- a/blade-gateway/pom.xml
+++ b/blade-gateway/pom.xml
@@ -5,7 +5,7 @@
SpringBlade
org.springblade
- 2.1.0
+ 2.2.0
4.0.0
diff --git a/blade-ops/blade-admin/pom.xml b/blade-ops/blade-admin/pom.xml
index 5366747..c72e77e 100644
--- a/blade-ops/blade-admin/pom.xml
+++ b/blade-ops/blade-admin/pom.xml
@@ -5,7 +5,7 @@
blade-ops
org.springblade
- 2.1.0
+ 2.2.0
4.0.0
diff --git a/blade-ops/blade-develop/pom.xml b/blade-ops/blade-develop/pom.xml
index 9e4bfd9..5d379c3 100644
--- a/blade-ops/blade-develop/pom.xml
+++ b/blade-ops/blade-develop/pom.xml
@@ -6,7 +6,7 @@
org.springblade
blade-ops
- 2.1.0
+ 2.2.0
4.0.0
diff --git a/blade-ops/blade-develop/src/main/resources/templates/props/generator.properties b/blade-ops/blade-develop/src/main/resources/templates/props/generator.properties
index 229dc31..48fb198 100644
--- a/blade-ops/blade-develop/src/main/resources/templates/props/generator.properties
+++ b/blade-ops/blade-develop/src/main/resources/templates/props/generator.properties
@@ -1,4 +1,4 @@
-spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
+spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/blade?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&serverTimezone=GMT%2B8
spring.datasource.username=root
spring.datasource.password=root
diff --git a/blade-ops/blade-develop/src/main/resources/templates/sql/menu.sql.vm b/blade-ops/blade-develop/src/main/resources/templates/sql/menu.sql.vm
index 753a969..01866c8 100644
--- a/blade-ops/blade-develop/src/main/resources/templates/sql/menu.sql.vm
+++ b/blade-ops/blade-develop/src/main/resources/templates/sql/menu.sql.vm
@@ -1,11 +1,11 @@
-INSERT INTO `blade_menu`(`tenant_code`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
-VALUES ('000000', 0, '$!{cfg.entityKey}', '$!{cfg.codeName}', 'menu', '/$!{cfg.servicePackage}/$!{cfg.entityKey}', NULL, 1, 1, 0, 1, NULL, 0);
+INSERT INTO `blade_menu`(`parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES (0, '$!{cfg.entityKey}', '$!{cfg.codeName}', 'menu', '/$!{cfg.servicePackage}/$!{cfg.entityKey}', NULL, 1, 1, 0, 1, NULL, 0);
set @parentid = (SELECT LAST_INSERT_ID());
-INSERT INTO `blade_menu`(`tenant_code`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
-VALUES ('000000', @parentid, '$!{cfg.entityKey}_add', '新增', 'add', '/$!{cfg.servicePackage}/$!{cfg.entityKey}/add', 'plus', 1, 2, 1, 1, NULL, 0);
-INSERT INTO `blade_menu`(`tenant_code`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
-VALUES ('000000', @parentid, '$!{cfg.entityKey}_edit', '修改', 'edit', '/$!{cfg.servicePackage}/$!{cfg.entityKey}/edit', 'form', 2, 2, 1, 2, NULL, 0);
-INSERT INTO `blade_menu`(`tenant_code`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
-VALUES ('000000', @parentid, '$!{cfg.entityKey}_delete', '删除', 'delete', '/api/$!{cfg.serviceName}/$!{cfg.entityKey}/remove', 'delete', 3, 2, 1, 3, NULL, 0);
-INSERT INTO `blade_menu`(`tenant_code`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
-VALUES ('000000', @parentid, '$!{cfg.entityKey}_view', '查看', 'view', '/$!{cfg.servicePackage}/$!{cfg.entityKey}/view', 'file-text', 4, 2, 1, 2, NULL, 0);
+INSERT INTO `blade_menu`(`parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES (@parentid, '$!{cfg.entityKey}_add', '新增', 'add', '/$!{cfg.servicePackage}/$!{cfg.entityKey}/add', 'plus', 1, 2, 1, 1, NULL, 0);
+INSERT INTO `blade_menu`(`parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES (@parentid, '$!{cfg.entityKey}_edit', '修改', 'edit', '/$!{cfg.servicePackage}/$!{cfg.entityKey}/edit', 'form', 2, 2, 1, 2, NULL, 0);
+INSERT INTO `blade_menu`(`parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES (@parentid, '$!{cfg.entityKey}_delete', '删除', 'delete', '/api/$!{cfg.serviceName}/$!{cfg.entityKey}/remove', 'delete', 3, 2, 1, 3, NULL, 0);
+INSERT INTO `blade_menu`(`parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES (@parentid, '$!{cfg.entityKey}_view', '查看', 'view', '/$!{cfg.servicePackage}/$!{cfg.entityKey}/view', 'file-text', 4, 2, 1, 2, NULL, 0);
diff --git a/blade-ops/blade-develop/src/test/resources/templates/props/generator.properties b/blade-ops/blade-develop/src/test/resources/templates/props/generator.properties
index 229dc31..48fb198 100644
--- a/blade-ops/blade-develop/src/test/resources/templates/props/generator.properties
+++ b/blade-ops/blade-develop/src/test/resources/templates/props/generator.properties
@@ -1,4 +1,4 @@
-spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
+spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/blade?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&serverTimezone=GMT%2B8
spring.datasource.username=root
spring.datasource.password=root
diff --git a/blade-ops/blade-develop/src/test/resources/templates/sql/menu.sql.vm b/blade-ops/blade-develop/src/test/resources/templates/sql/menu.sql.vm
index 753a969..01866c8 100644
--- a/blade-ops/blade-develop/src/test/resources/templates/sql/menu.sql.vm
+++ b/blade-ops/blade-develop/src/test/resources/templates/sql/menu.sql.vm
@@ -1,11 +1,11 @@
-INSERT INTO `blade_menu`(`tenant_code`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
-VALUES ('000000', 0, '$!{cfg.entityKey}', '$!{cfg.codeName}', 'menu', '/$!{cfg.servicePackage}/$!{cfg.entityKey}', NULL, 1, 1, 0, 1, NULL, 0);
+INSERT INTO `blade_menu`(`parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES (0, '$!{cfg.entityKey}', '$!{cfg.codeName}', 'menu', '/$!{cfg.servicePackage}/$!{cfg.entityKey}', NULL, 1, 1, 0, 1, NULL, 0);
set @parentid = (SELECT LAST_INSERT_ID());
-INSERT INTO `blade_menu`(`tenant_code`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
-VALUES ('000000', @parentid, '$!{cfg.entityKey}_add', '新增', 'add', '/$!{cfg.servicePackage}/$!{cfg.entityKey}/add', 'plus', 1, 2, 1, 1, NULL, 0);
-INSERT INTO `blade_menu`(`tenant_code`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
-VALUES ('000000', @parentid, '$!{cfg.entityKey}_edit', '修改', 'edit', '/$!{cfg.servicePackage}/$!{cfg.entityKey}/edit', 'form', 2, 2, 1, 2, NULL, 0);
-INSERT INTO `blade_menu`(`tenant_code`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
-VALUES ('000000', @parentid, '$!{cfg.entityKey}_delete', '删除', 'delete', '/api/$!{cfg.serviceName}/$!{cfg.entityKey}/remove', 'delete', 3, 2, 1, 3, NULL, 0);
-INSERT INTO `blade_menu`(`tenant_code`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
-VALUES ('000000', @parentid, '$!{cfg.entityKey}_view', '查看', 'view', '/$!{cfg.servicePackage}/$!{cfg.entityKey}/view', 'file-text', 4, 2, 1, 2, NULL, 0);
+INSERT INTO `blade_menu`(`parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES (@parentid, '$!{cfg.entityKey}_add', '新增', 'add', '/$!{cfg.servicePackage}/$!{cfg.entityKey}/add', 'plus', 1, 2, 1, 1, NULL, 0);
+INSERT INTO `blade_menu`(`parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES (@parentid, '$!{cfg.entityKey}_edit', '修改', 'edit', '/$!{cfg.servicePackage}/$!{cfg.entityKey}/edit', 'form', 2, 2, 1, 2, NULL, 0);
+INSERT INTO `blade_menu`(`parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES (@parentid, '$!{cfg.entityKey}_delete', '删除', 'delete', '/api/$!{cfg.serviceName}/$!{cfg.entityKey}/remove', 'delete', 3, 2, 1, 3, NULL, 0);
+INSERT INTO `blade_menu`(`parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES (@parentid, '$!{cfg.entityKey}_view', '查看', 'view', '/$!{cfg.servicePackage}/$!{cfg.entityKey}/view', 'file-text', 4, 2, 1, 2, NULL, 0);
diff --git a/blade-ops/pom.xml b/blade-ops/pom.xml
index 4d523a3..a794479 100644
--- a/blade-ops/pom.xml
+++ b/blade-ops/pom.xml
@@ -5,7 +5,7 @@
SpringBlade
org.springblade
- 2.1.0
+ 2.2.0
4.0.0
diff --git a/blade-service-api/blade-desk-api/pom.xml b/blade-service-api/blade-desk-api/pom.xml
index d5fa13c..30fcc68 100644
--- a/blade-service-api/blade-desk-api/pom.xml
+++ b/blade-service-api/blade-desk-api/pom.xml
@@ -5,7 +5,7 @@
blade-service-api
org.springblade
- 2.1.0
+ 2.2.0
4.0.0
diff --git a/blade-service-api/blade-dict-api/pom.xml b/blade-service-api/blade-dict-api/pom.xml
index 1bd0f2e..29f3cf6 100644
--- a/blade-service-api/blade-dict-api/pom.xml
+++ b/blade-service-api/blade-dict-api/pom.xml
@@ -5,7 +5,7 @@
blade-service-api
org.springblade
- 2.1.0
+ 2.2.0
4.0.0
diff --git a/blade-service-api/blade-system-api/pom.xml b/blade-service-api/blade-system-api/pom.xml
index add7ad5..1f6e07c 100644
--- a/blade-service-api/blade-system-api/pom.xml
+++ b/blade-service-api/blade-system-api/pom.xml
@@ -5,7 +5,7 @@
blade-service-api
org.springblade
- 2.1.0
+ 2.2.0
4.0.0
diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/AuthClient.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/AuthClient.java
new file mode 100644
index 0000000..7f2067e
--- /dev/null
+++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/AuthClient.java
@@ -0,0 +1,96 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.system.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2019-03-24
+ */
+@Data
+@TableName("blade_client")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "Client对象", description = "Client对象")
+public class AuthClient extends BaseEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户端id
+ */
+ @ApiModelProperty(value = "客户端id")
+ private String clientId;
+ /**
+ * 客户端密钥
+ */
+ @ApiModelProperty(value = "客户端密钥")
+ private String clientSecret;
+ /**
+ * 资源集合
+ */
+ @ApiModelProperty(value = "资源集合")
+ private String resourceIds;
+ /**
+ * 授权范围
+ */
+ @ApiModelProperty(value = "授权范围")
+ private String scope;
+ /**
+ * 授权类型
+ */
+ @ApiModelProperty(value = "授权类型")
+ private String authorizedGrantTypes;
+ /**
+ * 回调地址
+ */
+ @ApiModelProperty(value = "回调地址")
+ private String webServerRedirectUri;
+ /**
+ * 权限
+ */
+ @ApiModelProperty(value = "权限")
+ private String authorities;
+ /**
+ * 令牌过期秒数
+ */
+ @ApiModelProperty(value = "令牌过期秒数")
+ private Integer accessTokenValidity;
+ /**
+ * 刷新令牌过期秒数
+ */
+ @ApiModelProperty(value = "刷新令牌过期秒数")
+ private Integer refreshTokenValidity;
+ /**
+ * 附加说明
+ */
+ @ApiModelProperty(value = "附加说明")
+ private String additionalInformation;
+ /**
+ * 自动授权
+ */
+ @ApiModelProperty(value = "自动授权")
+ private String autoapprove;
+
+
+}
diff --git a/blade-service-api/blade-user-api/pom.xml b/blade-service-api/blade-user-api/pom.xml
index 3510cf7..6ae90c3 100644
--- a/blade-service-api/blade-user-api/pom.xml
+++ b/blade-service-api/blade-user-api/pom.xml
@@ -5,7 +5,7 @@
blade-service-api
org.springblade
- 2.1.0
+ 2.2.0
4.0.0
diff --git a/blade-service-api/pom.xml b/blade-service-api/pom.xml
index ad6db60..4d8c499 100644
--- a/blade-service-api/pom.xml
+++ b/blade-service-api/pom.xml
@@ -5,13 +5,13 @@
SpringBlade
org.springblade
- 2.1.0
+ 2.2.0
4.0.0
blade-service-api
${project.artifactId}
- 2.1.0
+ 2.2.0
pom
SpringBlade 微服务API集合
diff --git a/blade-service/blade-desk/pom.xml b/blade-service/blade-desk/pom.xml
index c3e6ae5..6a9c93c 100644
--- a/blade-service/blade-desk/pom.xml
+++ b/blade-service/blade-desk/pom.xml
@@ -6,7 +6,7 @@
org.springblade
blade-service
- 2.1.0
+ 2.2.0
4.0.0
diff --git a/blade-service/blade-log/pom.xml b/blade-service/blade-log/pom.xml
index 29203ef..087734c 100644
--- a/blade-service/blade-log/pom.xml
+++ b/blade-service/blade-log/pom.xml
@@ -5,7 +5,7 @@
blade-service
org.springblade
- 2.1.0
+ 2.2.0
4.0.0
diff --git a/blade-service/blade-system/pom.xml b/blade-service/blade-system/pom.xml
index 81b925d..7cf4e40 100644
--- a/blade-service/blade-system/pom.xml
+++ b/blade-service/blade-system/pom.xml
@@ -5,7 +5,7 @@
blade-service
org.springblade
- 2.1.0
+ 2.2.0
4.0.0
diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/AuthClientController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/AuthClientController.java
new file mode 100644
index 0000000..ff4af68
--- /dev/null
+++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/AuthClientController.java
@@ -0,0 +1,107 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.system.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.system.entity.AuthClient;
+import org.springblade.system.service.IAuthClientService;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.validation.Valid;
+
+/**
+ * 应用管理控制器
+ *
+ * @author Chill
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/client")
+@ApiIgnore
+@Api(value = "应用管理", tags = "接口")
+public class AuthClientController extends BladeController {
+
+ private IAuthClientService clientService;
+
+ /**
+ * 详情
+ */
+ @GetMapping("/detail")
+ @ApiOperation(value = "详情", notes = "传入client", position = 1)
+ public R detail(AuthClient authClient) {
+ AuthClient detail = clientService.getOne(Condition.getQueryWrapper(authClient));
+ return R.data(detail);
+ }
+
+ /**
+ * 分页
+ */
+ @GetMapping("/list")
+ @ApiOperation(value = "分页", notes = "传入client", position = 2)
+ public R> list(AuthClient authClient, Query query) {
+ IPage pages = clientService.page(Condition.getPage(query), Condition.getQueryWrapper(authClient));
+ return R.data(pages);
+ }
+
+ /**
+ * 新增
+ */
+ @PostMapping("/save")
+ @ApiOperation(value = "新增", notes = "传入client", position = 4)
+ public R save(@Valid @RequestBody AuthClient authClient) {
+ return R.status(clientService.save(authClient));
+ }
+
+ /**
+ * 修改
+ */
+ @PostMapping("/update")
+ @ApiOperation(value = "修改", notes = "传入client", position = 5)
+ public R update(@Valid @RequestBody AuthClient authClient) {
+ return R.status(clientService.updateById(authClient));
+ }
+
+ /**
+ * 新增或修改
+ */
+ @PostMapping("/submit")
+ @ApiOperation(value = "新增或修改", notes = "传入client", position = 6)
+ public R submit(@Valid @RequestBody AuthClient authClient) {
+ return R.status(clientService.saveOrUpdate(authClient));
+ }
+
+
+ /**
+ * 删除
+ */
+ @PostMapping("/remove")
+ @ApiOperation(value = "逻辑删除", notes = "传入ids", position = 7)
+ public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+ return R.status(clientService.deleteLogic(Func.toIntList(ids)));
+ }
+
+
+}
diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/AuthClientMapper.java b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/AuthClientMapper.java
new file mode 100644
index 0000000..adcc699
--- /dev/null
+++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/AuthClientMapper.java
@@ -0,0 +1,28 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springblade.system.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springblade.system.entity.AuthClient;
+
+/**
+ * Mapper 接口
+ *
+ * @author Chill
+ */
+public interface AuthClientMapper extends BaseMapper {
+
+}
diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/AuthClientMapper.xml b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/AuthClientMapper.xml
new file mode 100644
index 0000000..bf617a7
--- /dev/null
+++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/AuthClientMapper.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DictMapper.xml b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DictMapper.xml
index 18f5744..0450345 100644
--- a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DictMapper.xml
+++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DictMapper.xml
@@ -35,18 +35,18 @@
select
dict_value
- from blade_dict where code = #{param1} and dict_key = #{param2} limit 1
+ from blade_dict where code = #{param1} and dict_key = #{param2} and is_deleted = 0 limit 1
- select code, dict_key, dict_value, sort, remark from blade_dict where code = #{param1}
+ select code, dict_key, dict_value, sort, remark from blade_dict where code = #{param1} and dict_key >= 0 and is_deleted = 0
diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MenuMapper.java b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MenuMapper.java
index 8104f9a..04c32f1 100644
--- a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MenuMapper.java
+++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MenuMapper.java
@@ -56,6 +56,7 @@ public interface MenuMapper extends BaseMapper {
/**
* 授权树形结构
*
+ * @param roleId
* @return
*/
List grantTreeByRole(List roleId);
@@ -93,6 +94,7 @@ public interface MenuMapper extends BaseMapper {
/**
* 获取配置的角色权限
+ *
* @param roleIds
* @return
*/
diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MenuMapper.xml b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MenuMapper.xml
index 2d0d55f..381c986 100644
--- a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MenuMapper.xml
+++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MenuMapper.xml
@@ -30,7 +30,7 @@
select
- id, code, parent_code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted
+ id, code, parent_code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted