添加ISC(服务管控模块)

This commit is contained in:
wenchaogong 2021-09-07 08:13:34 +08:00
parent 86359034e4
commit a5c951fbd8
26 changed files with 2611 additions and 1 deletions

10
pom.xml
View File

@ -261,13 +261,20 @@
<version>${ruoyi-vue-plus.version}</version>
</dependency>
<!-- demo模块 -->
<!-- oss模块 -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-oss</artifactId>
<version>${ruoyi-vue-plus.version}</version>
</dependency>
<!-- isc模块 -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-isc</artifactId>
<version>${ruoyi-vue-plus.version}</version>
</dependency>
<!-- demo模块 -->
<dependency>
<groupId>com.ruoyi</groupId>
@ -288,6 +295,7 @@
<module>ruoyi-demo</module>
<module>ruoyi-extend</module>
<module>ruoyi-oss</module>
<module>ruoyi-isc</module>
</modules>
<packaging>pom</packaging>

View File

@ -54,6 +54,12 @@
<artifactId>ruoyi-generator</artifactId>
</dependency>
<!-- isc模块 -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-isc</artifactId>
</dependency>
<!-- demo模块 -->
<dependency>
<groupId>com.ruoyi</groupId>

View File

@ -0,0 +1,11 @@
package com.ruoyi.common.constant;
public class IscConstants {
/** 待审核 */
public static final String AUDIT_WAIT = "0";
/** 待审核 */
public static final String ONLINE_STATUS_ON = "1";
}

View File

@ -0,0 +1,87 @@
package com.ruoyi.common.utils;
public final class FullPathUtils {
public static final int FULL_PATH_LENGTH = 30;
public static final int FULL_PATH_LEVEL_LENGTH = 3;
public static final char REPEAT_CHAR = '0';
public static final char REPEAT_CHAR_MAX = '9';
/**
* 生成 FULL_PATH
*
* @param parentFullPath 父级full_path (可空)
* @param maxFullPath 同级最大 full_path可空
* @return
*/
public static String genFullPath(String parentFullPath, String maxFullPath)
{
int maxNum = 0;
String parentPath = StringUtils.EMPTY;
if (StringUtils.isNotBlank(maxFullPath))
{
int start = maxFullPath.length() - FULL_PATH_LEVEL_LENGTH;
int end = maxFullPath.length() - 1;
int temp = 0;
while (start > -1)
{
temp = Integer.parseInt(maxFullPath.substring(start, end));
if (temp > 0)
{
parentPath = maxFullPath.substring(0, start);
break;
}
end = start;
start -= FULL_PATH_LEVEL_LENGTH;
}
maxNum = temp;
} else if (StringUtils.isNotBlank(parentFullPath))
{
parentPath = getParentPath(parentFullPath);
}
int repeat = FULL_PATH_LENGTH - parentPath.length() - FULL_PATH_LEVEL_LENGTH;
String suffix = StringUtils.repeat(REPEAT_CHAR, repeat);
return String.format("%s%03d%s", parentPath, ++maxNum, suffix);
}
/**
* 根据FULL_PATH 获取最大 子FULL_PATH
*
* @param fullPath
*/
public static String genMaxFullPath(String fullPath)
{
String parentPath = StringUtils.EMPTY;
if (StringUtils.isNotBlank(fullPath))
{
parentPath = getParentPath(fullPath);
}
int repeat = FULL_PATH_LENGTH - parentPath.length();
String suffix = StringUtils.repeat(REPEAT_CHAR_MAX, repeat);
return parentPath + suffix;
}
/**
* 获取父 Path
*
* @param fullPath
* @return
*/
private static String getParentPath(String fullPath)
{
int temp;
int start = fullPath.length() - FULL_PATH_LEVEL_LENGTH;
int end = fullPath.length() - 1;
while (start > -1)
{
temp = Integer.parseInt(fullPath.substring(start, end));
if (temp > 0)
{
return fullPath.substring(0, end);
}
end = start;
start -= FULL_PATH_LEVEL_LENGTH;
}
return StringUtils.EMPTY;
}
}

21
ruoyi-isc/pom.xml Normal file
View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi-vue-plus</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ruoyi-isc</artifactId>
<dependencies>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,140 @@
package com.ruoyi.isc.controller;
import java.util.List;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.lang.tree.TreeUtil;
import cn.hutool.core.lang.tree.parser.NodeParser;
import com.ruoyi.common.core.domain.entity.SysMenu;
import com.ruoyi.common.utils.TreeUtils;
import com.ruoyi.isc.domain.IscServiceCate;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import com.ruoyi.common.annotation.RepeatSubmit;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.isc.domain.vo.IscServiceCateVo;
import com.ruoyi.isc.domain.bo.IscServiceCateBo;
import com.ruoyi.isc.service.IIscServiceCateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* 服务分类Controller
*
* @author wenchao gong
* @date 2021-08-22
*/
@Validated
@Api(value = "服务分类控制器", tags = {"服务分类管理"})
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/isc/cate")
public class IscServiceCateController extends BaseController {
private final IIscServiceCateService cateService;
/**
* 查询服务分类列表
*/
@ApiOperation("查询服务分类列表")
@PreAuthorize("@ss.hasPermi('isc:cate:list')")
@GetMapping("/list")
public AjaxResult<List<IscServiceCateVo>> list(@Validated IscServiceCateBo bo)
{
List<IscServiceCateVo> list = cateService.queryList(bo);
return AjaxResult.success(list);
}
/**
* 获取分类下拉树列表
*/
@GetMapping("/treeselect")
public AjaxResult treeselect()
{
List<IscServiceCate> cates = cateService.selectCateList();
return AjaxResult.success(TreeUtils.build(cates, (cate, tree) -> {
tree.setId(cate.getCateId());
tree.setParentId(cate.getParentId());
tree.setName(cate.getCateName());
tree.setWeight(cate.getOrderNum());
tree.putExtra("fullPath", cate.getFullPath());
}));
}
/**
* 导出服务分类列表
*/
@ApiOperation("导出服务分类列表")
@PreAuthorize("@ss.hasPermi('isc:cate:export')")
@Log(title = "服务分类", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public void export(@Validated IscServiceCateBo bo, HttpServletResponse response)
{
List<IscServiceCateVo> list = cateService.queryList(bo);
ExcelUtil.exportExcel(list, "服务分类", IscServiceCateVo.class, response);
}
/**
* 获取服务分类详细信息
*/
@ApiOperation("获取服务分类详细信息")
@PreAuthorize("@ss.hasPermi('isc:cate:query')")
@GetMapping("/{cateId}")
public AjaxResult<IscServiceCateVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable("cateId") Long cateId)
{
return AjaxResult.success(cateService.queryById(cateId));
}
/**
* 新增服务分类
*/
@ApiOperation("新增服务分类")
@PreAuthorize("@ss.hasPermi('isc:cate:add')")
@Log(title = "服务分类", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public AjaxResult<Void> add(@Validated(AddGroup.class) @RequestBody IscServiceCateBo bo)
{
return toAjax(cateService.insertByBo(bo) ? 1 : 0);
}
/**
* 修改服务分类
*/
@ApiOperation("修改服务分类")
@PreAuthorize("@ss.hasPermi('isc:cate:edit')")
@Log(title = "服务分类", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public AjaxResult<Void> edit(@Validated(EditGroup.class) @RequestBody IscServiceCateBo bo)
{
return toAjax(cateService.updateByBo(bo) ? 1 : 0);
}
/**
* 删除服务分类
*/
@ApiOperation("删除服务分类")
@PreAuthorize("@ss.hasPermi('isc:cate:remove')")
@Log(title = "服务分类", businessType = BusinessType.DELETE)
@DeleteMapping("/{cateIds}")
public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] cateIds)
{
return toAjax(cateService.deleteWithValidByIds(Arrays.asList(cateIds), true) ? 1 : 0);
}
}

View File

@ -0,0 +1,112 @@
package com.ruoyi.isc.controller;
import java.util.List;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import com.ruoyi.common.annotation.RepeatSubmit;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.isc.domain.vo.IscServiceVo;
import com.ruoyi.isc.domain.bo.IscServiceBo;
import com.ruoyi.isc.service.IIscServiceService;
import com.ruoyi.common.core.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* 服务信息Controller
*
* @author ruoyi
* @date 2021-08-22
*/
@Validated
@Api(value = "服务信息控制器", tags = {"服务信息管理"})
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/isc/service")
public class IscServiceController extends BaseController {
private final IIscServiceService iIscServiceService;
/**
* 查询服务信息列表
*/
@ApiOperation("查询服务信息列表")
@PreAuthorize("@ss.hasPermi('isc:service:list')")
@GetMapping("/list")
public TableDataInfo<IscServiceVo> list(@Validated IscServiceBo bo) {
return iIscServiceService.queryPageList(bo);
}
/**
* 导出服务信息列表
*/
@ApiOperation("导出服务信息列表")
@PreAuthorize("@ss.hasPermi('isc:service:export')")
@Log(title = "服务信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public void export(@Validated IscServiceBo bo, HttpServletResponse response) {
List<IscServiceVo> list = iIscServiceService.queryList(bo);
ExcelUtil.exportExcel(list, "服务信息", IscServiceVo.class, response);
}
/**
* 获取服务信息详细信息
*/
@ApiOperation("获取服务信息详细信息")
@PreAuthorize("@ss.hasPermi('isc:service:query')")
@GetMapping("/{serviceId}")
public AjaxResult<IscServiceVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable("serviceId") Long serviceId) {
return AjaxResult.success(iIscServiceService.queryById(serviceId));
}
/**
* 新增服务信息
*/
@ApiOperation("新增服务信息")
@PreAuthorize("@ss.hasPermi('isc:service:add')")
@Log(title = "服务信息", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public AjaxResult<Void> add(@Validated(AddGroup.class) @RequestBody IscServiceBo bo) {
return toAjax(iIscServiceService.insertByBo(bo) ? 1 : 0);
}
/**
* 修改服务信息
*/
@ApiOperation("修改服务信息")
@PreAuthorize("@ss.hasPermi('isc:service:edit')")
@Log(title = "服务信息", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public AjaxResult<Void> edit(@Validated(EditGroup.class) @RequestBody IscServiceBo bo) {
return toAjax(iIscServiceService.updateByBo(bo) ? 1 : 0);
}
/**
* 删除服务信息
*/
@ApiOperation("删除服务信息")
@PreAuthorize("@ss.hasPermi('isc:service:remove')")
@Log(title = "服务信息" , businessType = BusinessType.DELETE)
@DeleteMapping("/{serviceIds}")
public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] serviceIds) {
return toAjax(iIscServiceService.deleteWithValidByIds(Arrays.asList(serviceIds), true) ? 1 : 0);
}
}

View File

@ -0,0 +1,132 @@
package com.ruoyi.isc.domain;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;
/**
* 服务信息对象 isc_service
*
* @author ruoyi
* @date 2021-08-22
*/
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("isc_service")
public class IscService implements Serializable {
private static final long serialVersionUID=1L;
/**
* 服务ID
*/
@TableId(value = "service_id")
private Long serviceId;
/**
* 服务名称
*/
private String serviceName;
/**
* 服务地址
*/
private String serviceAddr;
/**
* 探活地址
*/
private String probeActiveAddr;
/**
* 请求方式默认GET
*/
private String requestMethod;
/**
* 备注
*/
private String remark;
/**
* 跨域标志Y是 N否
*/
private String corsFlag;
/**
* 隐藏参数
*/
private String hiddenParams;
/**
* 是否在线0离线 1在线
*/
private String onlineStatus;
/**
* 审核状态0待审核 1审核通过 2驳回
*/
private String status;
/**
* JSON文档
*/
private String apiDoc;
/**
* 审核意见
*/
private String auditMind;
/**
* 服务状态0启用 1停用
*/
private String enabled;
/**
* 服务分类全路径
*/
private String cateFullPath;
/**
* 用户ID
*/
private Long userId;
/**
* 创建者
*/
@TableField(fill = FieldFill.INSERT)
private String createBy;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 更新者
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private String updateBy;
/**
* 更新时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
/**
* 删除标志0代表存在 2代表删除
*/
@TableLogic
private String delFlag;
}

View File

@ -0,0 +1,101 @@
package com.ruoyi.isc.domain;
import com.baomidou.mybatisplus.annotation.*;
import com.ruoyi.common.core.domain.entity.SysMenu;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.math.BigDecimal;
import java.util.List;
/**
* 服务分类对象 isc_service_cate
*
* @author wenchao gong
* @date 2021-08-22
*/
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("isc_service_cate")
public class IscServiceCate implements Serializable {
private static final long serialVersionUID=1L;
/**
* 分类ID
*/
@TableId(value = "cate_id")
private Long cateId;
/**
* 父分类ID
*/
private Long parentId;
/**
* 分类名称
*/
private String cateName;
/**
* 搜索全路径
*/
private String fullPath;
/**
* 服务状态0启用 1停用
*/
private String enabled;
/**
* 创建者
*/
@TableField(fill = FieldFill.INSERT)
private String createBy;
/**
* 显示顺序
*/
private Long orderNum;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 更新者
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private String updateBy;
/**
* 更新时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
/**
* 删除标志0代表存在 2代表删除
*/
@TableLogic
private String delFlag;
/**
* 备注
*/
private String remark;
/**
* 子分类
*/
@TableField(exist = false)
private List<SysMenu> children = new ArrayList<SysMenu>();
}

View File

@ -0,0 +1,132 @@
package com.ruoyi.isc.domain.bo;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.*;
import java.util.Date;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 服务信息业务对象 isc_service
*
* @author ruoyi
* @date 2021-08-22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("服务信息业务对象")
public class IscServiceBo extends BaseEntity {
/**
* 服务名称
*/
@ApiModelProperty(value = "服务名称", required = true)
@NotBlank(message = "服务名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String serviceName;
/**
* 服务地址
*/
@ApiModelProperty(value = "服务地址", required = true)
@NotBlank(message = "服务地址不能为空", groups = { AddGroup.class, EditGroup.class })
private String serviceAddr;
/**
* 探活地址
*/
@ApiModelProperty(value = "探活地址", required = true)
@NotBlank(message = "探活地址不能为空", groups = { AddGroup.class, EditGroup.class })
private String probeActiveAddr;
/**
* 请求方式默认GET
*/
@ApiModelProperty(value = "请求方式默认GET", required = true)
@NotBlank(message = "请求方式默认GET不能为空", groups = { AddGroup.class, EditGroup.class })
private String requestMethod;
/**
* 跨域标志Y是 N否
*/
@ApiModelProperty(value = "跨域标志Y是 N否", required = true)
@NotBlank(message = "跨域标志Y是 N否不能为空", groups = { AddGroup.class, EditGroup.class })
private String corsFlag;
/**
* 隐藏参数
*/
@ApiModelProperty(value = "隐藏参数")
private String hiddenParams;
/**
* 是否在线0离线 1在线
*/
@ApiModelProperty(value = "是否在线0离线 1在线")
private String onlineStatus;
/**
* 审核状态0待审核 1审核通过 2驳回
*/
@ApiModelProperty(value = "审核状态0待审核 1审核通过 2驳回")
private String status;
/**
* JSON文档
*/
@ApiModelProperty(value = "JSON文档", required = true)
@NotBlank(message = "JSON文档不能为空", groups = { AddGroup.class, EditGroup.class })
private String apiDoc;
/**
* 服务状态0启用 1停用
*/
@ApiModelProperty(value = "服务状态0启用 1停用", required = true)
@NotBlank(message = "服务状态0启用 1停用不能为空", groups = { AddGroup.class, EditGroup.class })
private String enabled;
/**
* 服务分类
*/
@ApiModelProperty(value = "服务分类", required = true)
@NotNull(message = "服务分类不能为空", groups = { AddGroup.class, EditGroup.class })
private String cateFullPath;
/**
* 用户ID
*/
@ApiModelProperty(value = "用户ID", required = true)
private Long userId;
/**
* 分页大小
*/
@ApiModelProperty("分页大小")
private Integer pageSize;
/**
* 当前页数
*/
@ApiModelProperty("当前页数")
private Integer pageNum;
/**
* 排序列
*/
@ApiModelProperty("排序列")
private String orderByColumn;
/**
* 排序的方向desc或者asc
*/
@ApiModelProperty(value = "排序的方向", example = "asc,desc")
private String isAsc;
}

View File

@ -0,0 +1,71 @@
package com.ruoyi.isc.domain.bo;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.*;
import java.util.Date;
import com.ruoyi.common.core.domain.TreeEntity;
/**
* 服务分类业务对象 isc_service_cate
*
* @author wenchao gong
* @date 2021-08-22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("服务分类业务对象")
public class IscServiceCateBo extends TreeEntity {
/**
* 分类ID
*/
@ApiModelProperty(value = "分类ID")
private Long cateId;
/**
* 分类名称
*/
@ApiModelProperty(value = "分类名称")
private String cateName;
/**
* 服务状态0启用 1停用
*/
@ApiModelProperty(value = "服务状态0启用 1停用", required = true)
@NotBlank(message = "服务状态0启用 1停用不能为空", groups = { AddGroup.class, EditGroup.class })
private String enabled;
/**
* 分页大小
*/
@ApiModelProperty("分页大小")
private Integer pageSize;
/**
* 当前页数
*/
@ApiModelProperty("当前页数")
private Integer pageNum;
/**
* 排序列
*/
@ApiModelProperty("排序列")
private String orderByColumn;
/**
* 排序的方向desc或者asc
*/
@ApiModelProperty(value = "排序的方向", example = "asc,desc")
private String isAsc;
}

View File

@ -0,0 +1,84 @@
package com.ruoyi.isc.domain.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.ruoyi.common.annotation.ExcelDictFormat;
import com.ruoyi.common.convert.ExcelDictConvert;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* 服务分类视图对象 isc_service_cate
*
* @author wenchao gong
* @date 2021-08-22
*/
@Data
@ApiModel("服务分类视图对象")
@ExcelIgnoreUnannotated
public class IscServiceCateVo {
private static final long serialVersionUID = 1L;
/**
* 分类ID
*/
@ApiModelProperty("分类ID")
private Long cateId;
/**
* 父分类ID
*/
@ExcelProperty(value = "父分类ID")
@ApiModelProperty("父分类ID")
private Long parentId;
/**
* 分类名称
*/
@ExcelProperty(value = "分类名称")
@ApiModelProperty("分类名称")
private String cateName;
/**
* 服务状态0启用 1停用
*/
@ExcelProperty(value = "服务状态", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "sys_normal_disable")
@ApiModelProperty("服务状态0启用 1停用")
private String enabled;
/**
* 显示顺序
*/
@ExcelProperty(value = "显示顺序")
@ApiModelProperty("显示顺序")
private Long orderNum;
/**
* 更新者
*/
@ExcelProperty(value = "更新者")
@ApiModelProperty("更新者")
private String updateBy;
/**
* 更新时间
*/
@ExcelProperty(value = "更新时间")
@ApiModelProperty("更新时间")
private Date updateTime;
/**
* 备注
*/
@ExcelProperty(value = "备注")
@ApiModelProperty("备注")
private String remark;
}

View File

@ -0,0 +1,139 @@
package com.ruoyi.isc.domain.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.ruoyi.common.annotation.ExcelDictFormat;
import com.ruoyi.common.convert.ExcelDictConvert;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* 服务信息视图对象 isc_service
*
* @author ruoyi
* @date 2021-08-22
*/
@Data
@ApiModel("服务信息视图对象")
@ExcelIgnoreUnannotated
public class IscServiceVo {
private static final long serialVersionUID = 1L;
/**
* 服务ID
*/
@ApiModelProperty("服务ID")
private Long serviceId;
/**
* 服务名称
*/
@ExcelProperty(value = "服务名称")
@ApiModelProperty("服务名称")
private String serviceName;
/**
* 服务地址
*/
@ExcelProperty(value = "服务地址")
@ApiModelProperty("服务地址")
private String serviceAddr;
/**
* 探活地址
*/
@ExcelProperty(value = "探活地址")
@ApiModelProperty("探活地址")
private String probeActiveAddr;
/**
* 请求方式默认GET
*/
@ExcelProperty(value = "请求方式")
@ApiModelProperty("请求方式默认GET")
private String requestMethod;
/**
* 备注
*/
@ApiModelProperty("备注")
private String remark;
/**
* 跨域标志Y是 N否
*/
@ExcelProperty(value = "跨域标志")
@ApiModelProperty("跨域标志Y是 N否")
private String corsFlag;
/**
* 隐藏参数
*/
@ExcelProperty(value = "隐藏参数")
@ApiModelProperty("隐藏参数")
private String hiddenParams;
/**
* JSON文档
*/
@ApiModelProperty("JSON文档")
private String apiDoc;
/**
* 是否在线0离线 1在线
*/
@ExcelProperty(value = "是否在线", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "isc_online_status")
@ApiModelProperty("是否在线0离线 1在线")
private String onlineStatus;
/**
* 审核状态0待审核 1审核通过 2驳回
*/
@ExcelProperty(value = "审核状态", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "sys_audit_status")
@ApiModelProperty("审核状态0待审核 1审核通过 2驳回")
private String status;
/**
* 服务状态0启用 1停用
*/
@ExcelProperty(value = "服务状态", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "sys_normal_disable")
@ApiModelProperty("服务状态0启用 1停用")
private String enabled;
/**
* 服务分类
*/
@ApiModelProperty("服务分类")
private String cateFullPath;
/**
* 服务分类名称
*/
@ExcelProperty(value = "服务分类名称")
@ApiModelProperty("服务分类名称")
private String cateName;
/**
* 更新人
*/
@ExcelProperty(value = "更新人")
@ApiModelProperty("更新人")
private String updateBy;
/**
* 更新时间
*/
@ExcelProperty(value = "更新时间")
@ApiModelProperty("更新时间")
private String updateTime;
}

View File

@ -0,0 +1,16 @@
package com.ruoyi.isc.mapper;
import com.ruoyi.isc.domain.IscServiceCate;
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
import org.apache.ibatis.annotations.CacheNamespace;
/**
* 服务分类Mapper接口
*
* @author wenchao gong
* @date 2021-08-22
*/
public interface IscServiceCateMapper extends BaseMapperPlus<IscServiceCate> {
}

View File

@ -0,0 +1,16 @@
package com.ruoyi.isc.mapper;
import com.ruoyi.isc.domain.IscService;
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
import org.apache.ibatis.annotations.CacheNamespace;
/**
* 服务信息Mapper接口
*
* @author ruoyi
* @date 2021-08-22
*/
public interface IscServiceMapper extends BaseMapperPlus<IscService> {
}

View File

@ -0,0 +1,67 @@
package com.ruoyi.isc.service;
import com.ruoyi.common.core.domain.entity.SysMenu;
import com.ruoyi.isc.domain.IscServiceCate;
import com.ruoyi.isc.domain.vo.IscServiceCateVo;
import com.ruoyi.isc.domain.bo.IscServiceCateBo;
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 服务分类Service接口
*
* @author wenchao gong
* @date 2021-08-22
*/
public interface IIscServiceCateService extends IServicePlus<IscServiceCate, IscServiceCateVo> {
/**
* 查询单个
* @return
*/
IscServiceCateVo queryById(Long cateId);
/**
* 查询列表
*/
List<IscServiceCateVo> queryList(IscServiceCateBo bo);
/**
* 根据新增业务对象插入服务分类
* @param bo 服务分类新增业务对象
* @return
*/
Boolean insertByBo(IscServiceCateBo bo);
/**
* 根据编辑业务对象修改服务分类
* @param bo 服务分类编辑业务对象
* @return
*/
Boolean updateByBo(IscServiceCateBo bo);
/**
* 校验并删除数据
* @param ids 主键集合
* @param isValid 是否校验,true-删除前校验,false-不校验
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
/**
* 获取分类信息
* @return 分类列表
*/
List<IscServiceCate> selectCateList();
/**
* 批量获取分类名称
* @param fullPathList
* @return
*/
Map<String, String> batchCateName(Set<String> fullPathList);
}

View File

@ -0,0 +1,56 @@
package com.ruoyi.isc.service;
import com.ruoyi.isc.domain.IscService;
import com.ruoyi.isc.domain.vo.IscServiceVo;
import com.ruoyi.isc.domain.bo.IscServiceBo;
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
import com.ruoyi.common.core.page.TableDataInfo;
import java.util.Collection;
import java.util.List;
/**
* 服务信息Service接口
*
* @author ruoyi
* @date 2021-08-22
*/
public interface IIscServiceService extends IServicePlus<IscService, IscServiceVo> {
/**
* 查询单个
* @return
*/
IscServiceVo queryById(Long serviceId);
/**
* 查询列表
*/
TableDataInfo<IscServiceVo> queryPageList(IscServiceBo bo);
/**
* 查询列表
*/
List<IscServiceVo> queryList(IscServiceBo bo);
/**
* 根据新增业务对象插入服务信息
* @param bo 服务信息新增业务对象
* @return
*/
Boolean insertByBo(IscServiceBo bo);
/**
* 根据编辑业务对象修改服务信息
* @param bo 服务信息编辑业务对象
* @return
*/
Boolean updateByBo(IscServiceBo bo);
/**
* 校验并删除数据
* @param ids 主键集合
* @param isValid 是否校验,true-删除前校验,false-不校验
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

View File

@ -0,0 +1,158 @@
package com.ruoyi.isc.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.utils.FullPathUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.isc.domain.bo.IscServiceCateBo;
import com.ruoyi.isc.domain.vo.IscServiceCateVo;
import com.ruoyi.isc.domain.IscServiceCate;
import com.ruoyi.isc.mapper.IscServiceCateMapper;
import com.ruoyi.isc.service.IIscServiceCateService;
import java.util.*;
import java.util.stream.Collectors;
/**
* 服务分类Service业务层处理
*
* @author wenchao gong
* @date 2021-08-22
*/
@Service
public class IscServiceCateServiceImpl extends ServicePlusImpl<IscServiceCateMapper, IscServiceCate, IscServiceCateVo> implements IIscServiceCateService {
@Override
public IscServiceCateVo queryById(Long cateId){
return getVoById(cateId);
}
@Override
public List<IscServiceCateVo> queryList(IscServiceCateBo bo) {
return listVo(buildQueryWrapper(bo));
}
private LambdaQueryWrapper<IscServiceCate> buildQueryWrapper(IscServiceCateBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<IscServiceCate> lqw = Wrappers.lambdaQuery();
lqw.like(StringUtils.isNotBlank(bo.getCateName()), IscServiceCate::getCateName, bo.getCateName());
lqw.eq(StringUtils.isNotBlank(bo.getEnabled()), IscServiceCate::getEnabled, bo.getEnabled());
return lqw;
}
@Override
public Boolean insertByBo(IscServiceCateBo bo) {
IscServiceCate add = BeanUtil.toBean(bo, IscServiceCate.class);
validEntityBeforeSave(add);
add.setFullPath(getFullPath(bo.getParentId()));
return save(add);
}
/**
* 通过父ID生成 FULL_PATH
* @param parentId
* @return
*/
private String getFullPath(Long parentId)
{
final boolean isRoot = parentId == 0L;
IscServiceCate cate = getOne(Wrappers.<IscServiceCate>lambdaQuery()
.select(IscServiceCate::getCateId, IscServiceCate::getFullPath)
.eq(isRoot, IscServiceCate::getParentId, 0L).and(!isRoot, w -> w
.eq(IscServiceCate::getParentId, parentId)
.or()
.eq(IscServiceCate::getCateId, parentId))
.orderByDesc(IscServiceCate::getFullPath)
.last("LIMIT 1"));
String parentFullPath = null;
String maxFullPath = null;
if(Objects.nonNull(cate)){
if(cate.getCateId().intValue() == parentId)
{
parentFullPath = cate.getFullPath();
}else{
maxFullPath = cate.getFullPath();
}
}
final String fullPath = FullPathUtils.genFullPath(parentFullPath, maxFullPath);
return fullPath;
}
@Override
public Boolean updateByBo(IscServiceCateBo bo) {
IscServiceCate update = BeanUtil.toBean(bo, IscServiceCate.class);
validEntityBeforeSave(update);
return updateById(update);
}
/**
* 保存前的数据校验
*
* @param entity 实体类数据
*/
private void validEntityBeforeSave(IscServiceCate entity){
//TODO 做一些数据校验,如唯一约束
}
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return removeByIds(ids);
}
@Override
public List<IscServiceCate> selectCateList()
{
return list(Wrappers.<IscServiceCate>lambdaQuery()
.eq(IscServiceCate::getEnabled, UserConstants.DICT_NORMAL)
.orderByAsc(IscServiceCate::getParentId)
.orderByAsc(IscServiceCate::getOrderNum));
}
@Override
public Map<String, String> batchCateName(Set<String> fullPathList)
{
Map<String, String> results = new HashMap<>();
if(CollectionUtils.isEmpty(fullPathList)) {
return results;
}
final List<IscServiceCate> list = list(Wrappers.<IscServiceCate>lambdaQuery()
.select(IscServiceCate::getCateId, IscServiceCate::getCateName, IscServiceCate::getFullPath, IscServiceCate::getParentId)
.in(IscServiceCate::getFullPath, fullPathList));
Map<Long, String> cateNameMap = batchCateName(list);
for (IscServiceCate cate : list)
{
results.put(cate.getFullPath(), cateNameMap.get(cate.getCateId()));
}
return results;
}
private Map<Long, String> batchCateName(List<IscServiceCate> list) {
Map<Long, String> results = new HashMap<>();
final Set<Long> parentIds = list.stream().filter(m -> m.getParentId() != 0L).map(IscServiceCate::getParentId).collect(Collectors.toSet());
if(CollectionUtils.isNotEmpty(parentIds)) {
final List<IscServiceCate> parentList = list(Wrappers.<IscServiceCate>lambdaQuery()
.select(IscServiceCate::getCateId, IscServiceCate::getCateName, IscServiceCate::getFullPath, IscServiceCate::getParentId)
.in(IscServiceCate::getCateId, parentIds));
results.putAll(batchCateName(parentList));
}
for (IscServiceCate cate : list)
{
final String parentName = results.get(cate.getParentId());
if(StringUtils.isBlank(parentName)) {
results.put(cate.getCateId(), cate.getCateName());
}else{
results.put(cate.getCateId(), String.format("%s/%s", parentName, cate.getCateName()));
}
}
return results;
}
}

View File

@ -0,0 +1,127 @@
package com.ruoyi.isc.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.constant.IscConstants;
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
import com.ruoyi.common.core.page.PagePlus;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.FullPathUtils;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.isc.domain.IscService;
import com.ruoyi.isc.domain.bo.IscServiceBo;
import com.ruoyi.isc.domain.vo.IscServiceVo;
import com.ruoyi.isc.mapper.IscServiceMapper;
import com.ruoyi.isc.service.IIscServiceCateService;
import com.ruoyi.isc.service.IIscServiceService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 服务信息Service业务层处理
*
* @author ruoyi
* @date 2021-08-22
*/
@Service
public class IscServiceServiceImpl extends ServicePlusImpl<IscServiceMapper, IscService, IscServiceVo> implements IIscServiceService {
@Resource
private IIscServiceCateService cateService;
@Override
public IscServiceVo queryById(Long serviceId)
{
return getVoById(serviceId);
}
@Override
public TableDataInfo<IscServiceVo> queryPageList(IscServiceBo bo)
{
PagePlus<IscService, IscServiceVo> result = pageVo(PageUtils.buildPagePlus(), buildQueryWrapper(bo));
genVoInfo(result.getRecordsVo());
return PageUtils.buildDataInfo(result);
}
@Override
public List<IscServiceVo> queryList(IscServiceBo bo)
{
final List<IscServiceVo> results = listVo(buildQueryWrapper(bo));
return results;
}
private void genVoInfo(List<IscServiceVo> results)
{
if (CollectionUtils.isNotEmpty(results))
{
Map<String, String> cateNameMap = cateService.batchCateName(results.stream()
.map(IscServiceVo::getCateFullPath).collect(Collectors.toSet()));
for (IscServiceVo result : results)
{
result.setCateName(cateNameMap.get(result.getCateFullPath()));
}
}
}
private LambdaQueryWrapper<IscService> buildQueryWrapper(IscServiceBo bo)
{
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<IscService> lqw = Wrappers.lambdaQuery();
lqw.like(StringUtils.isNotBlank(bo.getServiceName()), IscService::getServiceName, bo.getServiceName());
lqw.eq(StringUtils.isNotBlank(bo.getOnlineStatus()), IscService::getOnlineStatus, bo.getOnlineStatus());
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), IscService::getStatus, bo.getStatus());
lqw.eq(StringUtils.isNotBlank(bo.getEnabled()), IscService::getEnabled, bo.getEnabled());
lqw.ge(StringUtils.isNotBlank(bo.getCateFullPath()), IscService::getCateFullPath, bo.getCateFullPath());
lqw.le(StringUtils.isNotBlank(bo.getCateFullPath()), IscService::getCateFullPath, FullPathUtils.genMaxFullPath(bo.getCateFullPath()));
lqw.eq(bo.getUserId() != null, IscService::getUserId, bo.getUserId());
return lqw;
}
@Override
public Boolean insertByBo(IscServiceBo bo)
{
IscService add = BeanUtil.toBean(bo, IscService.class);
validEntityBeforeSave(add);
add.setUserId(SecurityUtils.getUserId());
add.setOnlineStatus(IscConstants.ONLINE_STATUS_ON);
add.setStatus(IscConstants.AUDIT_WAIT);
return save(add);
}
@Override
public Boolean updateByBo(IscServiceBo bo)
{
IscService update = BeanUtil.toBean(bo, IscService.class);
validEntityBeforeSave(update);
return updateById(update);
}
/**
* 保存前的数据校验
*
* @param entity 实体类数据
*/
private void validEntityBeforeSave(IscService entity)
{
//TODO 做一些数据校验,如唯一约束
}
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid)
{
if (isValid)
{
//TODO 做一些业务上的校验,判断是否需要校验
}
return removeByIds(ids);
}
}

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.isc.mapper.IscServiceCateMapper">
<resultMap type="com.ruoyi.isc.domain.IscServiceCate" id="IscServiceCateResult">
<result property="cateId" column="cate_id"/>
<result property="parentId" column="parent_id"/>
<result property="cateName" column="cate_name"/>
<result property="enabled" column="enabled"/>
<result property="createBy" column="create_by"/>
<result property="orderNum" column="order_num"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="delFlag" column="del_flag"/>
<result property="remark" column="remark"/>
</resultMap>
</mapper>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.isc.mapper.IscServiceMapper">
<resultMap type="com.ruoyi.isc.domain.IscService" id="IscServiceResult">
<result property="serviceId" column="service_id"/>
<result property="serviceName" column="service_name"/>
<result property="serviceAddr" column="service_addr"/>
<result property="probeActiveAddr" column="probe_active_addr"/>
<result property="requestMethod" column="request_method"/>
<result property="remark" column="remark"/>
<result property="corsFlag" column="cors_flag"/>
<result property="hiddenParams" column="hidden_params"/>
<result property="onlineStatus" column="online_status"/>
<result property="status" column="status"/>
<result property="apiDoc" column="api_doc"/>
<result property="auditMind" column="audit_mind"/>
<result property="enabled" column="enabled"/>
<result property="cateFullPath" column="cate_full_path"/>
<result property="userId" column="user_id"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="delFlag" column="del_flag"/>
</resultMap>
</mapper>

View File

@ -0,0 +1,52 @@
import request from '@/utils/request'
// 查询服务分类列表
export function listCate(query) {
return request({
url: '/isc/cate/list',
method: 'get',
params: query
})
}
// 查询服务分类详细
export function getCate(cateId) {
return request({
url: '/isc/cate/' + cateId,
method: 'get'
})
}
// 新增服务分类
export function addCate(data) {
return request({
url: '/isc/cate',
method: 'post',
data: data
})
}
// 修改服务分类
export function updateCate(data) {
return request({
url: '/isc/cate',
method: 'put',
data: data
})
}
// 删除服务分类
export function delCate(cateId) {
return request({
url: '/isc/cate/' + cateId,
method: 'delete'
})
}
// 查询服务分类下拉树结构
export function treeselect() {
return request({
url: '/isc/cate/treeselect',
method: 'get'
})
}

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询服务信息列表
export function listService(query) {
return request({
url: '/isc/service/list',
method: 'get',
params: query
})
}
// 查询服务信息详细
export function getService(serviceId) {
return request({
url: '/isc/service/' + serviceId,
method: 'get'
})
}
// 新增服务信息
export function addService(data) {
return request({
url: '/isc/service',
method: 'post',
data: data
})
}
// 修改服务信息
export function updateService(data) {
return request({
url: '/isc/service',
method: 'put',
data: data
})
}
// 删除服务信息
export function delService(serviceId) {
return request({
url: '/isc/service/' + serviceId,
method: 'delete'
})
}

View File

@ -0,0 +1,314 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="分类名称" prop="cateName">
<el-input
v-model="queryParams.cateName"
placeholder="请输入分类名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="服务状态" prop="enabled">
<el-select v-model="queryParams.enabled" placeholder="请选择服务状态" clearable size="small">
<el-option
v-for="dict in enabledOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['isc:cate:add']"
>新增</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="cateList"
row-key="cateId"
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column label="分类名称" align="center" prop="cateName" width="160"/>
<el-table-column label="服务状态" align="center" prop="enabled" :formatter="enabledFormat" />
<el-table-column label="显示顺序" align="center" prop="orderNum" />
<el-table-column label="更新者" align="center" prop="updateBy" />
<el-table-column label="更新时间" align="center" prop="updateTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['isc:cate:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['isc:cate:add']"
>新增</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['isc:cate:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 添加或修改服务分类对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="父分类" prop="parentId">
<treeselect v-model="form.parentId" :options="cateOptions" :normalizer="normalizer" placeholder="请选择父分类ID" />
</el-form-item>
<el-form-item label="分类名称" prop="cateName">
<el-input v-model="form.cateName" placeholder="请输入分类名称" />
</el-form-item>
<el-form-item label="服务状态" prop="enabled">
<el-radio-group v-model="form.enabled">
<el-radio
v-for="dict in enabledOptions"
:key="dict.dictValue"
:label="dict.dictValue"
>{{dict.dictLabel}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="显示顺序" prop="orderNum">
<el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listCate, getCate, delCate, addCate, updateCate } from "@/api/isc/cate";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "Cate",
components: {
Treeselect
},
data() {
return {
// loading
buttonLoading: false,
//
loading: true,
//
showSearch: true,
//
cateList: [],
//
cateOptions: [],
//
title: "",
//
open: false,
//
enabledOptions: [],
//
queryParams: {
cateName: null,
enabled: null,
},
//
form: {},
//
rules: {
parentId: [
{ required: true, message: "父分类不能为空", trigger: "change" }
],
cateName: [
{ required: true, message: "分类名称不能为空", trigger: "change" },
{ min: 2, max: 10, message: '长度在 2 到 10 个字符', trigger: 'blur' }
],
enabled: [
{ required: true, message: "服务状态不能为空", trigger: "change" }
],
orderNum: [
{ required: true, message: "显示顺序不能为空", trigger: "change" }
]
}
};
},
created() {
this.getList();
this.getDicts("sys_normal_disable").then(response => {
this.enabledOptions = response.data;
});
},
methods: {
/** 查询服务分类列表 */
getList() {
this.loading = true;
listCate(this.queryParams).then(response => {
this.cateList = this.handleTree(response.data, "cateId", "parentId");
this.loading = false;
});
},
/** 转换服务分类数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.cateId,
label: node.cateName,
children: node.children
};
},
/** 查询服务分类下拉树结构 */
getTreeselect() {
listCate().then(response => {
this.cateOptions = [];
const data = { cateId: 0, cateName: '顶级节点', children: [] };
data.children = this.handleTree(response.data, "cateId", "parentId");
this.cateOptions.push(data);
});
},
//
enabledFormat(row, column) {
return this.selectDictLabel(this.enabledOptions, row.enabled);
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
cateId: null,
parentId: 0,
cateName: null,
enabled: "0",
createBy: null,
orderNum: 99,
createTime: null,
updateBy: null,
updateTime: null,
delFlag: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd(row) {
this.reset();
this.getTreeselect();
if (row != null && row.cateId) {
this.form.parentId = row.cateId;
} else {
this.form.parentId = 0;
}
this.open = true;
this.title = "添加服务分类";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
this.getTreeselect();
if (row != null) {
this.form.parentId = row.cateId;
}
getCate(row.cateId).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改服务分类";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.cateId != null) {
updateCate(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addCate(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$confirm('是否确认删除服务分类编号为"' + row.cateId + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.loading = true;
return delCate(row.cateId);
}).then(() => {
this.loading = false;
this.getList();
this.msgSuccess("删除成功");
}).finally(() => {
this.loading = false;
});
}
}
};
</script>

View File

@ -0,0 +1,446 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="服务名称" prop="serviceName">
<el-input
v-model="queryParams.serviceName"
placeholder="请输入服务名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="是否在线" prop="onlineStatus">
<el-select v-model="queryParams.onlineStatus" placeholder="请选择是否在线" clearable size="small">
<el-option
v-for="dict in onlineStatusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="审核状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择审核状态" clearable size="small">
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="服务状态" prop="enabled">
<el-select v-model="queryParams.enabled" placeholder="请选择服务状态" clearable size="small">
<el-option
v-for="dict in enabledOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="服务分类" prop="cateFullPath">
<treeselect v-model="queryParams.cateFullPath" :options="cateOptions" :show-count="true" :normalizer="normalizer" placeholder="请选择服务分类" style="width:215px"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['isc:service:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['isc:service:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['isc:service:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['isc:service:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="serviceList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="服务ID" align="center" prop="serviceId" v-if="false"/>
<el-table-column label="服务名称" align="center" prop="serviceName" />
<el-table-column label="服务分类" align="center" prop="cateName" />
<el-table-column label="服务状态" align="center" prop="enabled" :formatter="enabledFormat" />
<el-table-column label="是否在线" align="center" prop="onlineStatus" :formatter="onlineStatusFormat" />
<el-table-column label="审核状态" align="center" prop="status" :formatter="statusFormat" />
<el-table-column label="更新人" align="center" prop="updateBy" />
<el-table-column label="更新时间" align="center" prop="updateTime" >
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['isc:service:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['isc:service:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改服务信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="服务分类" prop="cateFullPath">
<treeselect v-model="form.cateFullPath" :options="cateOptions" :show-count="true" :normalizer="normalizer" placeholder="请选择服务分类" />
</el-form-item>
<el-form-item label="服务名称" prop="serviceName">
<el-input v-model="form.serviceName" placeholder="请输入服务名称" />
</el-form-item>
<el-form-item label="服务地址" prop="serviceAddr">
<el-input v-model="form.serviceAddr" placeholder="请输入服务地址" />
</el-form-item>
<el-form-item label="探活地址" prop="probeActiveAddr">
<el-input v-model="form.probeActiveAddr" placeholder="请输入探活地址" />
</el-form-item>
<el-form-item label="请求方式" prop="requestMethod">
<el-input v-model="form.requestMethod" placeholder="请输入请求方式" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="跨域标志">
<el-radio-group v-model="form.corsFlag">
<el-radio
v-for="dict in corsFlagOptions"
:key="dict.dictValue"
:label="dict.dictValue"
>{{dict.dictLabel}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="隐藏参数" prop="hiddenParams">
<el-input v-model="form.hiddenParams" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="JSON文档" prop="apiDoc">
<el-input v-model="form.apiDoc" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listService, getService, delService, addService, updateService } from "@/api/isc/service";
import { treeselect } from "@/api/isc/cate";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { downLoadExcel } from "@/utils/download";
export default {
name: "Service",
components: { Treeselect },
data() {
return {
// loading
buttonLoading: false,
//
loading: true,
//
exportLoading: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
serviceList: [],
//
title: "",
//
open: false,
//
corsFlagOptions: [],
// 线
onlineStatusOptions: [],
//
statusOptions: [],
//
enabledOptions: [],
//
cateOptions:[],
//
queryParams: {
pageNum: 1,
pageSize: 10,
serviceName: undefined,
onlineStatus: undefined,
status: undefined,
enabled: undefined,
cateFullPath: undefined,
userId: undefined,
},
//
form: {},
//
rules: {
serviceName: [
{ required: true, message: "服务名称不能为空", trigger: "blur" }
],
serviceAddr: [
{ required: true, message: "服务地址不能为空", trigger: "blur" }
],
probeActiveAddr: [
{ required: true, message: "探活地址不能为空", trigger: "blur" }
],
requestMethod: [
{ required: true, message: "请求方式不能为空", trigger: "blur" }
],
corsFlag: [
{ required: true, message: "跨域标志不能为空", trigger: "blur" }
],
apiDoc: [
{ required: true, message: "JSON文档不能为空", trigger: "blur" }
],
enabled: [
{ required: true, message: "服务状态不能为空", trigger: "blur" }
],
cateFullPath: [
{ required: true, message: "服务分类不能为空", trigger: "change" }
],
userId: [
{ required: true, message: "用户ID不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
this.getTreeselect();
this.getDicts("sys_yes_no").then(response => {
this.corsFlagOptions = response.data;
});
this.getDicts("isc_online_status").then(response => {
this.onlineStatusOptions = response.data;
});
this.getDicts("sys_audit_status").then(response => {
this.statusOptions = response.data;
});
this.getDicts("sys_normal_disable").then(response => {
this.enabledOptions = response.data;
});
},
methods: {
/** 查询服务信息列表 */
getList() {
this.loading = true;
listService(this.queryParams).then(response => {
this.serviceList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
corsFlagFormat(row, column) {
return this.selectDictLabel(this.corsFlagOptions, row.corsFlag);
},
// 线
onlineStatusFormat(row, column) {
return this.selectDictLabel(this.onlineStatusOptions, row.onlineStatus);
},
//
statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.status);
},
//
enabledFormat(row, column) {
return this.selectDictLabel(this.enabledOptions, row.enabled);
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
serviceId: undefined,
serviceName: undefined,
serviceAddr: undefined,
probeActiveAddr: undefined,
requestMethod: undefined,
remark: undefined,
corsFlag: "0",
hiddenParams: undefined,
onlineStatus: undefined,
status: undefined,
apiDoc: undefined,
auditMind: undefined,
enabled: "0",
cateFullPath: undefined,
userId: undefined,
createBy: undefined,
createTime: undefined,
updateBy: undefined,
Time: undefined,
updateTime: undefined,
delFlag: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.serviceId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加服务信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const serviceId = row.serviceId || this.ids
getService(serviceId).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改服务信息";
});
},
/** 查询服务分类树结构 */
getTreeselect() {
treeselect().then(response => {
this.cateOptions = response.data;
});
},
//
normalizer(node) {
return {
id: node.fullPath,
label: node.label,
children: node.children,
}
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.serviceId != null) {
updateService(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addService(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const serviceIds = row.serviceId || this.ids;
this.$confirm('是否确认删除服务信息编号为"' + serviceIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.loading = true;
return delService(serviceIds);
}).then(() => {
this.loading = false;
this.getList();
this.msgSuccess("删除成功");
}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */
handleExport() {
downLoadExcel('/isc/service/export', this.queryParams);
}
}
};
</script>

217
sql/isc.sql Normal file
View File

@ -0,0 +1,217 @@
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for isc_app_service
-- ----------------------------
DROP TABLE IF EXISTS `isc_app_service`;
CREATE TABLE `isc_app_service` (
`service_app_id` bigint NOT NULL AUTO_INCREMENT COMMENT '应用服务ID',
`service_id` bigint NULL DEFAULT NULL COMMENT '服务ID',
`application_id` bigint NULL DEFAULT NULL COMMENT '应用ID',
`user_id` bigint NULL DEFAULT NULL COMMENT '用户ID',
`enabled` char(1) NOT NULL COMMENT '启用状态0启用 1停用',
`apply_type` char(1) DEFAULT NULL COMMENT '申请类型(0申请 1续期)',
`status` char(1) DEFAULT NULL COMMENT '审核状态0待审核 1审核通过 2驳回',
`virtual_addr` varchar(255) DEFAULT NULL COMMENT '虚拟地址',
`end_time` datetime(0) NULL DEFAULT NULL COMMENT '到期时间',
`quota_days` int NULL DEFAULT NULL COMMENT '天配额',
`quota_hours` int NULL DEFAULT NULL COMMENT '小时配额',
`quota_minutes` int NULL DEFAULT NULL COMMENT '分钟配额',
`quota_seconds` int NULL DEFAULT NULL COMMENT '秒配额',
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志0代表存在 2代表删除',
PRIMARY KEY (`service_app_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '应用服务信息';
-- ----------------------------
-- Records of isc_app_service
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for isc_app_service_apply
-- ----------------------------
DROP TABLE IF EXISTS `isc_app_service_apply`;
CREATE TABLE `isc_app_service_apply` (
`apply_id` bigint NOT NULL AUTO_INCREMENT COMMENT '申请ID',
`service_app_id` bigint NOT NULL COMMENT '应用服务ID',
`apply_type` char(1) DEFAULT NULL COMMENT '申请类型(0申请 1续期)',
`status` char(1) DEFAULT NULL COMMENT '审核状态0待审核 1审核通过 2驳回',
`audit_mind` varchar(255) DEFAULT NULL COMMENT '审核意见',
`renewal_duration` int NULL DEFAULT NULL COMMENT '续期时长(单位月)',
`quota_days` int NULL DEFAULT NULL COMMENT '天配额',
`quota_hours` int NULL DEFAULT NULL COMMENT '小时配额',
`quota_minutes` int NULL DEFAULT NULL COMMENT '分钟配额',
`quota_seconds` int NULL DEFAULT NULL COMMENT '秒配额',
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志0代表存在 2代表删除',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`apply_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '应用服务申请信息';
-- ----------------------------
-- Records of isc_app_service_apply
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for isc_application
-- ----------------------------
DROP TABLE IF EXISTS `isc_application`;
CREATE TABLE `isc_application` (
`application_id` bigint NOT NULL AUTO_INCREMENT COMMENT '应用ID',
`application_name` varchar(255) NOT NULL COMMENT '应用名称',
`access_key` varchar(32) NOT NULL COMMENT '应用密钥',
`user_id` bigint NOT NULL COMMENT '用户ID',
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志0代表存在 2代表删除',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`application_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '应用信息';
-- ----------------------------
-- Records of isc_application
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for isc_service
-- ----------------------------
DROP TABLE IF EXISTS `isc_service`;
CREATE TABLE `isc_service` (
`service_id` bigint NOT NULL AUTO_INCREMENT COMMENT '服务ID',
`service_name` varchar(255) NOT NULL COMMENT '服务名称',
`service_addr` varchar(255) NOT NULL COMMENT '服务地址',
`probe_active_addr` varchar(255) DEFAULT NULL COMMENT '探活地址',
`request_method` varchar(10) DEFAULT NULL COMMENT '请求方式默认GET',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
`cors_flag` char(1) DEFAULT NULL COMMENT '跨域标志Y是 N否',
`hidden_params` varchar(500) DEFAULT NULL COMMENT '隐藏参数',
`api_doc` text COMMENT 'JSON文档',
`online_status` char(1) DEFAULT NULL COMMENT '是否在线0离线 1在线',
`status` char(1) DEFAULT NULL COMMENT '审核状态0待审核 1审核通过 2驳回',
`audit_mind` varchar(255) DEFAULT NULL COMMENT '审核意见',
`enabled` char(1) NOT NULL COMMENT '服务状态0启用 1停用',
`cate_full_path` varchar(30) DEFAULT NULL COMMENT '服务分类全路径',
`user_id` bigint NOT NULL COMMENT '用户ID',
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志0代表存在 2代表删除',
PRIMARY KEY (`service_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '服务信息';
-- ----------------------------
-- Records of isc_service
-- ----------------------------
BEGIN;
INSERT INTO `isc_service` VALUES (1, '测试', 'https://www.baidu.com/', 'https://www.baidu.com/', 'GET', NULL, 'Y', NULL, '{}', '1', '0', NULL, '0', '001000000000000000000000000000', 1, 'admin', '2021-09-05 22:47:41', 'admin', '2021-09-05 22:47:41', '0');
COMMIT;
-- ----------------------------
-- Table structure for isc_service_cate
-- ----------------------------
DROP TABLE IF EXISTS `isc_service_cate`;
CREATE TABLE `isc_service_cate` (
`cate_id` bigint NOT NULL AUTO_INCREMENT COMMENT '分类ID',
`parent_id` bigint NULL DEFAULT NULL COMMENT '父分类ID',
`cate_name` varchar(64) DEFAULT NULL COMMENT '分类名称',
`full_path` varchar(30) DEFAULT NULL COMMENT '搜索全路径',
`enabled` char(1) NOT NULL COMMENT '服务状态0启用 1停用',
`order_num` int NULL DEFAULT 0 COMMENT '显示顺序',
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志0代表存在 2代表删除',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`cate_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 COMMENT = '服务分类';
-- ----------------------------
-- Records of isc_service_cate
-- ----------------------------
BEGIN;
INSERT INTO `isc_service_cate` VALUES (10, 0, 'API服务', '001000000000000000000000000000', '0', 10, 'admin', '2021-09-04 23:35:13', 'admin', '2021-09-04 23:35:13', '0', NULL), (11, 0, '地图服务', '002000000000000000000000000000', '0', 20, 'admin', '2021-09-04 23:35:37', 'admin', '2021-09-04 23:35:37', '0', NULL), (12, 0, '数据服务', '003000000000000000000000000000', '0', 30, 'admin', '2021-09-04 23:36:01', 'admin', '2021-09-04 23:36:01', '0', NULL), (13, 11, 'WFS服务', '002001000000000000000000000000', '0', 10, 'admin', '2021-09-04 23:36:26', 'admin', '2021-09-04 23:36:26', '0', NULL);
COMMIT;
-- ----------------------------
-- Table structure for isc_service_log_count
-- ----------------------------
DROP TABLE IF EXISTS `isc_service_log_count`;
CREATE TABLE `isc_service_log_count` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '唯一标识',
`service_id` bigint NOT NULL COMMENT '服务ID',
`count_date` date NOT NULL COMMENT '统计日期',
`total_num` bigint NOT NULL COMMENT '调用次数',
`avg_time` bigint NULL DEFAULT NULL COMMENT '平均响应时间',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '服务每日统计';
-- ----------------------------
-- Records of isc_service_log_count
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for isc_service_log_detail
-- ----------------------------
DROP TABLE IF EXISTS `isc_service_log_detail`;
CREATE TABLE `isc_service_log_detail` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '日志ID',
`service_id` bigint NOT NULL COMMENT '服务ID',
`application_id` bigint NOT NULL COMMENT '应用ID',
`user_id` bigint NOT NULL COMMENT '用户ID',
`request_ip` varchar(64) DEFAULT NULL COMMENT '调用IP',
`begin_time` timestamp(0) NULL DEFAULT NULL COMMENT '开始时间',
`end_time` timestamp(0) NULL DEFAULT NULL COMMENT '结束时间',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`remark` varchar(500) DEFAULT NULL COMMENT '备注信息',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '服务调用日志';
-- ----------------------------
-- Records of isc_service_log_detail
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for isc_service_log_user_count
-- ----------------------------
DROP TABLE IF EXISTS `isc_service_log_user_count`;
CREATE TABLE `isc_service_log_user_count` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '唯一标识',
`service_id` bigint NOT NULL COMMENT '服务ID',
`application_id` bigint NOT NULL COMMENT '应用ID',
`user_id` bigint NOT NULL COMMENT '用户ID',
`count_date` date NULL DEFAULT NULL COMMENT '统计日期',
`total_num` bigint NULL DEFAULT NULL COMMENT '调用次数',
`avg_time` bigint NULL DEFAULT NULL COMMENT '平均响应时间',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '服务日志用户统计';
-- ----------------------------
-- Records of isc_service_log_user_count
-- ----------------------------
BEGIN;
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;