duhanyu
dongdingding 1 year ago
parent 8bda3365e9
commit 5223d55894

@ -35,7 +35,11 @@
<!-- 依赖声明 --> <!-- 依赖声明 -->
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-openapi2-spring-boot-starter</artifactId>
<version>4.3.0</version>
</dependency>
<!-- SpringBoot的依赖配置--> <!-- SpringBoot的依赖配置-->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@ -73,19 +77,6 @@
<version>${oshi.version}</version> <version>${oshi.version}</version>
</dependency> </dependency>
<!-- Swagger3依赖 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>${swagger.version}</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- io常用工具类 --> <!-- io常用工具类 -->
<dependency> <dependency>
<groupId>commons-io</groupId> <groupId>commons-io</groupId>

@ -16,7 +16,10 @@
</description> </description>
<dependencies> <dependencies>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-openapi2-spring-boot-starter</artifactId>
</dependency>
<!-- spring-boot-devtools --> <!-- spring-boot-devtools -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@ -24,19 +27,6 @@
<optional>true</optional> <!-- 表示依赖不会传递 --> <optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency> </dependency>
<!-- swagger3-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
</dependency>
<!-- 防止进入swagger页面报类型转换错误排除3.0.0中的引用手动增加1.6.2版本 -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.6.2</version>
</dependency>
<!-- Mysql驱动包 --> <!-- Mysql驱动包 -->
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>

@ -3,6 +3,11 @@ package com.ruoyi;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import java.net.InetAddress;
import java.net.UnknownHostException;
/** /**
* *
@ -15,16 +20,21 @@ public class RuoYiApplication
public static void main(String[] args) public static void main(String[] args)
{ {
// System.setProperty("spring.devtools.restart.enabled", "false"); // System.setProperty("spring.devtools.restart.enabled", "false");
SpringApplication.run(RuoYiApplication.class, args); ConfigurableApplicationContext run = SpringApplication.run(RuoYiApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" + Environment env = run.getEnvironment();
" .-------. ____ __ \n" + String ip;
" | _ _ \\ \\ \\ / / \n" + try {
" | ( ' ) | \\ _. / ' \n" + ip = InetAddress.getLocalHost().getHostAddress();
" |(_ o _) / _( )_ .' \n" + } catch (UnknownHostException e) {
" | (_,_).' __ ___(_ o _)' \n" + throw new RuntimeException(e);
" | |\\ \\ | || |(_,_)' \n" + }
" | | \\ `' /| `-' / \n" + String port = env.getProperty("server.port");
" | | \\ / \\ / \n" + String path = env.getProperty("server.servlet.context-path");
" ''-' `'-' `-..-' "); path = path.isEmpty() ? "" : path;
System.out.println("\n----------------------------------------------------------\n\t"
+ "Application is running! Access URLs:\n\t"
+ "swagger-ui: http://localhost:" + port + path + "doc.html\n\t"
+ "swagger-ui: http://" + ip + ":" + port + path + "doc.html\n\t"
+ "----------------------------------------------------------");
} }
} }

@ -2,6 +2,10 @@ package com.ruoyi.tcZz.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.ruoyi.tcZz.domain.TcYqzs;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -20,6 +24,7 @@ import com.ruoyi.tcZz.domain.TcCy;
import com.ruoyi.tcZz.service.ITcCyService; import com.ruoyi.tcZz.service.ITcCyService;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/** /**
* Controller * Controller
@ -28,6 +33,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
* @date 2023-10-12 * @date 2023-10-12
*/ */
@RestController @RestController
@Api(tags = "词云")
@RequestMapping("/tcZz/cy") @RequestMapping("/tcZz/cy")
public class TcCyController extends BaseController public class TcCyController extends BaseController
{ {
@ -101,4 +107,30 @@ public class TcCyController extends BaseController
{ {
return toAjax(tcCyService.deleteTcCyByIds(ids)); return toAjax(tcCyService.deleteTcCyByIds(ids));
} }
/**
*
*/
@ApiOperation(value = "查询词云列表",response = TcCy.class)
@GetMapping("/ListNoToken")
public TableDataInfo ListNoToken(TcCy tcCy)
{
startPage();
List<TcCy> list = tcCyService.selectTcCyList(tcCy);
return getDataTable(list);
}
/**
*
*/
@ApiOperation("通用导入excel信息")
@PostMapping("/common/importExcel")
public AjaxResult importExcel(MultipartFile file) throws Exception {
ExcelUtil<TcCy> util = new ExcelUtil<TcCy>(TcCy.class);
List<TcCy> tcCyList = util.importExcel(file.getInputStream());
tcCyService.importUser(tcCyList);
return AjaxResult.success();
}
} }

@ -2,6 +2,10 @@ package com.ruoyi.tcZz.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.ruoyi.tcZz.domain.TcYqzs;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -20,6 +24,7 @@ import com.ruoyi.tcZz.domain.TcWljg;
import com.ruoyi.tcZz.service.ITcWljgService; import com.ruoyi.tcZz.service.ITcWljgService;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/** /**
* Controller * Controller
@ -28,6 +33,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
* @date 2023-10-12 * @date 2023-10-12
*/ */
@RestController @RestController
@Api(tags = "网络监测")
@RequestMapping("/tcZz/networkSecurity/cybersecurity") @RequestMapping("/tcZz/networkSecurity/cybersecurity")
public class TcWljgController extends BaseController public class TcWljgController extends BaseController
{ {
@ -101,4 +107,29 @@ public class TcWljgController extends BaseController
{ {
return toAjax(tcWljgService.deleteTcWljgByIds(ids)); return toAjax(tcWljgService.deleteTcWljgByIds(ids));
} }
/**
*
*/
@ApiOperation(value = "查询舆情走势图列表",response = TcWljg.class)
@GetMapping("/ListNoToken")
public TableDataInfo ListNoToken(TcWljg tcWljg)
{
startPage();
List<TcWljg> list = tcWljgService.selectTcWljgList(tcWljg);
return getDataTable(list);
}
/**
*
*/
@ApiOperation("通用导入excel信息")
@PostMapping("/common/importExcel")
public AjaxResult importExcel(MultipartFile file) throws Exception {
ExcelUtil<TcWljg> util = new ExcelUtil<TcWljg>(TcWljg.class);
List<TcWljg> tcWljgList = util.importExcel(file.getInputStream());
tcWljgService.importUser(tcWljgList);
return AjaxResult.success();
}
} }

@ -2,6 +2,11 @@ package com.ruoyi.tcZz.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.ruoyi.tcZz.domain.TcCy;
import com.ruoyi.tcZz.domain.TcWljg;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -20,6 +25,7 @@ import com.ruoyi.tcZz.domain.TcYqzs;
import com.ruoyi.tcZz.service.ITcYqzsService; import com.ruoyi.tcZz.service.ITcYqzsService;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/** /**
* Controller * Controller
@ -28,6 +34,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
* @date 2023-10-12 * @date 2023-10-12
*/ */
@RestController @RestController
@Api(tags = "舆情走势图")
@RequestMapping("/tcZz/yqzs") @RequestMapping("/tcZz/yqzs")
public class TcYqzsController extends BaseController public class TcYqzsController extends BaseController
{ {
@ -101,4 +108,28 @@ public class TcYqzsController extends BaseController
{ {
return toAjax(tcYqzsService.deleteTcYqzsByIds(ids)); return toAjax(tcYqzsService.deleteTcYqzsByIds(ids));
} }
/**
*
*/
@ApiOperation(value = "查询舆情走势图列表",response = TcYqzs.class)
@GetMapping("/ListNoToken")
public TableDataInfo ListNoToken(TcYqzs tcYqzs)
{
startPage();
List<TcYqzs> list = tcYqzsService.selectTcYqzsList(tcYqzs);
return getDataTable(list);
}
/**
*
*/
@ApiOperation("通用导入excel信息")
@PostMapping("/common/importExcel")
public AjaxResult importExcel(MultipartFile file) throws Exception {
ExcelUtil<TcYqzs> util = new ExcelUtil<TcYqzs>(TcYqzs.class);
List<TcYqzs> tcWljgList = util.importExcel(file.getInputStream());
tcYqzsService.importUser(tcWljgList);
return AjaxResult.success();
}
} }

@ -24,6 +24,10 @@ public class TcCy extends BaseEntity
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private Long id; private Long id;
@ApiModelProperty(value = "区域id")
@Excel(name = "区域id")
private String areaId;
/** 词云名称 */ /** 词云名称 */
@ApiModelProperty(value = "词云名称") @ApiModelProperty(value = "词云名称")
@Excel(name = "词云名称") @Excel(name = "词云名称")

@ -9,6 +9,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;
/** /**
* tc_wljg * tc_wljg
@ -30,72 +31,92 @@ public class TcWljg extends BaseEntity {
/** /**
* id * id
*/ */
@ApiModelProperty(value = "区域id")
@Excel(name = "区域id") @Excel(name = "区域id")
private String areaId; private String areaId;
/** /**
* 1. 2. * 1. 2.
*/ */
@ApiModelProperty(value = "1.启用 2.禁用")
@Excel(name = "1.启用 2.禁用") @Excel(name = "1.启用 2.禁用")
private Long isStatus; private Long isStatus;
/** /**
* *
*/ */
@Excel(name = "攻击发起时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "攻击发起时间")
private Date startTime; private Date startTime;
/** /**
* IP * IP
*/ */
@Excel(name = "攻击源IP") @Excel(name = "攻击源IP")
@ApiModelProperty(value = "攻击源IP")
private String attackyIp; private String attackyIp;
/** /**
* *
*/ */
@Excel(name = "攻击类型") @Excel(name = "攻击类型")
@ApiModelProperty(value = "攻击类型")
private String attackType; private String attackType;
/** /**
* IP * IP
*/ */
@Excel(name = "攻击源IP区域")
@ApiModelProperty(value = "攻击源IP区域")
private String attackIpArea; private String attackIpArea;
/** /**
* *
*/ */
@Excel(name = "受攻击目标类型")
@ApiModelProperty(value = "受攻击目标类型")
private String type; private String type;
/** /**
* IP * IP
*/ */
@ApiModelProperty(value = "受攻击IP")
@Excel(name = "受攻击IP") @Excel(name = "受攻击IP")
private String sAttackIp; private String sAttackIp;
/** /**
* IP * IP
*/ */
@ApiModelProperty(value = "受攻击IP区域")
private String sAttackIpArea; private String sAttackIpArea;
/** /**
* *
*/ */
@ApiModelProperty(value = "网站安全等级")
@Excel(name = "网站安全等级") @Excel(name = "网站安全等级")
private String netLevel; private String netLevel;
/** /**
* *
*/ */
@ApiModelProperty(value = "所属单位")
@Excel(name = "所属单位")
private String affUnit; private String affUnit;
/** /**
* *
*/ */
@ApiModelProperty(value = "联系电话")
@Excel(name = "联系电话")
private String linkTel; private String linkTel;
/** /**
* *
*/ */
@ApiModelProperty(value = "联系人")
@Excel(name = "联系人") @Excel(name = "联系人")
private String linkMan; private String linkMan;

@ -28,18 +28,23 @@ public class TcYqzs extends BaseEntity
/** 区域id */ /** 区域id */
@Excel(name = "区域id") @Excel(name = "区域id")
@ApiModelProperty(value = "区域id")
private Long areaId; private Long areaId;
/** 日期 */ /** 日期 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd") @ApiModelProperty(value = "日期")
@Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date dateTime; private Date dateTime;
/** 非敏感数量 */ /** 非敏感数量 */
@Excel(name = "非敏感数量") @Excel(name = "非敏感数量")
@ApiModelProperty(value = "非敏感数量")
private Long count1; private Long count1;
/** 敏感数量 */ /** 敏感数量 */
@Excel(name = "敏感数量") @Excel(name = "敏感数量")
@ApiModelProperty(value = "敏感数量")
private Long count2; private Long count2;
} }

@ -58,4 +58,7 @@ public interface TcWljgMapper
* @return * @return
*/ */
public int deleteTcWljgByIds(Long[] ids); public int deleteTcWljgByIds(Long[] ids);
} }

@ -2,6 +2,7 @@ package com.ruoyi.tcZz.service;
import java.util.List; import java.util.List;
import com.ruoyi.tcZz.domain.TcCy; import com.ruoyi.tcZz.domain.TcCy;
import com.ruoyi.tcZz.domain.TcYqzs;
/** /**
* Service * Service
@ -58,4 +59,11 @@ public interface ITcCyService
* @return * @return
*/ */
public int deleteTcCyById(Long id); public int deleteTcCyById(Long id);
/**
*
*
* @return
*/
public String importUser(List<TcCy> tcCyList);
} }

@ -58,4 +58,12 @@ public interface ITcWljgService
* @return * @return
*/ */
public int deleteTcWljgById(Long id); public int deleteTcWljgById(Long id);
/**
*
*
* @return
*/
public String importUser(List<TcWljg> tcWljgList);
} }

@ -1,6 +1,8 @@
package com.ruoyi.tcZz.service; package com.ruoyi.tcZz.service;
import java.util.List; import java.util.List;
import com.ruoyi.tcZz.domain.TcWljg;
import com.ruoyi.tcZz.domain.TcYqzs; import com.ruoyi.tcZz.domain.TcYqzs;
/** /**
@ -58,4 +60,12 @@ public interface ITcYqzsService
* @return * @return
*/ */
public int deleteTcYqzsById(Long id); public int deleteTcYqzsById(Long id);
/**
*
*
* @return
*/
public String importUser(List<TcYqzs> tcYqzsList);
} }

@ -2,6 +2,7 @@ package com.ruoyi.tcZz.service.impl;
import java.util.List; import java.util.List;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.tcZz.domain.TcYqzs;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.tcZz.mapper.TcCyMapper; import com.ruoyi.tcZz.mapper.TcCyMapper;
@ -66,7 +67,6 @@ public class TcCyServiceImpl implements ITcCyService
@Override @Override
public int updateTcCy(TcCy tcCy) public int updateTcCy(TcCy tcCy)
{ {
tcCy.setUpdateTime(DateUtils.getNowDate());
return tcCyMapper.updateTcCy(tcCy); return tcCyMapper.updateTcCy(tcCy);
} }
@ -93,4 +93,18 @@ public class TcCyServiceImpl implements ITcCyService
{ {
return tcCyMapper.deleteTcCyById(id); return tcCyMapper.deleteTcCyById(id);
} }
@Override
public String importUser(List<TcCy> tcCyList) {
StringBuilder successMsg = new StringBuilder();
if (!tcCyList.isEmpty()) {
for (TcCy tcCy : tcCyList) {
tcCyMapper.insertTcCy(tcCy);
}
successMsg.append("导入成功");
}
return successMsg.toString();
}
} }

@ -66,7 +66,7 @@ public class TcWljgServiceImpl implements ITcWljgService
@Override @Override
public int updateTcWljg(TcWljg tcWljg) public int updateTcWljg(TcWljg tcWljg)
{ {
tcWljg.setUpdateTime(DateUtils.getNowDate());
return tcWljgMapper.updateTcWljg(tcWljg); return tcWljgMapper.updateTcWljg(tcWljg);
} }
@ -93,4 +93,17 @@ public class TcWljgServiceImpl implements ITcWljgService
{ {
return tcWljgMapper.deleteTcWljgById(id); return tcWljgMapper.deleteTcWljgById(id);
} }
@Override
public String importUser(List<TcWljg> tcWljgList) {
StringBuilder successMsg = new StringBuilder();
if (!tcWljgList.isEmpty()) {
for (TcWljg tcWljg : tcWljgList) {
tcWljgMapper.insertTcWljg(tcWljg);
}
successMsg.append("导入成功");
}
return successMsg.toString();
}
} }

@ -2,6 +2,7 @@ package com.ruoyi.tcZz.service.impl;
import java.util.List; import java.util.List;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.tcZz.domain.TcWljg;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.tcZz.mapper.TcYqzsMapper; import com.ruoyi.tcZz.mapper.TcYqzsMapper;
@ -66,7 +67,7 @@ public class TcYqzsServiceImpl implements ITcYqzsService
@Override @Override
public int updateTcYqzs(TcYqzs tcYqzs) public int updateTcYqzs(TcYqzs tcYqzs)
{ {
tcYqzs.setUpdateTime(DateUtils.getNowDate());
return tcYqzsMapper.updateTcYqzs(tcYqzs); return tcYqzsMapper.updateTcYqzs(tcYqzs);
} }
@ -93,4 +94,18 @@ public class TcYqzsServiceImpl implements ITcYqzsService
{ {
return tcYqzsMapper.deleteTcYqzsById(id); return tcYqzsMapper.deleteTcYqzsById(id);
} }
@Override
public String importUser(List<TcYqzs> tcYqzsList) {
StringBuilder successMsg = new StringBuilder();
if (!tcYqzsList.isEmpty()) {
for (TcYqzs tcYqzs : tcYqzsList) {
tcYqzsMapper.insertTcYqzs(tcYqzs);
}
successMsg.append("导入成功");
}
return successMsg.toString();
}
} }

@ -1,26 +1,19 @@
package com.ruoyi.web.core.config; package com.ruoyi.web.core.config;
import java.util.ArrayList; import com.ruoyi.common.config.RuoYiConfig;
import java.util.List; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import com.ruoyi.common.config.RuoYiConfig;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo; import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.ApiKey;
import springfox.documentation.service.AuthorizationScope;
import springfox.documentation.service.Contact; import springfox.documentation.service.Contact;
import springfox.documentation.service.SecurityReference;
import springfox.documentation.service.SecurityScheme;
import springfox.documentation.spi.DocumentationType; import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.service.contexts.SecurityContext;
import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
/** /**
* Swagger2 * Swagger2
@ -28,29 +21,36 @@ import springfox.documentation.spring.web.plugins.Docket;
* @author ruoyi * @author ruoyi
*/ */
@Configuration @Configuration
public class SwaggerConfig @EnableSwagger2WebMvc
{ public class SwaggerConfig {
/** 系统基础配置 */ /**
*
*/
@Autowired @Autowired
private RuoYiConfig ruoyiConfig; private RuoYiConfig ruoyiConfig;
/** 是否开启swagger */ /**
@Value("${swagger.enabled}") * swagger
*/
@Value("${knife4j.enable}")
private boolean enabled; private boolean enabled;
/** 设置请求的统一前缀 */ /**
@Value("${swagger.pathMapping}") *
*/
@Value("${server.servlet.context-path}")
private String pathMapping; private String pathMapping;
/** /**
* API * API
*/ */
@Bean @Bean
public Docket createRestApi() public Docket createRestApi() {
{ return new Docket(DocumentationType.SWAGGER_2)
return new Docket(DocumentationType.OAS_30)
// 是否启用Swagger // 是否启用Swagger
.enable(enabled) .enable(enabled)
//分组名称
.groupName("太仓综治")
// 用来创建该API的基本信息展示在文档的页面中自定义展示的信息 // 用来创建该API的基本信息展示在文档的页面中自定义展示的信息
.apiInfo(apiInfo()) .apiInfo(apiInfo())
// 设置哪些接口暴露给Swagger展示 // 设置哪些接口暴露给Swagger展示
@ -62,60 +62,22 @@ public class SwaggerConfig
// 扫描所有 .apis(RequestHandlerSelectors.any()) // 扫描所有 .apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any()) .paths(PathSelectors.any())
.build() .build()
/* 设置安全模式swagger可以设置访问token */
.securitySchemes(securitySchemes())
.securityContexts(securityContexts())
.pathMapping(pathMapping); .pathMapping(pathMapping);
// 排除mybatis-plus的分页参数
// .ignoredParameterTypes(Page.class, IPage.class);
} }
/**
* tokenAuthorization
*/
private List<SecurityScheme> securitySchemes()
{
List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>();
apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue()));
return apiKeyList;
}
/**
*
*/
private List<SecurityContext> securityContexts()
{
List<SecurityContext> securityContexts = new ArrayList<>();
securityContexts.add(
SecurityContext.builder()
.securityReferences(defaultAuth())
.operationSelector(o -> o.requestMappingPattern().matches("/.*"))
.build());
return securityContexts;
}
/**
*
*/
private List<SecurityReference> defaultAuth()
{
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
authorizationScopes[0] = authorizationScope;
List<SecurityReference> securityReferences = new ArrayList<>();
securityReferences.add(new SecurityReference("Authorization", authorizationScopes));
return securityReferences;
}
/** /**
* *
*/ */
private ApiInfo apiInfo() private ApiInfo apiInfo() {
{
// 用ApiInfoBuilder进行定制 // 用ApiInfoBuilder进行定制
return new ApiInfoBuilder() return new ApiInfoBuilder()
// 设置标题 // 设置标题
.title("标题:若依管理系统_接口文档") .title("苏州应急3期系统_接口文档")
// 描述 // 描述
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...") .description("描述用于苏州应急3期系统")
// 作者信息 // 作者信息
.contact(new Contact(ruoyiConfig.getName(), null, null)) .contact(new Contact(ruoyiConfig.getName(), null, null))
// 版本 // 版本

@ -21,7 +21,7 @@ spring:
# 最小连接池数量 # 最小连接池数量
minIdle: 10 minIdle: 10
# 最大连接池数量 # 最大连接池数量
maxActive: 20 maxActive: 100
# 配置获取连接等待超时的时间 # 配置获取连接等待超时的时间
maxWait: 60000 maxWait: 60000
# 配置连接超时时间 # 配置连接超时时间

@ -18,7 +18,7 @@ ruoyi:
# 开发环境配置 # 开发环境配置
server: server:
# 服务器的HTTP端口默认为8080 # 服务器的HTTP端口默认为8080
port: 9027 port: 9035
servlet: servlet:
# 应用的访问路径 # 应用的访问路径
context-path: / context-path: /
@ -115,11 +115,9 @@ pagehelper:
params: count=countSql params: count=countSql
# Swagger配置 # Swagger配置
swagger: knife4j:
# 是否开启swagger enable: true
enabled: true
# 请求前缀
pathMapping:
# 防止XSS攻击 # 防止XSS攻击
xss: xss:

@ -1,29 +1,51 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.tcZz.mapper.TcCyMapper"> <mapper namespace="com.ruoyi.tcZz.mapper.TcCyMapper">
<resultMap type="TcCy" id="TcCyResult"> <resultMap type="TcCy" id="TcCyResult">
<result property="id" column="id" /> <result property="id" column="id"/>
<result property="cyName" column="cy_name" /> <result property="cyName" column="cy_name"/>
<result property="cyCount" column="cy_count" /> <result property="cyCount" column="cy_count"/>
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time"/>
<result property="remark" column="remark" /> <result property="remark" column="remark"/>
<result property="areaId" column="area_id"/>
</resultMap> </resultMap>
<sql id="selectTcCyVo"> <sql id="selectTcCyVo">
select id, cy_name, cy_count, create_by, create_time, update_by, update_time, remark from tc_cy select id,
area_id,
cy_name,
cy_count,
create_by,
create_time,
update_by,
update_time,
remark
from tc_cy
</sql> </sql>
<select id="selectTcCyList" parameterType="TcCy" resultMap="TcCyResult"> <select id="selectTcCyList" parameterType="TcCy" resultMap="TcCyResult">
<include refid="selectTcCyVo"/> <include refid="selectTcCyVo"/>
<where> <where>
<if test="cyName != null and cyName != ''"> and cy_name like concat('%', #{cyName}, '%')</if> <if test="id != null ">and id = #{id}</if>
<if test="cyCount != null "> and cy_count = #{cyCount}</if> <if test="areaId != null ">and area_id = #{areaId}</if>
<if test="cyName != null and cyName != ''">and cy_name like concat('%', #{cyName}, '%')</if>
<if test="cyCount != null ">and cy_count = #{cyCount}</if>
<if test="createBy != null and createBy != ''">and create_by = #{createBy}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
and create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if>
<if test="updateBy != null and updateBy != ''">and update_by = #{updateBy}</if>
<if test="params.beginUpdateTime != null and params.beginUpdateTime != '' and params.endUpdateTime != null and params.endUpdateTime != ''">
and update_time between #{params.beginUpdateTime} and #{params.endUpdateTime}
</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
</where> </where>
</select> </select>
@ -42,7 +64,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
</trim> <if test="areaId != null">area_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="cyName != null">#{cyName},</if> <if test="cyName != null">#{cyName},</if>
<if test="cyCount != null">#{cyCount},</if> <if test="cyCount != null">#{cyCount},</if>
@ -51,7 +74,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
</trim> <if test="areaId != null">#{areaId},</if>
</trim>
</insert> </insert>
<update id="updateTcCy" parameterType="TcCy"> <update id="updateTcCy" parameterType="TcCy">
@ -64,12 +88,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="areaId != null">area_id = #{areaId},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<delete id="deleteTcCyById" parameterType="Long"> <delete id="deleteTcCyById" parameterType="Long">
delete from tc_cy where id = #{id} delete
from tc_cy
where id = #{id}
</delete> </delete>
<delete id="deleteTcCyByIds" parameterType="String"> <delete id="deleteTcCyByIds" parameterType="String">

@ -1,33 +1,53 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.tcZz.mapper.TcYqzsMapper"> <mapper namespace="com.ruoyi.tcZz.mapper.TcYqzsMapper">
<resultMap type="TcYqzs" id="TcYqzsResult"> <resultMap type="TcYqzs" id="TcYqzsResult">
<result property="id" column="id" /> <result property="id" column="id"/>
<result property="areaId" column="area_id" /> <result property="areaId" column="area_id"/>
<result property="dateTime" column="date_time" /> <result property="dateTime" column="date_time"/>
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time"/>
<result property="remark" column="remark" /> <result property="remark" column="remark"/>
<result property="count1" column="count1" /> <result property="count1" column="count1"/>
<result property="count2" column="count2" /> <result property="count2" column="count2"/>
</resultMap> </resultMap>
<sql id="selectTcYqzsVo"> <sql id="selectTcYqzsVo">
select id, area_id, date_time, create_by, create_time, update_by, update_time, remark, count1, count2 from tc_yqzs select id,
area_id,
date_time,
create_by,
create_time,
update_by,
update_time,
remark,
count1,
count2
from tc_yqzs
</sql> </sql>
<select id="selectTcYqzsList" parameterType="TcYqzs" resultMap="TcYqzsResult"> <select id="selectTcYqzsList" parameterType="TcYqzs" resultMap="TcYqzsResult">
<include refid="selectTcYqzsVo"/> <include refid="selectTcYqzsVo"/>
<where> <where>
<if test="areaId != null "> and area_id = #{areaId}</if> <if test="id != null ">and id = #{id}</if>
<if test="dateTime != null "> and date_time = #{dateTime}</if> <if test="areaId != null ">and area_id = #{areaId}</if>
<if test="count1 != null "> and count1 = #{count1}</if> <if test="dateTime != null ">and date_time = #{dateTime}</if>
<if test="count2 != null "> and count2 = #{count2}</if> <if test="createBy != null and createBy != ''">and create_by = #{createBy}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
and create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if>
<if test="updateBy != null and updateBy != ''">and update_by = #{updateBy}</if>
<if test="params.beginUpdateTime != null and params.beginUpdateTime != '' and params.endUpdateTime != null and params.endUpdateTime != ''">
and update_time between #{params.beginUpdateTime} and #{params.endUpdateTime}
</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
<if test="count1 != null ">and count1 = #{count1}</if>
<if test="count2 != null ">and count2 = #{count2}</if>
</where> </where>
</select> </select>
@ -48,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="count1 != null">count1,</if> <if test="count1 != null">count1,</if>
<if test="count2 != null">count2,</if> <if test="count2 != null">count2,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="areaId != null">#{areaId},</if> <if test="areaId != null">#{areaId},</if>
<if test="dateTime != null">#{dateTime},</if> <if test="dateTime != null">#{dateTime},</if>
@ -59,7 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
<if test="count1 != null">#{count1},</if> <if test="count1 != null">#{count1},</if>
<if test="count2 != null">#{count2},</if> <if test="count2 != null">#{count2},</if>
</trim> </trim>
</insert> </insert>
<update id="updateTcYqzs" parameterType="TcYqzs"> <update id="updateTcYqzs" parameterType="TcYqzs">
@ -79,7 +99,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<delete id="deleteTcYqzsById" parameterType="Long"> <delete id="deleteTcYqzsById" parameterType="Long">
delete from tc_yqzs where id = #{id} delete
from tc_yqzs
where id = #{id}
</delete> </delete>
<delete id="deleteTcYqzsByIds" parameterType="String"> <delete id="deleteTcYqzsByIds" parameterType="String">

@ -33,8 +33,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTcWljgList" parameterType="TcWljg" resultMap="TcWljgResult"> <select id="selectTcWljgList" parameterType="TcWljg" resultMap="TcWljgResult">
<include refid="selectTcWljgVo"/> <include refid="selectTcWljgVo"/>
<where> <where>
<if test="areaId != null and areaId != ''"> and area_id = #{areaId}</if> <if test="id != null ">and id = #{id}</if>
<if test="isStatus != null "> and isStatus = #{isStatus}</if> <if test="areaId != null and areaId != ''">and area_id = #{areaId}</if>
<if test="isStatus != null ">and isStatus = #{isStatus}</if>
<if test="params.beginStartTime != null and params.beginStartTime != '' and params.endStartTime != null and params.endStartTime != ''">
and start_time between #{params.beginStartTime} and #{params.endStartTime}
</if>
<if test="attackyIp != null and attackyIp != ''">and attacky_ip = #{attackyIp}</if>
<if test="attackType != null and attackType != ''">and attack_type = #{attackType}</if>
<if test="attackIpArea != null and attackIpArea != ''">and attack_ip_area = #{attackIpArea}</if>
<if test="type != null and type != ''">and type = #{type}</if>
<if test="sAttackIp != null and sAttackIp != ''">and s_attack_ip = #{sAttackIp}</if>
<if test="sAttackIpArea != null and sAttackIpArea != ''">and s_attack_ip_area = #{sAttackIpArea}</if>
<if test="netLevel != null and netLevel != ''">and net_level = #{netLevel}</if>
<if test="affUnit != null and affUnit != ''">and aff_unit = #{affUnit}</if>
<if test="linkTel != null and linkTel != ''">and link_tel = #{linkTel}</if>
<if test="linkMan != null and linkMan != ''">and link_man = #{linkMan}</if>
<if test="createBy != null and createBy != ''">and create_by = #{createBy}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
and create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if>
<if test="updateBy != null and updateBy != ''">and update_by = #{updateBy}</if>
<if test="params.beginUpdateTime != null and params.beginUpdateTime != '' and params.endUpdateTime != null and params.endUpdateTime != ''">
and update_time between #{params.beginUpdateTime} and #{params.endUpdateTime}
</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
</where> </where>
</select> </select>
@ -43,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id} where id = #{id}
</select> </select>
<insert id="insertTcWljg" parameterType="TcWljg" useGeneratedKeys="true" keyProperty="id"> <insert id="insertTcWljg" parameterType="TcWljg" useGeneratedKeys="true" keyProperty="id">
insert into tc_wljg insert into tc_wljg
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">

@ -125,6 +125,12 @@
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId> <artifactId>javax.servlet-api</artifactId>
</dependency> </dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.6.6</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>

@ -7,6 +7,9 @@ import java.util.Map;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;
/** /**
* Entity * Entity
@ -22,20 +25,29 @@ public class BaseEntity implements Serializable
private String searchValue; private String searchValue;
/** 创建者 */ /** 创建者 */
@ApiModelProperty(value = "创建者")
private String createBy; private String createBy;
/** 创建时间 */ /** 创建时间 */
@Excel(name = "创建时间", dateFormat = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime; private Date createTime;
/** 更新者 */ /** 更新者 */
@ApiModelProperty(value = "更新者")
private String updateBy; private String updateBy;
/** 更新时间 */ /** 更新时间 */
@Excel(name = "更新时间", dateFormat = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime; private Date updateTime;
/** 备注 */ /** 备注 */
@ApiModelProperty(value = "备注")
private String remark; private String remark;
/** 请求参数 */ /** 请求参数 */

@ -114,7 +114,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
.antMatchers("/login", "/register", "/captchaImage").permitAll() .antMatchers("/login", "/register", "/captchaImage").permitAll()
// 静态资源,可匿名访问 // 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**","/tcZz/cy/ListNoToken","/tcZz/yqzs/ListNoToken","/tcZz/networkSecurity/cybersecurity/ListNoToken","/tcZz/networkSecurity/cybersecurity/common/importExcel","/tcZz/yqzs/common/importExcel","/tcZz/cy/common/importExcel").permitAll()
// 除上面外的所有请求全部需要鉴权认证 // 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated() .anyRequest().authenticated()
.and() .and()

Loading…
Cancel
Save