diff --git a/src/main/java/org/springblade/common/utils/HttpUtil.java b/src/main/java/org/springblade/common/utils/HttpUtil.java index 8bd8b85..d6fd374 100644 --- a/src/main/java/org/springblade/common/utils/HttpUtil.java +++ b/src/main/java/org/springblade/common/utils/HttpUtil.java @@ -3,7 +3,9 @@ package org.springblade.common.utils; import com.alibaba.fastjson.JSONObject; import com.google.common.base.Joiner; import lombok.RequiredArgsConstructor; +import org.springblade.common.constant.MonitorConstant; import org.springframework.stereotype.Component; +import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; @@ -27,9 +29,14 @@ public class HttpUtil { private final RestTemplate restTemplate; public String doGet(String url, JSONObject params) { - URI uri = getUriByUrl(url,params); - String responseEntity = restTemplate.getForEntity(uri, String.class).getBody(); - return responseEntity; + String responseEntity = null; + try { + URI uri = getUriByUrl(url,params); + responseEntity = restTemplate.getForEntity(uri, String.class).getBody(); + } catch (RestClientException e) { + return MonitorConstant.RESULT; + } + return responseEntity; } /** diff --git a/src/main/java/org/springblade/modules/desk/controller/DashBoardController.java b/src/main/java/org/springblade/modules/desk/controller/DashBoardController.java deleted file mode 100644 index e256c13..0000000 --- a/src/main/java/org/springblade/modules/desk/controller/DashBoardController.java +++ /dev/null @@ -1,180 +0,0 @@ -package org.springblade.modules.desk.controller; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.AllArgsConstructor; -import org.springblade.core.tool.api.R; -import org.springblade.core.tool.support.Kv; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import springfox.documentation.annotations.ApiIgnore; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 首页 - * - * @author zhuangqian - */ -@ApiIgnore -@RestController -@RequestMapping("/blade-desk/dashboard") -@AllArgsConstructor -@Api(value = "首页", tags = "首页") -public class DashBoardController { - - /** - * 活跃用户 - * - * @return - */ - @GetMapping("/activities") - @ApiOperation(value = "活跃用户", notes = "活跃用户") - public R activities() { - - List> list = new ArrayList<>(); - Map map1 = new HashMap<>(16); - map1.put("id", "trend-1"); - map1.put("updatedAt", "2019-01-01"); - map1.put("user", Kv.init().set("name", "曲丽丽").set("avatar", "https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png")); - map1.put("group", Kv.init().set("name", "高逼格设计天团").set("link", "http://github.com/")); - map1.put("project", Kv.init().set("name", "六月迭代").set("link", "http://github.com/")); - map1.put("template", "在 @{group} 新建项目 @{project}"); - list.add(map1); - - Map map2 = new HashMap<>(16); - map2.put("id", "trend-2"); - map2.put("updatedAt", "2019-01-01"); - map2.put("user", Kv.init().set("name", "付小小").set("avatar", "https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png")); - map2.put("group", Kv.init().set("name", "高逼格设计天团").set("link", "http://github.com/")); - map2.put("project", Kv.init().set("name", "七月月迭代").set("link", "http://github.com/")); - map2.put("template", "在 @{group} 新建项目 @{project}"); - list.add(map2); - - return R.data(list); - } - - /** - * 获取消息 - * - * @return - */ - @GetMapping("/notices") - @ApiOperation(value = "消息", notes = "消息") - public R notices() { - List> list = new ArrayList<>(); - Map map1 = new HashMap<>(16); - map1.put("logo", "https://spring.io/img/homepage/icon-spring-framework.svg"); - map1.put("title", "SpringBoot"); - map1.put("description", "现在的web项目几乎都会用到spring框架,而要使用spring难免需要配置大量的xml配置文件,而 springboot的出现解 决了这一问题,一个项目甚至不用部署到服务器上直接开跑,真像springboot所说:“just run”。"); - map1.put("member", "Chill"); - map1.put("href", "http://spring.io/projects/spring-boot"); - list.add(map1); - - Map map2 = new HashMap<>(16); - map2.put("logo", "https://spring.io/img/homepage/icon-spring-cloud.svg"); - map2.put("title", "SpringCloud"); - map2.put("description", "SpringCloud是基于SpringBoot的一整套实现微服务的框架。他提供了微服务开发所需的配置管理、服务发现、断路器、智能路由、微代理、控制总线、全局锁、决策竞选、分布式会话和集群状态管理等组件。"); - map2.put("member", "Chill"); - map2.put("href", "http://spring.io/projects/spring-cloud"); - list.add(map2); - - Map map3 = new HashMap<>(16); - map3.put("logo", "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1546359961068&di=05ff9406e6675ca9a58a525a7e7950b9&imgtype=jpg&src=http%3A%2F%2Fimg0.imgtn.bdimg.com%2Fit%2Fu%3D575314515%2C4268715674%26fm%3D214%26gp%3D0.jpg"); - map3.put("title", "Mybatis"); - map3.put("description", "MyBatis 是一款优秀的持久层框架,它支持定制化 SQL、存储过程以及高级映射。MyBatis 避免了几乎所有的 JDBC 代码和手动设置参数以及获取结果集。MyBatis 可以使用简单的 XML 或注解来配置和映射原生信息,将接口和 Java 的 POJOs(Plain Old Java Objects,普通的 Java对象)映射成数据库中的记录。"); - map3.put("member", "Chill"); - map3.put("href", "http://www.mybatis.org/mybatis-3/getting-started.html"); - list.add(map3); - - Map map4 = new HashMap<>(16); - map4.put("logo", "https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png"); - map4.put("title", "React"); - map4.put("description", "React 起源于 Facebook 的内部项目,因为该公司对市场上所有 JavaScript MVC 框架,都不满意,就决定自己写一套,用来架设Instagram 的网站。做出来以后,发现这套东西很好用,就在2013年5月开源了。"); - map4.put("member", "Chill"); - map4.put("href", "https://reactjs.org/"); - list.add(map4); - - Map map5 = new HashMap<>(16); - map5.put("logo", "https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png"); - map5.put("title", "Ant Design"); - map5.put("description", "蚂蚁金服体验技术部经过大量的项目实践和总结,沉淀出设计语言 Ant Design,这可不单纯只是设计原则、控件规范和视觉尺寸,还配套有前端代码实现方案。也就是说采用Ant Design后,UI设计和前端界面研发可同步完成,效率大大提升。"); - map5.put("member", "Chill"); - map5.put("href", "https://ant.design/docs/spec/introduce-cn"); - list.add(map5); - - Map map6 = new HashMap<>(16); - map6.put("logo", "https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png"); - map6.put("title", "Ant Design Pro"); - map6.put("description", "Ant Design Pro 是一个企业级开箱即用的中后台前端/设计解决方案。符合阿里追求的'敏捷的前端+强大的中台'的思想。"); - map6.put("member", "Chill"); - map6.put("href", "https://pro.ant.design"); - list.add(map6); - - return R.data(list); - } - - /** - * 获取我的消息 - * - * @return - */ - @GetMapping("/my-notices") - @ApiOperation(value = "消息", notes = "消息") - public R myNotices() { - List> list = new ArrayList<>(); - Map map1 = new HashMap<>(16); - map1.put("id", "000000001"); - map1.put("avatar", "https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png"); - map1.put("title", "你收到了 14 份新周报"); - map1.put("datetime", "2018-08-09"); - map1.put("type", "notification"); - list.add(map1); - - Map map2 = new HashMap<>(16); - map2.put("id", "000000002"); - map2.put("avatar", "https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png"); - map2.put("title", "你推荐的 曲妮妮 已通过第三轮面试"); - map2.put("datetime", "2018-08-08"); - map2.put("type", "notification"); - list.add(map2); - - - Map map3 = new HashMap<>(16); - map3.put("id", "000000003"); - map3.put("avatar", "https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg"); - map3.put("title", "曲丽丽 评论了你"); - map3.put("description", "描述信息描述信息描述信息"); - map3.put("datetime", "2018-08-07"); - map3.put("type", "message"); - map3.put("clickClose", "true"); - list.add(map3); - - - Map map4 = new HashMap<>(16); - map4.put("id", "000000004"); - map4.put("avatar", "https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg"); - map4.put("title", "朱偏右 回复了你"); - map4.put("description", "这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像"); - map4.put("type", "message"); - map4.put("datetime", "2018-08-07"); - map4.put("clickClose", "true"); - list.add(map4); - - - Map map5 = new HashMap<>(16); - map5.put("id", "000000005"); - map5.put("title", "任务名称"); - map5.put("description", "任务需要在 2018-01-12 20:00 前启动"); - map5.put("extra", "未开始"); - map5.put("status", "todo"); - map5.put("type", "event"); - list.add(map5); - - return R.data(list); - } -} diff --git a/src/main/java/org/springblade/modules/desk/controller/NoticeController.java b/src/main/java/org/springblade/modules/desk/controller/NoticeController.java deleted file mode 100644 index 800e4bf..0000000 --- a/src/main/java/org/springblade/modules/desk/controller/NoticeController.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * 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.modules.desk.controller; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import com.github.xiaoymin.knife4j.annotations.ApiSort; -import io.swagger.annotations.*; -import lombok.AllArgsConstructor; -import org.springblade.common.cache.CacheNames; -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.modules.desk.entity.Notice; -import org.springblade.modules.desk.service.INoticeService; -import org.springblade.modules.desk.vo.NoticeVO; -import org.springblade.modules.desk.wrapper.NoticeWrapper; -import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; - -import java.util.Map; - -/** - * 控制器 - * - * @author Chill - */ -@RestController -@RequestMapping("/blade-desk/notice") -@AllArgsConstructor -@ApiSort(2) -@Api(value = "用户博客", tags = "博客接口") -public class NoticeController extends BladeController implements CacheNames { - - private INoticeService noticeService; - - /** - * 详情 - */ - @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) { - IPage pages = noticeService.page(Condition.getPage(query), Condition.getQueryWrapper(notice, Notice.class)); - return R.data(NoticeWrapper.build().pageVO(pages)); - } - - /** - * 新增 - */ - @PostMapping("/save") - @ApiOperationSupport(order = 3) - @ApiOperation(value = "新增", notes = "传入notice") - public R save(@RequestBody Notice notice) { - return R.status(noticeService.save(notice)); - } - - /** - * 修改 - */ - @PostMapping("/update") - @ApiOperationSupport(order = 4) - @ApiOperation(value = "修改", notes = "传入notice") - public R update(@RequestBody Notice notice) { - return R.status(noticeService.updateById(notice)); - } - - /** - * 新增或修改 - */ - @PostMapping("/submit") - @ApiOperationSupport(order = 5) - @ApiOperation(value = "新增或修改", notes = "传入notice") - public R submit(@RequestBody Notice notice) { - return R.status(noticeService.saveOrUpdate(notice)); - } - - /** - * 删除 - */ - @PostMapping("/remove") - @ApiOperationSupport(order = 6) - @ApiOperation(value = "逻辑删除", notes = "传入notice") - public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { - boolean temp = noticeService.deleteLogic(Func.toLongList(ids)); - return R.status(temp); - } - -} diff --git a/src/main/java/org/springblade/modules/desk/entity/Notice.java b/src/main/java/org/springblade/modules/desk/entity/Notice.java deleted file mode 100644 index 43681d5..0000000 --- a/src/main/java/org/springblade/modules/desk/entity/Notice.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * 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.modules.desk.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import lombok.Data; -import lombok.EqualsAndHashCode; -import org.springblade.core.mp.base.BaseEntity; - -import java.util.Date; - -/** - * 实体类 - * - * @author Chill - */ -@Data -@EqualsAndHashCode(callSuper = true) -@TableName("blade_notice") -public class Notice extends BaseEntity { - - private static final long serialVersionUID = 1L; - - /** - * 主键id - */ - @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.ASSIGN_ID) - @JsonSerialize(using = ToStringSerializer.class) - private Long id; - - /** - * 标题 - */ - @ApiModelProperty(value = "标题") - private String title; - - /** - * 通知类型 - */ - @ApiModelProperty(value = "通知类型") - private Integer category; - - /** - * 发布日期 - */ - @ApiModelProperty(value = "发布日期") - private Date releaseTime; - - /** - * 内容 - */ - @ApiModelProperty(value = "内容") - private String content; - - -} diff --git a/src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.java b/src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.java deleted file mode 100644 index cf5772b..0000000 --- a/src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * 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.modules.desk.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import org.springblade.modules.desk.entity.Notice; - -import java.util.List; - -/** - * Mapper 接口 - * - * @author Chill - */ -public interface NoticeMapper extends BaseMapper { - - /** - * 前N条数据 - * @param number - * @return - */ - List topList(Integer number); - - /** - * 自定义分页 - * @param page - * @param notice - * @return - */ - List selectNoticePage(IPage page, Notice notice); - -} diff --git a/src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.xml b/src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.xml deleted file mode 100644 index 44a8ff0..0000000 --- a/src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - select id, - create_user AS createUser, - create_time AS createTime, - update_user AS updateUser, - update_time AS updateTime, - status, - is_deleted AS isDeleted, - title, content - - - - - - - diff --git a/src/main/java/org/springblade/modules/desk/service/INoticeService.java b/src/main/java/org/springblade/modules/desk/service/INoticeService.java deleted file mode 100644 index d5be9a6..0000000 --- a/src/main/java/org/springblade/modules/desk/service/INoticeService.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * 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.modules.desk.service; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import org.springblade.core.mp.base.BaseService; -import org.springblade.modules.desk.entity.Notice; - -/** - * 服务类 - * - * @author Chill - */ -public interface INoticeService extends BaseService { - - /** - * 自定义分页 - * @param page - * @param notice - * @return - */ - IPage selectNoticePage(IPage page, Notice notice); - -} diff --git a/src/main/java/org/springblade/modules/desk/service/impl/NoticeServiceImpl.java b/src/main/java/org/springblade/modules/desk/service/impl/NoticeServiceImpl.java deleted file mode 100644 index 227808f..0000000 --- a/src/main/java/org/springblade/modules/desk/service/impl/NoticeServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * 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.modules.desk.service.impl; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import org.springblade.core.mp.base.BaseServiceImpl; -import org.springblade.modules.desk.entity.Notice; -import org.springblade.modules.desk.mapper.NoticeMapper; -import org.springblade.modules.desk.service.INoticeService; -import org.springframework.stereotype.Service; - -/** - * 服务实现类 - * - * @author Chill - */ -@Service -public class NoticeServiceImpl extends BaseServiceImpl implements INoticeService { - - @Override - public IPage selectNoticePage(IPage page, Notice notice) { - return page.setRecords(baseMapper.selectNoticePage(page, notice)); - } - -} diff --git a/src/main/java/org/springblade/modules/desk/vo/NoticeVO.java b/src/main/java/org/springblade/modules/desk/vo/NoticeVO.java deleted file mode 100644 index 5ec4847..0000000 --- a/src/main/java/org/springblade/modules/desk/vo/NoticeVO.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.springblade.modules.desk.vo; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; -import org.springblade.modules.desk.entity.Notice; - -/** - * 通知公告视图类 - * - * @author Chill - */ -@Data -@EqualsAndHashCode(callSuper = true) -public class NoticeVO extends Notice { - - @ApiModelProperty(value = "通知类型名") - private String categoryName; - -} diff --git a/src/main/java/org/springblade/modules/desk/wrapper/NoticeWrapper.java b/src/main/java/org/springblade/modules/desk/wrapper/NoticeWrapper.java deleted file mode 100644 index fd6fec1..0000000 --- a/src/main/java/org/springblade/modules/desk/wrapper/NoticeWrapper.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * 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.modules.desk.wrapper; - -import org.springblade.core.mp.support.BaseEntityWrapper; -import org.springblade.core.tool.utils.BeanUtil; -import org.springblade.core.tool.utils.SpringUtil; -import org.springblade.modules.desk.entity.Notice; -import org.springblade.modules.desk.vo.NoticeVO; -import org.springblade.modules.system.service.IDictService; - -/** - * Notice包装类,返回视图层所需的字段 - * - * @author Chill - */ -public class NoticeWrapper extends BaseEntityWrapper { - - private static IDictService dictService; - - static { - dictService = SpringUtil.getBean(IDictService.class); - } - - public static NoticeWrapper build() { - return new NoticeWrapper(); - } - - @Override - public NoticeVO entityVO(Notice notice) { - NoticeVO noticeVO = BeanUtil.copy(notice, NoticeVO.class); - String categoryName = dictService.getValue("notice", noticeVO.getCategory()); - noticeVO.setCategoryName(categoryName); - return noticeVO; - } - -} diff --git a/src/main/java/org/springblade/modules/develop/controller/CodeController.java b/src/main/java/org/springblade/modules/develop/controller/CodeController.java deleted file mode 100644 index c553807..0000000 --- a/src/main/java/org/springblade/modules/develop/controller/CodeController.java +++ /dev/null @@ -1,154 +0,0 @@ -/** - * 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.modules.develop.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.launch.constant.AppConstant; -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.tool.api.R; -import org.springblade.core.tool.constant.RoleConstant; -import org.springblade.core.tool.utils.Func; -import org.springblade.develop.support.BladeCodeGenerator; -import org.springblade.modules.develop.entity.Code; -import org.springblade.modules.develop.entity.Datasource; -import org.springblade.modules.develop.service.ICodeService; -import org.springblade.modules.develop.service.IDatasourceService; -import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; - -import javax.validation.Valid; -import java.util.Collection; -import java.util.Map; - -/** - * 控制器 - * - * @author Chill - */ -@ApiIgnore -@RestController -@AllArgsConstructor -@RequestMapping(AppConstant.APPLICATION_DEVELOP_NAME + "/code") -@Api(value = "代码生成", tags = "代码生成") -@PreAuth(RoleConstant.HAS_ROLE_ADMIN) -public class CodeController extends BladeController { - - private ICodeService codeService; - private IDatasourceService datasourceService; - - /** - * 详情 - */ - @GetMapping("/detail") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入code") - public R detail(Code code) { - Code detail = codeService.getOne(Condition.getQueryWrapper(code)); - return R.data(detail); - } - - /** - * 分页 - */ - @GetMapping("/list") - @ApiImplicitParams({ - @ApiImplicitParam(name = "codeName", value = "模块名", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "tableName", value = "表名", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "modelName", value = "实体名", paramType = "query", dataType = "string") - }) - @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入code") - public R> list(@ApiIgnore @RequestParam Map code, Query query) { - IPage pages = codeService.page(Condition.getPage(query), Condition.getQueryWrapper(code, Code.class)); - return R.data(pages); - } - - /** - * 新增或修改 - */ - @PostMapping("/submit") - @ApiOperationSupport(order = 3) - @ApiOperation(value = "新增或修改", notes = "传入code") - public R submit(@Valid @RequestBody Code code) { - return R.status(codeService.submit(code)); - } - - - /** - * 删除 - */ - @PostMapping("/remove") - @ApiOperationSupport(order = 4) - @ApiOperation(value = "删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(codeService.removeByIds(Func.toLongList(ids))); - } - - /** - * 复制 - */ - @PostMapping("/copy") - @ApiOperationSupport(order = 5) - @ApiOperation(value = "复制", notes = "传入id") - public R copy(@ApiParam(value = "主键", required = true) @RequestParam Long id) { - Code code = codeService.getById(id); - code.setId(null); - code.setCodeName(code.getCodeName() + "-copy"); - return R.status(codeService.save(code)); - } - - /** - * 代码生成 - */ - @PostMapping("/gen-code") - @ApiOperationSupport(order = 6) - @ApiOperation(value = "代码生成", notes = "传入ids") - public R genCode(@ApiParam(value = "主键集合", required = true) @RequestParam String ids, @RequestParam(defaultValue = "sword") String system) { - Collection codes = codeService.listByIds(Func.toLongList(ids)); - codes.forEach(code -> { - BladeCodeGenerator generator = new BladeCodeGenerator(); - // 设置数据源 - Datasource datasource = datasourceService.getById(code.getDatasourceId()); - generator.setDriverName(datasource.getDriverClass()); - generator.setUrl(datasource.getUrl()); - generator.setUsername(datasource.getUsername()); - generator.setPassword(datasource.getPassword()); - // 设置基础配置 - generator.setSystemName(system); - generator.setServiceName(code.getServiceName()); - generator.setPackageName(code.getPackageName()); - generator.setPackageDir(code.getApiPath()); - generator.setPackageWebDir(code.getWebPath()); - generator.setTablePrefix(Func.toStrArray(code.getTablePrefix())); - generator.setIncludeTables(Func.toStrArray(code.getTableName())); - // 设置是否继承基础业务字段 - generator.setHasSuperEntity(code.getBaseMode() == 2); - // 控制器添加服务名前缀 - generator.setHasServiceName(Boolean.TRUE); - // 设置是否开启包装器模式 - generator.setHasWrapper(code.getWrapMode() == 2); - generator.run(); - }); - return R.success("代码生成成功"); - } - -} diff --git a/src/main/java/org/springblade/modules/develop/controller/DatasourceController.java b/src/main/java/org/springblade/modules/develop/controller/DatasourceController.java deleted file mode 100644 index a8f4cee..0000000 --- a/src/main/java/org/springblade/modules/develop/controller/DatasourceController.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * 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.modules.develop.controller; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; - -import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.ApiParam; -import lombok.AllArgsConstructor; -import org.springblade.core.boot.ctrl.BladeController; -import org.springblade.core.launch.constant.AppConstant; -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.modules.develop.entity.Datasource; -import org.springblade.modules.develop.service.IDatasourceService; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.List; - -/** - * 数据源配置表 控制器 - * - * @author Chill - */ -@RestController -@AllArgsConstructor -@RequestMapping(AppConstant.APPLICATION_DEVELOP_NAME + "/datasource") -@Api(value = "数据源配置表", tags = "数据源配置表接口") -public class DatasourceController extends BladeController { - - private IDatasourceService datasourceService; - - /** - * 详情 - */ - @GetMapping("/detail") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入datasource") - public R detail(Datasource datasource) { - Datasource detail = datasourceService.getOne(Condition.getQueryWrapper(datasource)); - return R.data(detail); - } - - /** - * 分页 数据源配置表 - */ - @GetMapping("/list") - @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入datasource") - public R> list(Datasource datasource, Query query) { - IPage pages = datasourceService.page(Condition.getPage(query), Condition.getQueryWrapper(datasource)); - return R.data(pages); - } - - /** - * 新增 数据源配置表 - */ - @PostMapping("/save") - @ApiOperationSupport(order = 4) - @ApiOperation(value = "新增", notes = "传入datasource") - public R save(@Valid @RequestBody Datasource datasource) { - return R.status(datasourceService.save(datasource)); - } - - /** - * 修改 数据源配置表 - */ - @PostMapping("/update") - @ApiOperationSupport(order = 5) - @ApiOperation(value = "修改", notes = "传入datasource") - public R update(@Valid @RequestBody Datasource datasource) { - return R.status(datasourceService.updateById(datasource)); - } - - /** - * 新增或修改 数据源配置表 - */ - @PostMapping("/submit") - @ApiOperationSupport(order = 6) - @ApiOperation(value = "新增或修改", notes = "传入datasource") - public R submit(@Valid @RequestBody Datasource datasource) { - datasource.setUrl(datasource.getUrl().replace("&", "&")); - return R.status(datasourceService.saveOrUpdate(datasource)); - } - - - /** - * 删除 数据源配置表 - */ - @PostMapping("/remove") - @ApiOperationSupport(order = 7) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(datasourceService.deleteLogic(Func.toLongList(ids))); - } - - /** - * 数据源列表 - */ - @GetMapping("/select") - @ApiOperationSupport(order = 8) - @ApiOperation(value = "下拉数据源", notes = "查询列表") - public R> select() { - List list = datasourceService.list(); - return R.data(list); - } - -} diff --git a/src/main/java/org/springblade/modules/develop/entity/Code.java b/src/main/java/org/springblade/modules/develop/entity/Code.java deleted file mode 100644 index b7a00c3..0000000 --- a/src/main/java/org/springblade/modules/develop/entity/Code.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * 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.modules.develop.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableName; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.io.Serializable; - -/** - * 实体类 - * - * @author Chill - */ -@Data -@TableName("blade_code") -@ApiModel(value = "Code对象", description = "Code对象") -public class Code implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 主键 - */ - @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.ASSIGN_ID) - @JsonSerialize(using = ToStringSerializer.class) - private Long id; - - /** - * 数据源主键 - */ - @ApiModelProperty(value = "数据源主键") - @JsonSerialize(using = ToStringSerializer.class) - private Long datasourceId; - - /** - * 模块名称 - */ - @ApiModelProperty(value = "服务名称") - private String serviceName; - - /** - * 模块名称 - */ - @ApiModelProperty(value = "模块名称") - private String codeName; - - /** - * 表名 - */ - @ApiModelProperty(value = "表名") - private String tableName; - - /** - * 实体名 - */ - @ApiModelProperty(value = "表前缀") - private String tablePrefix; - - /** - * 主键名 - */ - @ApiModelProperty(value = "主键名") - private String pkName; - - /** - * 基础业务模式 - */ - @ApiModelProperty(value = "基础业务模式") - private Integer baseMode; - - /** - * 包装器模式 - */ - @ApiModelProperty(value = "包装器模式") - private Integer wrapMode; - - /** - * 后端包名 - */ - @ApiModelProperty(value = "后端包名") - private String packageName; - - /** - * 后端路径 - */ - @ApiModelProperty(value = "后端路径") - private String apiPath; - - /** - * 前端路径 - */ - @ApiModelProperty(value = "前端路径") - private String webPath; - - /** - * 是否已删除 - */ - @TableLogic - @ApiModelProperty(value = "是否已删除") - private Integer isDeleted; - - -} diff --git a/src/main/java/org/springblade/modules/develop/entity/Datasource.java b/src/main/java/org/springblade/modules/develop/entity/Datasource.java deleted file mode 100644 index 58afb91..0000000 --- a/src/main/java/org/springblade/modules/develop/entity/Datasource.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * 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.modules.develop.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import lombok.Data; -import lombok.EqualsAndHashCode; -import org.springblade.core.mp.base.BaseEntity; - -/** - * 数据源配置表实体类 - * - * @author Chill - */ -@Data -@TableName("blade_datasource") -@EqualsAndHashCode(callSuper = true) -@ApiModel(value = "Datasource对象", description = "数据源配置表") -public class Datasource extends BaseEntity { - - private static final long serialVersionUID = 1L; - - /** - * 主键 - */ - @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.ASSIGN_ID) - @JsonSerialize(using = ToStringSerializer.class) - private Long id; - - /** - * 名称 - */ - @ApiModelProperty(value = "名称") - private String name; - /** - * 驱动类 - */ - @ApiModelProperty(value = "驱动类") - private String driverClass; - /** - * 连接地址 - */ - @ApiModelProperty(value = "连接地址") - private String url; - /** - * 用户名 - */ - @ApiModelProperty(value = "用户名") - private String username; - /** - * 密码 - */ - @ApiModelProperty(value = "密码") - private String password; - /** - * 备注 - */ - @ApiModelProperty(value = "备注") - private String remark; - - -} diff --git a/src/main/java/org/springblade/modules/develop/mapper/CodeMapper.java b/src/main/java/org/springblade/modules/develop/mapper/CodeMapper.java deleted file mode 100644 index 858a0d1..0000000 --- a/src/main/java/org/springblade/modules/develop/mapper/CodeMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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.modules.develop.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.springblade.modules.develop.entity.Code; - -/** - * Mapper 接口 - * - * @author Chill - */ -public interface CodeMapper extends BaseMapper { - -} diff --git a/src/main/java/org/springblade/modules/develop/mapper/CodeMapper.xml b/src/main/java/org/springblade/modules/develop/mapper/CodeMapper.xml deleted file mode 100644 index bec5490..0000000 --- a/src/main/java/org/springblade/modules/develop/mapper/CodeMapper.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/java/org/springblade/modules/develop/mapper/DatasourceMapper.java b/src/main/java/org/springblade/modules/develop/mapper/DatasourceMapper.java deleted file mode 100644 index 918e71c..0000000 --- a/src/main/java/org/springblade/modules/develop/mapper/DatasourceMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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.modules.develop.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.springblade.modules.develop.entity.Datasource; - -/** - * 数据源配置表 Mapper 接口 - * - * @author Chill - */ -public interface DatasourceMapper extends BaseMapper { - -} diff --git a/src/main/java/org/springblade/modules/develop/mapper/DatasourceMapper.xml b/src/main/java/org/springblade/modules/develop/mapper/DatasourceMapper.xml deleted file mode 100644 index 0d58c20..0000000 --- a/src/main/java/org/springblade/modules/develop/mapper/DatasourceMapper.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/java/org/springblade/modules/develop/service/ICodeService.java b/src/main/java/org/springblade/modules/develop/service/ICodeService.java deleted file mode 100644 index a62030e..0000000 --- a/src/main/java/org/springblade/modules/develop/service/ICodeService.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * 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.modules.develop.service; - - -import com.baomidou.mybatisplus.extension.service.IService; -import org.springblade.modules.develop.entity.Code; - -/** - * 服务类 - * - * @author Chill - */ -public interface ICodeService extends IService { - - /** - * 提交 - * - * @param code - * @return - */ - boolean submit(Code code); - -} diff --git a/src/main/java/org/springblade/modules/develop/service/IDatasourceService.java b/src/main/java/org/springblade/modules/develop/service/IDatasourceService.java deleted file mode 100644 index 37baa33..0000000 --- a/src/main/java/org/springblade/modules/develop/service/IDatasourceService.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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.modules.develop.service; - -import org.springblade.core.mp.base.BaseService; -import org.springblade.modules.develop.entity.Datasource; - -/** - * 数据源配置表 服务类 - * - * @author Chill - */ -public interface IDatasourceService extends BaseService { - -} diff --git a/src/main/java/org/springblade/modules/develop/service/impl/CodeServiceImpl.java b/src/main/java/org/springblade/modules/develop/service/impl/CodeServiceImpl.java deleted file mode 100644 index e09013a..0000000 --- a/src/main/java/org/springblade/modules/develop/service/impl/CodeServiceImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * 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.modules.develop.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springblade.core.tool.constant.BladeConstant; -import org.springblade.modules.develop.entity.Code; -import org.springblade.modules.develop.mapper.CodeMapper; -import org.springblade.modules.develop.service.ICodeService; -import org.springframework.stereotype.Service; - -/** - * 服务实现类 - * - * @author Chill - */ -@Service -public class CodeServiceImpl extends ServiceImpl implements ICodeService { - - @Override - public boolean submit(Code code) { - code.setIsDeleted(BladeConstant.DB_NOT_DELETED); - return saveOrUpdate(code); - } - -} diff --git a/src/main/java/org/springblade/modules/develop/service/impl/DatasourceServiceImpl.java b/src/main/java/org/springblade/modules/develop/service/impl/DatasourceServiceImpl.java deleted file mode 100644 index c66a855..0000000 --- a/src/main/java/org/springblade/modules/develop/service/impl/DatasourceServiceImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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.modules.develop.service.impl; - -import org.springblade.core.mp.base.BaseServiceImpl; -import org.springblade.modules.develop.entity.Datasource; -import org.springblade.modules.develop.mapper.DatasourceMapper; -import org.springblade.modules.develop.service.IDatasourceService; -import org.springframework.stereotype.Service; - -/** - * 数据源配置表 服务实现类 - * - * @author Chill - */ -@Service -public class DatasourceServiceImpl extends BaseServiceImpl implements IDatasourceService { - -} diff --git a/src/main/java/org/springblade/modules/desk/controller/BusinessMonitorController.java b/src/main/java/org/springblade/modules/monitor/controller/BusinessMonitorController.java similarity index 96% rename from src/main/java/org/springblade/modules/desk/controller/BusinessMonitorController.java rename to src/main/java/org/springblade/modules/monitor/controller/BusinessMonitorController.java index 32c46dd..acb8b44 100644 --- a/src/main/java/org/springblade/modules/desk/controller/BusinessMonitorController.java +++ b/src/main/java/org/springblade/modules/monitor/controller/BusinessMonitorController.java @@ -1,4 +1,4 @@ -package org.springblade.modules.desk.controller; +package org.springblade.modules.monitor.controller; import lombok.AllArgsConstructor; import org.apache.ibatis.annotations.Param; diff --git a/src/main/java/org/springblade/modules/monitor/controller/MonitorController.java b/src/main/java/org/springblade/modules/monitor/controller/MonitorController.java index db897da..7edb902 100644 --- a/src/main/java/org/springblade/modules/monitor/controller/MonitorController.java +++ b/src/main/java/org/springblade/modules/monitor/controller/MonitorController.java @@ -28,14 +28,14 @@ public class MonitorController { /** * 判断设备是否正常 */ - @GetMapping("/findList") + @GetMapping("/updateMonitorInfo") public void ifFestival(){ configMonitorService.updateMonitorInfo(); } /** - * 定时排查监控沈北状态 + * 定时排查监控设备状态 */ @GetMapping("/monitoringEquip") public void monitoringEquip(){ diff --git a/src/main/java/org/springblade/modules/desk/controller/SystemMonitorController.java b/src/main/java/org/springblade/modules/monitor/controller/SystemMonitorController.java similarity index 90% rename from src/main/java/org/springblade/modules/desk/controller/SystemMonitorController.java rename to src/main/java/org/springblade/modules/monitor/controller/SystemMonitorController.java index f223a3f..01c1078 100644 --- a/src/main/java/org/springblade/modules/desk/controller/SystemMonitorController.java +++ b/src/main/java/org/springblade/modules/monitor/controller/SystemMonitorController.java @@ -1,4 +1,4 @@ -package org.springblade.modules.desk.controller; +package org.springblade.modules.monitor.controller; import lombok.AllArgsConstructor; import org.springblade.core.tool.api.R; diff --git a/src/main/java/org/springblade/modules/monitor/entity/ConfigMonitor.java b/src/main/java/org/springblade/modules/monitor/entity/ConfigMonitor.java index 570ce4d..f2ba25e 100644 --- a/src/main/java/org/springblade/modules/monitor/entity/ConfigMonitor.java +++ b/src/main/java/org/springblade/modules/monitor/entity/ConfigMonitor.java @@ -99,4 +99,10 @@ public class ConfigMonitor extends BaseEntity { ) @ApiModelProperty("创建部门") private Long createDept; + + /** + * 服务颜色 + */ + @ApiModelProperty(value = "服务颜色") + private String color; } diff --git a/src/main/java/org/springblade/modules/monitor/mapper/ConfigMonitorMapper.xml b/src/main/java/org/springblade/modules/monitor/mapper/ConfigMonitorMapper.xml index 708fac4..f8f6f4d 100644 --- a/src/main/java/org/springblade/modules/monitor/mapper/ConfigMonitorMapper.xml +++ b/src/main/java/org/springblade/modules/monitor/mapper/ConfigMonitorMapper.xml @@ -20,9 +20,11 @@ - + + + @@ -36,6 +38,8 @@ a.type AS title, a.status AS "value", a.id AS "key", + a.monitor_type, + a.status, ( SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END diff --git a/src/main/java/org/springblade/modules/desk/mapper/MonitorMapper.java b/src/main/java/org/springblade/modules/monitor/mapper/MonitorMapper.java similarity index 96% rename from src/main/java/org/springblade/modules/desk/mapper/MonitorMapper.java rename to src/main/java/org/springblade/modules/monitor/mapper/MonitorMapper.java index 3c59f35..47f55d8 100644 --- a/src/main/java/org/springblade/modules/desk/mapper/MonitorMapper.java +++ b/src/main/java/org/springblade/modules/monitor/mapper/MonitorMapper.java @@ -1,4 +1,4 @@ -package org.springblade.modules.desk.mapper; +package org.springblade.modules.monitor.mapper; import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.Param; diff --git a/src/main/java/org/springblade/modules/desk/mapper/MonitorMapper.xml b/src/main/java/org/springblade/modules/monitor/mapper/MonitorMapper.xml similarity index 96% rename from src/main/java/org/springblade/modules/desk/mapper/MonitorMapper.xml rename to src/main/java/org/springblade/modules/monitor/mapper/MonitorMapper.xml index 4752b25..0369f07 100644 --- a/src/main/java/org/springblade/modules/desk/mapper/MonitorMapper.xml +++ b/src/main/java/org/springblade/modules/monitor/mapper/MonitorMapper.xml @@ -1,6 +1,6 @@ - +