diff --git a/blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java b/blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java index d26177ca..f3423f50 100644 --- a/blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java +++ b/blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java @@ -97,7 +97,7 @@ public interface LauncherConstant { /** * elk prod 地址 */ - String ELK_PROD_ADDR = "172.30.0.72:9000"; + String ELK_PROD_ADDR = "172.26.199.145:9002"; /** * elk test 地址 diff --git a/blade-ops/blade-resource/src/main/resources/application-test.yml b/blade-ops/blade-resource/src/main/resources/application-test.yml index 452e6044..aaf382db 100644 --- a/blade-ops/blade-resource/src/main/resources/application-test.yml +++ b/blade-ops/blade-resource/src/main/resources/application-test.yml @@ -15,9 +15,9 @@ oss: #租户模式 tenant-mode: false #oss服务地址 - endpoint: http://8.137.14.82:9000 + endpoint: http://test.file.huo5u.com #minio转换服务地址,用于内网上传后将返回地址改为转换的外网地址 - transform-endpoint: http://8.137.14.82:9000 + transform-endpoint: http://test.file.huo5u.com #访问key access-key: minio #密钥key diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/controller/NoticeController.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/controller/NoticeController.java deleted file mode 100644 index fe93516b..00000000 --- a/blade-service/blade-desk/src/main/java/org/springblade/desk/controller/NoticeController.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.desk.controller; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.*; -import lombok.AllArgsConstructor; -import org.springblade.core.boot.ctrl.BladeController; -import org.springblade.core.mp.support.BladePage; -import org.springblade.core.mp.support.Condition; -import org.springblade.core.mp.support.Query; -import org.springblade.core.secure.annotation.PreAuth; -import org.springblade.core.secure.constant.AuthConstant; -import org.springblade.core.tenant.annotation.TenantDS; -import org.springblade.core.tool.api.R; -import org.springblade.core.tool.utils.Func; -import org.springblade.desk.entity.Notice; -import org.springblade.desk.feign.INoticeClient; -import org.springblade.desk.service.INoticeService; -import org.springblade.desk.vo.NoticeVO; -import org.springblade.desk.wrapper.NoticeWrapper; -import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; - -import java.util.Map; - -/** - * 控制器 - * - * @author Chill - */ -@PreAuth(AuthConstant.HAS_CRYPTO) -@TenantDS -@RestController -@RequestMapping("notice") -@AllArgsConstructor -@Api(value = "用户博客", tags = "博客接口") -public class NoticeController extends BladeController { - - private final INoticeService noticeService; - - private final INoticeClient noticeClient; - - /** - * 详情 - */ - @GetMapping("/detail") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入notice") - public R detail(Notice notice) { - Notice detail = noticeService.getOne(Condition.getQueryWrapper(notice)); - return R.data(NoticeWrapper.build().entityVO(detail)); - } - - /** - * 分页 - */ - @GetMapping("/list") - @ApiImplicitParams({ - @ApiImplicitParam(name = "category", value = "公告类型", paramType = "query", dataType = "integer"), - @ApiImplicitParam(name = "title", value = "公告标题", paramType = "query", dataType = "string") - }) - @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入notice") - public R> list(@ApiIgnore @RequestParam Map notice, Query query) { - NoticeWrapper.build().noticeQuery(notice); - IPage pages = noticeService.page(Condition.getPage(query), Condition.getQueryWrapper(notice, Notice.class)); - return R.data(NoticeWrapper.build().pageVO(pages)); - } - - /** - * 多表联合查询自定义分页 - */ - @GetMapping("/page") - @ApiImplicitParams({ - @ApiImplicitParam(name = "category", value = "公告类型", paramType = "query", dataType = "integer"), - @ApiImplicitParam(name = "title", value = "公告标题", paramType = "query", dataType = "string") - }) - @ApiOperationSupport(order = 3) - @ApiOperation(value = "分页", notes = "传入notice") - public R> page(@ApiIgnore NoticeVO notice, Query query) { - IPage pages = noticeService.selectNoticePage(Condition.getPage(query), notice); - return R.data(pages); - } - - /** - * 新增 - */ - @PostMapping("/save") - @ApiOperationSupport(order = 4) - @ApiOperation(value = "新增", notes = "传入notice") - public R save(@RequestBody Notice notice) { - return R.status(noticeService.save(notice)); - } - - /** - * 修改 - */ - @PostMapping("/update") - @ApiOperationSupport(order = 5) - @ApiOperation(value = "修改", notes = "传入notice") - public R update(@RequestBody Notice notice) { - return R.status(noticeService.updateById(notice)); - } - - /** - * 新增或修改 - */ - @PostMapping("/submit") - @ApiOperationSupport(order = 6) - @ApiOperation(value = "新增或修改", notes = "传入notice") - public R submit(@RequestBody Notice notice) { - return R.status(noticeService.saveOrUpdate(notice)); - } - - /** - * 删除 - */ - @PostMapping("/remove") - @ApiOperationSupport(order = 7) - @ApiOperation(value = "逻辑删除", notes = "传入notice") - public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { - boolean temp = noticeService.deleteLogic(Func.toLongList(ids)); - return R.status(temp); - } - - /** - * 远程调用分页接口 - */ - @GetMapping("/top") - @ApiOperationSupport(order = 8) - @ApiOperation(value = "分页远程调用", notes = "传入current,size") - public R> top(@ApiParam(value = "当前页") @RequestParam Integer current, @ApiParam(value = "每页显示条数") @RequestParam Integer size) { - BladePage page = noticeClient.top(current, size); - return R.data(page); - } - -} diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/feign/NoticeClient.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/feign/NoticeClient.java deleted file mode 100644 index c612d8f6..00000000 --- a/blade-service/blade-desk/src/main/java/org/springblade/desk/feign/NoticeClient.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.desk.feign; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import lombok.AllArgsConstructor; -import org.springblade.core.mp.support.BladePage; -import org.springblade.core.mp.support.Condition; -import org.springblade.core.mp.support.Query; -import org.springblade.core.tenant.annotation.NonDS; -import org.springblade.desk.entity.Notice; -import org.springblade.desk.service.INoticeService; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; -import springfox.documentation.annotations.ApiIgnore; - -/** - * Notice Feign - * - * @author Chill - */ -@NonDS -@ApiIgnore() -@RestController -@AllArgsConstructor -public class NoticeClient implements INoticeClient { - - private final INoticeService service; - - @Override - @GetMapping(TOP) - public BladePage top(Integer current, Integer size) { - Query query = new Query(); - query.setCurrent(current); - query.setSize(size); - IPage page = service.page(Condition.getPage(query)); - return BladePage.of(page); - } - -} diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/mapper/NoticeMapper.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/mapper/NoticeMapper.java deleted file mode 100644 index 22443e5e..00000000 --- a/blade-service/blade-desk/src/main/java/org/springblade/desk/mapper/NoticeMapper.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.desk.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import org.springblade.desk.entity.Notice; -import org.springblade.desk.vo.NoticeVO; - -import java.util.List; - -/** - * Mapper 接口 - * - * @author Chill - */ -public interface NoticeMapper extends BaseMapper { - - /** - * 前N条数据 - * - * @param number 数量 - * @return List - */ - List topList(Integer number); - - /** - * 自定义分页 - * - * @param page 分页 - * @param notice 实体 - * @return List - */ - List selectNoticePage(IPage page, NoticeVO notice); - -} diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/mapper/NoticeMapper.xml b/blade-service/blade-desk/src/main/java/org/springblade/desk/mapper/NoticeMapper.xml deleted file mode 100644 index acb713a8..00000000 --- a/blade-service/blade-desk/src/main/java/org/springblade/desk/mapper/NoticeMapper.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/service/INoticeService.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/service/INoticeService.java deleted file mode 100644 index aff42c8f..00000000 --- a/blade-service/blade-desk/src/main/java/org/springblade/desk/service/INoticeService.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.desk.service; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import org.springblade.core.mp.base.BaseService; -import org.springblade.desk.entity.Notice; -import org.springblade.desk.vo.NoticeVO; - -/** - * 服务类 - * - * @author Chill - */ -public interface INoticeService extends BaseService { - - /** - * 自定义分页 - * @param page - * @param notice - * @return - */ - IPage selectNoticePage(IPage page, NoticeVO notice); - -} diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/service/impl/NoticeServiceImpl.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/service/impl/NoticeServiceImpl.java deleted file mode 100644 index 685c597d..00000000 --- a/blade-service/blade-desk/src/main/java/org/springblade/desk/service/impl/NoticeServiceImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.desk.service.impl; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import org.springblade.core.mp.base.BaseServiceImpl; -import org.springblade.core.secure.utils.AuthUtil; -import org.springblade.desk.entity.Notice; -import org.springblade.desk.mapper.NoticeMapper; -import org.springblade.desk.service.INoticeService; -import org.springblade.desk.vo.NoticeVO; -import org.springframework.stereotype.Service; - -/** - * 服务实现类 - * - * @author Chill - */ -@Service -public class NoticeServiceImpl extends BaseServiceImpl implements INoticeService { - - @Override - public IPage selectNoticePage(IPage page, NoticeVO notice) { - // 若不使用mybatis-plus自带的分页方法,则不会自动带入tenantId,所以我们需要自行注入 - notice.setTenantId(AuthUtil.getTenantId()); - return page.setRecords(baseMapper.selectNoticePage(page, notice)); - } - -} diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/wrapper/NoticeWrapper.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/wrapper/NoticeWrapper.java deleted file mode 100644 index 5fa07f57..00000000 --- a/blade-service/blade-desk/src/main/java/org/springblade/desk/wrapper/NoticeWrapper.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package org.springblade.desk.wrapper; - -import org.springblade.core.mp.support.BaseEntityWrapper; -import org.springblade.core.tool.utils.BeanUtil; -import org.springblade.core.tool.utils.Func; -import org.springblade.desk.entity.Notice; -import org.springblade.desk.vo.NoticeVO; -import org.springblade.system.cache.DictCache; -import org.springblade.system.enums.DictEnum; - -import java.util.Map; -import java.util.Objects; - -/** - * Notice包装类,返回视图层所需的字段 - * - * @author Chill - */ -public class NoticeWrapper extends BaseEntityWrapper { - - public static NoticeWrapper build() { - return new NoticeWrapper(); - } - - @Override - public NoticeVO entityVO(Notice notice) { - NoticeVO noticeVO = Objects.requireNonNull(BeanUtil.copy(notice, NoticeVO.class)); - String dictValue = DictCache.getValue(DictEnum.NOTICE, noticeVO.getCategory()); - noticeVO.setCategoryName(dictValue); - return noticeVO; - } - - /** - * 查询条件处理 - */ - public void noticeQuery(Map notice) { - // 此场景仅在 pg数据库 map类型传参的情况下需要处理,entity传参已经包含数据类型,则无需关心 - // 针对 pg数据库 int类型字段查询需要强转的处理示例 - String searchKey = "category"; - if (Func.isNotEmpty(notice.get(searchKey))) { - // 数据库字段为int类型,设置"="查询,具体查询参数请见 @org.springblade.core.mp.support.SqlKeyword - notice.put(searchKey.concat("_equal"), Func.toInt(notice.get(searchKey))); - // 默认"like"查询,pg数据库 场景会报错,所以将其删除 - notice.remove(searchKey); - } - } - -} diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RegionServiceImpl.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RegionServiceImpl.java index cc292fc3..853edfcb 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RegionServiceImpl.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RegionServiceImpl.java @@ -37,6 +37,7 @@ import org.springblade.system.service.IRegionService; import org.springblade.system.vo.RegionAllVO; import org.springblade.system.vo.RegionVO; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; @@ -69,6 +70,7 @@ public class RegionServiceImpl extends ServiceImpl impleme private BladeRedis bladeRedis; @Override + @CacheEvict(cacheNames = "blade:sys:regions") public boolean submit(Region region) { // 设置市级编号格式 String regionCode = region.getCode(); @@ -114,6 +116,7 @@ public class RegionServiceImpl extends ServiceImpl impleme } @Override + @CacheEvict(cacheNames = "blade:sys:regions") public boolean removeRegion(String id) { Long cnt = baseMapper.selectCount(Wrappers.query().lambda().eq(Region::getParentCode, id)); if (cnt > 0L) {