From 43df1275b85080291cc83d84739f81ed035d954c Mon Sep 17 00:00:00 2001 From: smallchill Date: Thu, 18 Apr 2019 23:04:37 +0800 Subject: [PATCH] :tada: 2.2.3.RELEASE --- blade-auth/pom.xml | 2 +- blade-common/pom.xml | 2 +- blade-gateway/pom.xml | 2 +- blade-ops/blade-admin/pom.xml | 2 +- blade-ops/blade-develop/pom.xml | 2 +- .../system/controller/TenantController.java | 125 ++++++++++++++++++ .../org/springblade/system/dto/TenantDTO.java | 33 +++++ .../org/springblade/system/entity/Tenant.java | 61 +++++++++ .../system/mapper/TenantMapper.java | 41 ++++++ .../system/mapper/TenantMapper.xml | 25 ++++ .../system/service/ITenantService.java | 40 ++++++ .../service/impl/TenantServiceImpl.java | 40 ++++++ .../org/springblade/system/vo/TenantVO.java | 35 +++++ .../system/wrapper/TenantWrapper.java | 49 +++++++ .../main/java/templates/sql/tenant.menu.mysql | 11 ++ blade-ops/pom.xml | 2 +- blade-service-api/blade-desk-api/pom.xml | 2 +- blade-service-api/blade-dict-api/pom.xml | 2 +- blade-service-api/blade-system-api/pom.xml | 2 +- blade-service-api/blade-user-api/pom.xml | 2 +- blade-service-api/pom.xml | 4 +- blade-service/blade-desk/pom.xml | 2 +- blade-service/blade-log/pom.xml | 2 +- blade-service/blade-system/pom.xml | 2 +- .../system/controller/MenuController.java | 44 +++--- blade-service/blade-user/pom.xml | 2 +- blade-service/pom.xml | 4 +- pom.xml | 6 +- 28 files changed, 506 insertions(+), 40 deletions(-) create mode 100644 blade-ops/blade-develop/src/main/java/org/springblade/system/controller/TenantController.java create mode 100644 blade-ops/blade-develop/src/main/java/org/springblade/system/dto/TenantDTO.java create mode 100644 blade-ops/blade-develop/src/main/java/org/springblade/system/entity/Tenant.java create mode 100644 blade-ops/blade-develop/src/main/java/org/springblade/system/mapper/TenantMapper.java create mode 100644 blade-ops/blade-develop/src/main/java/org/springblade/system/mapper/TenantMapper.xml create mode 100644 blade-ops/blade-develop/src/main/java/org/springblade/system/service/ITenantService.java create mode 100644 blade-ops/blade-develop/src/main/java/org/springblade/system/service/impl/TenantServiceImpl.java create mode 100644 blade-ops/blade-develop/src/main/java/org/springblade/system/vo/TenantVO.java create mode 100644 blade-ops/blade-develop/src/main/java/org/springblade/system/wrapper/TenantWrapper.java create mode 100644 blade-ops/blade-develop/src/main/java/templates/sql/tenant.menu.mysql diff --git a/blade-auth/pom.xml b/blade-auth/pom.xml index 5d87704..8fa4d2f 100644 --- a/blade-auth/pom.xml +++ b/blade-auth/pom.xml @@ -8,7 +8,7 @@ SpringBlade org.springblade - 2.2.1 + 2.2.3 blade-auth diff --git a/blade-common/pom.xml b/blade-common/pom.xml index dc0dff9..944c926 100644 --- a/blade-common/pom.xml +++ b/blade-common/pom.xml @@ -5,7 +5,7 @@ SpringBlade org.springblade - 2.2.1 + 2.2.3 4.0.0 diff --git a/blade-gateway/pom.xml b/blade-gateway/pom.xml index bb2afca..9febf9b 100644 --- a/blade-gateway/pom.xml +++ b/blade-gateway/pom.xml @@ -5,7 +5,7 @@ SpringBlade org.springblade - 2.2.1 + 2.2.3 4.0.0 diff --git a/blade-ops/blade-admin/pom.xml b/blade-ops/blade-admin/pom.xml index f37dccd..d52e790 100644 --- a/blade-ops/blade-admin/pom.xml +++ b/blade-ops/blade-admin/pom.xml @@ -5,7 +5,7 @@ blade-ops org.springblade - 2.2.1 + 2.2.3 4.0.0 diff --git a/blade-ops/blade-develop/pom.xml b/blade-ops/blade-develop/pom.xml index b629e16..2f0c794 100644 --- a/blade-ops/blade-develop/pom.xml +++ b/blade-ops/blade-develop/pom.xml @@ -6,7 +6,7 @@ org.springblade blade-ops - 2.2.1 + 2.2.3 4.0.0 diff --git a/blade-ops/blade-develop/src/main/java/org/springblade/system/controller/TenantController.java b/blade-ops/blade-develop/src/main/java/org/springblade/system/controller/TenantController.java new file mode 100644 index 0000000..ad80469 --- /dev/null +++ b/blade-ops/blade-develop/src/main/java/org/springblade/system/controller/TenantController.java @@ -0,0 +1,125 @@ +/** + * 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 io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.system.feign.IDictClient; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.RequestParam; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.system.entity.Tenant; +import org.springblade.system.vo.TenantVO; +import org.springblade.system.wrapper.TenantWrapper; +import org.springblade.system.service.ITenantService; +import org.springblade.core.boot.ctrl.BladeController; +import java.util.List; + +/** + * 控制器 + * + * @author Blade + * @since 2019-04-17 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/tenant") +@Api(value = "", tags = "接口") +public class TenantController extends BladeController { + + private ITenantService tenantService; + + private IDictClient dictClient; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperation(value = "详情", notes = "传入tenant", position = 1) + public R detail(Tenant tenant) { + Tenant detail = tenantService.getOne(Condition.getQueryWrapper(tenant)); + TenantWrapper tenantWrapper = new TenantWrapper(dictClient); + return R.data(tenantWrapper.entityVO(detail)); + } + + /** + * 分页 + */ + @GetMapping("/list") + @ApiOperation(value = "分页", notes = "传入tenant", position = 2) + public R> list(Tenant tenant, Query query) { + IPage pages = tenantService.page(Condition.getPage(query), Condition.getQueryWrapper(tenant)); + TenantWrapper tenantWrapper = new TenantWrapper(dictClient); + return R.data(tenantWrapper.pageVO(pages)); + } + + /** + * 自定义分页 + */ + @GetMapping("/page") + @ApiOperation(value = "分页", notes = "传入tenant", position = 3) + public R> page(TenantVO tenant, Query query) { + IPage pages = tenantService.selectTenantPage(Condition.getPage(query), tenant); + return R.data(pages); + } + + /** + * 新增 + */ + @PostMapping("/save") + @ApiOperation(value = "新增", notes = "传入tenant", position = 4) + public R save(@Valid @RequestBody Tenant tenant) { + return R.status(tenantService.save(tenant)); + } + + /** + * 修改 + */ + @PostMapping("/update") + @ApiOperation(value = "修改", notes = "传入tenant", position = 5) + public R update(@Valid @RequestBody Tenant tenant) { + return R.status(tenantService.updateById(tenant)); + } + + /** + * 新增或修改 + */ + @PostMapping("/submit") + @ApiOperation(value = "新增或修改", notes = "传入tenant", position = 6) + public R submit(@Valid @RequestBody Tenant tenant) { + return R.status(tenantService.saveOrUpdate(tenant)); + } + + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperation(value = "逻辑删除", notes = "传入ids", position = 7) + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(tenantService.deleteLogic(Func.toIntList(ids))); + } + + +} diff --git a/blade-ops/blade-develop/src/main/java/org/springblade/system/dto/TenantDTO.java b/blade-ops/blade-develop/src/main/java/org/springblade/system/dto/TenantDTO.java new file mode 100644 index 0000000..43d70c2 --- /dev/null +++ b/blade-ops/blade-develop/src/main/java/org/springblade/system/dto/TenantDTO.java @@ -0,0 +1,33 @@ +/** + * 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.dto; + +import org.springblade.system.entity.Tenant; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 数据传输对象实体类 + * + * @author Blade + * @since 2019-04-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class TenantDTO extends Tenant { + private static final long serialVersionUID = 1L; + +} diff --git a/blade-ops/blade-develop/src/main/java/org/springblade/system/entity/Tenant.java b/blade-ops/blade-develop/src/main/java/org/springblade/system/entity/Tenant.java new file mode 100644 index 0000000..fcf0621 --- /dev/null +++ b/blade-ops/blade-develop/src/main/java/org/springblade/system/entity/Tenant.java @@ -0,0 +1,61 @@ +/** + * 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 org.springblade.core.mp.base.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * 实体类 + * + * @author Blade + * @since 2019-04-17 + */ +@Data +@TableName("blade_tenant") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "Tenant对象", description = "Tenant对象") +public class Tenant extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * 租户名称 + */ + @ApiModelProperty(value = "租户名称") + private String tenantName; + /** + * 联系人 + */ + @ApiModelProperty(value = "联系人") + private String linkman; + /** + * 联系电话 + */ + @ApiModelProperty(value = "联系电话") + private String contactNumber; + /** + * 联系地址 + */ + @ApiModelProperty(value = "联系地址") + private String address; + + +} diff --git a/blade-ops/blade-develop/src/main/java/org/springblade/system/mapper/TenantMapper.java b/blade-ops/blade-develop/src/main/java/org/springblade/system/mapper/TenantMapper.java new file mode 100644 index 0000000..a2a4110 --- /dev/null +++ b/blade-ops/blade-develop/src/main/java/org/springblade/system/mapper/TenantMapper.java @@ -0,0 +1,41 @@ +/** + * 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 org.springblade.system.entity.Tenant; +import org.springblade.system.vo.TenantVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * Mapper 接口 + * + * @author Blade + * @since 2019-04-17 + */ +public interface TenantMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param tenant + * @return + */ + List selectTenantPage(IPage page, TenantVO tenant); + +} diff --git a/blade-ops/blade-develop/src/main/java/org/springblade/system/mapper/TenantMapper.xml b/blade-ops/blade-develop/src/main/java/org/springblade/system/mapper/TenantMapper.xml new file mode 100644 index 0000000..4f06512 --- /dev/null +++ b/blade-ops/blade-develop/src/main/java/org/springblade/system/mapper/TenantMapper.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-ops/blade-develop/src/main/java/org/springblade/system/service/ITenantService.java b/blade-ops/blade-develop/src/main/java/org/springblade/system/service/ITenantService.java new file mode 100644 index 0000000..531d53f --- /dev/null +++ b/blade-ops/blade-develop/src/main/java/org/springblade/system/service/ITenantService.java @@ -0,0 +1,40 @@ +/** + * 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.service; + +import org.springblade.system.entity.Tenant; +import org.springblade.system.vo.TenantVO; +import org.springblade.core.mp.base.BaseService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 服务类 + * + * @author Blade + * @since 2019-04-17 + */ +public interface ITenantService extends BaseService { + + /** + * 自定义分页 + * + * @param page + * @param tenant + * @return + */ + IPage selectTenantPage(IPage page, TenantVO tenant); + +} diff --git a/blade-ops/blade-develop/src/main/java/org/springblade/system/service/impl/TenantServiceImpl.java b/blade-ops/blade-develop/src/main/java/org/springblade/system/service/impl/TenantServiceImpl.java new file mode 100644 index 0000000..c71ebea --- /dev/null +++ b/blade-ops/blade-develop/src/main/java/org/springblade/system/service/impl/TenantServiceImpl.java @@ -0,0 +1,40 @@ +/** + * 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.service.impl; + +import org.springblade.system.entity.Tenant; +import org.springblade.system.vo.TenantVO; +import org.springblade.system.mapper.TenantMapper; +import org.springblade.system.service.ITenantService; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 服务实现类 + * + * @author Blade + * @since 2019-04-17 + */ +@Service +public class TenantServiceImpl extends BaseServiceImpl implements ITenantService { + + @Override + public IPage selectTenantPage(IPage page, TenantVO tenant) { + return page.setRecords(baseMapper.selectTenantPage(page, tenant)); + } + +} diff --git a/blade-ops/blade-develop/src/main/java/org/springblade/system/vo/TenantVO.java b/blade-ops/blade-develop/src/main/java/org/springblade/system/vo/TenantVO.java new file mode 100644 index 0000000..20998c1 --- /dev/null +++ b/blade-ops/blade-develop/src/main/java/org/springblade/system/vo/TenantVO.java @@ -0,0 +1,35 @@ +/** + * 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.vo; + +import org.springblade.system.entity.Tenant; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +/** + * 视图实体类 + * + * @author Blade + * @since 2019-04-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "TenantVO对象", description = "TenantVO对象") +public class TenantVO extends Tenant { + private static final long serialVersionUID = 1L; + +} diff --git a/blade-ops/blade-develop/src/main/java/org/springblade/system/wrapper/TenantWrapper.java b/blade-ops/blade-develop/src/main/java/org/springblade/system/wrapper/TenantWrapper.java new file mode 100644 index 0000000..0ce1000 --- /dev/null +++ b/blade-ops/blade-develop/src/main/java/org/springblade/system/wrapper/TenantWrapper.java @@ -0,0 +1,49 @@ +/** + * 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.wrapper; + +import lombok.AllArgsConstructor; +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.system.feign.IDictClient; +import org.springblade.system.entity.Tenant; +import org.springblade.system.vo.TenantVO; + +/** + * 包装类,返回视图层所需的字段 + * + * @author Blade + * @since 2019-04-17 + */ +@AllArgsConstructor +public class TenantWrapper extends BaseEntityWrapper { + + private IDictClient dictClient; + + @Override + public TenantVO entityVO(Tenant tenant) { + TenantVO tenantVO = BeanUtil.copy(tenant, TenantVO.class); + + /*R dict = dictClient.getValue("tenant" , tenantVO.getCategory()); + if (dict.isSuccess()) { + String categoryName = dict.getData(); + tenantVO.setCategoryName(categoryName); + }*/ + + return tenantVO; + } + +} diff --git a/blade-ops/blade-develop/src/main/java/templates/sql/tenant.menu.mysql b/blade-ops/blade-develop/src/main/java/templates/sql/tenant.menu.mysql new file mode 100644 index 0000000..7496716 --- /dev/null +++ b/blade-ops/blade-develop/src/main/java/templates/sql/tenant.menu.mysql @@ -0,0 +1,11 @@ +INSERT INTO `blade_menu`(`parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) +VALUES (0, 'tenant', '租户管理', 'menu', '/system/tenant', NULL, 1, 1, 0, 1, NULL, 0); +set @parentid = (SELECT LAST_INSERT_ID()); +INSERT INTO `blade_menu`(`parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) +VALUES (@parentid, 'tenant_add', '新增', 'add', '/system/tenant/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, 'tenant_edit', '修改', 'edit', '/system/tenant/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, 'tenant_delete', '删除', 'delete', '/api/blade-system/tenant/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, 'tenant_view', '查看', 'view', '/system/tenant/view', 'file-text', 4, 2, 1, 2, NULL, 0); diff --git a/blade-ops/pom.xml b/blade-ops/pom.xml index 294cc3c..57c635f 100644 --- a/blade-ops/pom.xml +++ b/blade-ops/pom.xml @@ -5,7 +5,7 @@ SpringBlade org.springblade - 2.2.1 + 2.2.3 4.0.0 diff --git a/blade-service-api/blade-desk-api/pom.xml b/blade-service-api/blade-desk-api/pom.xml index f01ea5c..e24dcd6 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.2.1 + 2.2.3 4.0.0 diff --git a/blade-service-api/blade-dict-api/pom.xml b/blade-service-api/blade-dict-api/pom.xml index c333f9b..321a229 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.2.1 + 2.2.3 4.0.0 diff --git a/blade-service-api/blade-system-api/pom.xml b/blade-service-api/blade-system-api/pom.xml index fbad37a..ddc4fa2 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.2.1 + 2.2.3 4.0.0 diff --git a/blade-service-api/blade-user-api/pom.xml b/blade-service-api/blade-user-api/pom.xml index 9f3e4e4..86efbce 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.2.1 + 2.2.3 4.0.0 diff --git a/blade-service-api/pom.xml b/blade-service-api/pom.xml index 0b56a44..ea5e53a 100644 --- a/blade-service-api/pom.xml +++ b/blade-service-api/pom.xml @@ -5,13 +5,13 @@ SpringBlade org.springblade - 2.2.1 + 2.2.3 4.0.0 blade-service-api ${project.artifactId} - 2.2.1 + 2.2.3 pom SpringBlade 微服务API集合 diff --git a/blade-service/blade-desk/pom.xml b/blade-service/blade-desk/pom.xml index 74ef811..56c9160 100644 --- a/blade-service/blade-desk/pom.xml +++ b/blade-service/blade-desk/pom.xml @@ -6,7 +6,7 @@ org.springblade blade-service - 2.2.1 + 2.2.3 4.0.0 diff --git a/blade-service/blade-log/pom.xml b/blade-service/blade-log/pom.xml index 52ca251..625feaf 100644 --- a/blade-service/blade-log/pom.xml +++ b/blade-service/blade-log/pom.xml @@ -5,7 +5,7 @@ blade-service org.springblade - 2.2.1 + 2.2.3 4.0.0 diff --git a/blade-service/blade-system/pom.xml b/blade-service/blade-system/pom.xml index 223b44d..622c14a 100644 --- a/blade-service/blade-system/pom.xml +++ b/blade-service/blade-system/pom.xml @@ -5,7 +5,7 @@ blade-service org.springblade - 2.2.1 + 2.2.3 4.0.0 diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java index 9dcfc30..334e7b4 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java @@ -20,7 +20,9 @@ import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; import org.springblade.core.secure.BladeUser; +import org.springblade.core.secure.annotation.PreAuth; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.constant.RoleConstant; import org.springblade.core.tool.support.Kv; import org.springblade.core.tool.utils.Func; import org.springblade.system.entity.Menu; @@ -54,6 +56,7 @@ public class MenuController extends BladeController { * 详情 */ @GetMapping("/detail") + @PreAuth(RoleConstant.HAS_ROLE_ADMIN) @ApiOperation(value = "详情", notes = "传入menu", position = 1) public R detail(Menu menu) { Menu detail = menuService.getOne(Condition.getQueryWrapper(menu)); @@ -69,6 +72,7 @@ public class MenuController extends BladeController { @ApiImplicitParam(name = "code", value = "菜单编号", paramType = "query", dataType = "string"), @ApiImplicitParam(name = "name", value = "菜单名称", paramType = "query", dataType = "string") }) + @PreAuth(RoleConstant.HAS_ROLE_ADMIN) @ApiOperation(value = "列表", notes = "传入menu", position = 2) public R> list(@ApiIgnore @RequestParam Map menu) { @SuppressWarnings("unchecked") @@ -77,6 +81,27 @@ public class MenuController extends BladeController { return R.data(menuWrapper.listNodeVO(list)); } + /** + * 新增或修改 + */ + @PostMapping("/submit") + @PreAuth(RoleConstant.HAS_ROLE_ADMIN) + @ApiOperation(value = "新增或修改", notes = "传入menu", position = 8) + public R submit(@Valid @RequestBody Menu menu) { + return R.status(menuService.saveOrUpdate(menu)); + } + + + /** + * 删除 + */ + @PostMapping("/remove") + @PreAuth(RoleConstant.HAS_ROLE_ADMIN) + @ApiOperation(value = "删除", notes = "传入ids", position = 9) + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(menuService.removeByIds(Func.toIntList(ids))); + } + /** * 前端菜单数据 */ @@ -125,25 +150,6 @@ public class MenuController extends BladeController { return R.data(menuService.roleTreeKeys(roleIds)); } - /** - * 新增或修改 - */ - @PostMapping("/submit") - @ApiOperation(value = "新增或修改", notes = "传入menu", position = 8) - public R submit(@Valid @RequestBody Menu menu) { - return R.status(menuService.saveOrUpdate(menu)); - } - - - /** - * 删除 - */ - @PostMapping("/remove") - @ApiOperation(value = "删除", notes = "传入ids", position = 9) - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(menuService.removeByIds(Func.toIntList(ids))); - } - /** * 获取配置的角色权限 */ diff --git a/blade-service/blade-user/pom.xml b/blade-service/blade-user/pom.xml index 49b831c..0b26fd0 100644 --- a/blade-service/blade-user/pom.xml +++ b/blade-service/blade-user/pom.xml @@ -5,7 +5,7 @@ blade-service org.springblade - 2.2.1 + 2.2.3 4.0.0 diff --git a/blade-service/pom.xml b/blade-service/pom.xml index 3b6bcd0..5ee972a 100644 --- a/blade-service/pom.xml +++ b/blade-service/pom.xml @@ -7,12 +7,12 @@ org.springblade SpringBlade - 2.2.1 + 2.2.3 blade-service ${project.artifactId} - 2.2.1 + 2.2.3 pom SpringBlade 微服务集合 diff --git a/pom.xml b/pom.xml index 80a3f46..019eea9 100644 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ org.springblade SpringBlade - 2.2.1 + 2.2.3 pom - 2.2.1 - 2.2.1 + 2.2.3 + 2.2.3 1.8 2.9.2