Skip to content

Commit

Permalink
Merge pull request #62 from ZhouYixun/dev
Browse files Browse the repository at this point in the history
v1.1.0
  • Loading branch information
ZhouYixun authored Nov 3, 2021
2 parents 6cd5b6c + e63816b commit 9ae6e7d
Show file tree
Hide file tree
Showing 25 changed files with 278 additions and 149 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
/imageFiles/
/keepFiles/
/recordFiles/
/packageFiles/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</p>
<p align="center">
<a href="#">
<img src="https://img.shields.io/badge/release-v1.0.0-orange">
<img src="https://img.shields.io/badge/release-v1.1.0-orange">
</a>
<a href="#">
<img src="https://img.shields.io/github/commit-activity/m/ZhouYixun/sonic-agent">
Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</p>
<p align="center">
<a href="#">
<img src="https://img.shields.io/badge/release-v1.0.0-orange">
<img src="https://img.shields.io/badge/release-v1.1.0-orange">
</a>
<a href="#">
<img src="https://img.shields.io/github/commit-activity/m/ZhouYixun/sonic-agent">
Expand Down
6 changes: 3 additions & 3 deletions config/sonic-server-controller-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ robot:
client:
host: "http://localhost:3000"
img:
success: ""
warning: ""
error: ""
success: "https://gitee.com/ZhouYixun/sonic-official-website/raw/master/src/assets/suc.png"
warning: "https://gitee.com/ZhouYixun/sonic-official-website/raw/master/src/assets/warn.png"
error: "https://gitee.com/ZhouYixun/sonic-official-website/raw/master/src/assets/fail.png"
7 changes: 6 additions & 1 deletion config/sonic-server-gateway-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ server:
port: 8094

filter:
white-list: /users/login,/users/register,/swagger-resources,/v2/api-docs,/folder/upload,/folder/recordFiles,/keepFiles/,/imageFiles/,/recordFiles/,/logFiles/
white-list: /users/login,/users/register,/swagger-resources,/v2/api-docs,/folder/upload,/folder/recordFiles,/keepFiles/,/imageFiles/,/recordFiles/,/logFiles/,/packageFiles/
resetToken: true

spring:
Expand All @@ -27,5 +27,10 @@ spring:
- id: transport
uri: lb://sonic-server-transport
predicates: Path=/api/transport/**
filters:
- StripPrefix=2
- id: bus
uri: lb://sonic-server-bus
predicates: Path=/api/bus/**
filters:
- StripPrefix=2
2 changes: 1 addition & 1 deletion sonic-server-bus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>sonic-server-bus</artifactId>
<version>1.0.1</version>
<version>1.1.0</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion sonic-server-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>sonic-server-common</artifactId>
<version>1.0.0</version>
<version>1.1.0</version>

<!-- 依赖列表 -->
<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions sonic-server-controller/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>sonic-server-controller</artifactId>
<version>1.0.1</version>
<version>1.1.0</version>
<packaging>jar</packaging>

<!-- 依赖列表 -->
Expand Down Expand Up @@ -60,7 +60,7 @@
<dependency>
<groupId>com.sonic</groupId>
<artifactId>sonic-server-common</artifactId>
<version>1.0.0</version>
<version>1.1.0</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class Elements {
@ApiModelProperty(value = "项目id", required = true, example = "1")
int projectId;
//因为一个控件可以存在于多个步骤,也可以一个步骤有多个同样的控件,所以是多对多关系
@ManyToMany(mappedBy = "elements")
@ManyToMany(mappedBy = "elements", fetch = FetchType.EAGER)
@JsonIgnore
@JSONField(serialize = false)
List<Steps> steps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ public class Projects {
@NotNull
@ApiModelProperty(value = "项目描述", required = true, example = "Sonic项目描述")
String projectDes;
@ApiModelProperty(value = "机器人类型", required = true, example = "1")
int robotType;
@NotNull
@ApiModelProperty(value = "钉钉机器人token", required = true, example = "http://dingTalk.com?token=*****")
@ApiModelProperty(value = "机器人token", required = true, example = "http://dingTalk.com?token=*****")
String robotToken;
@NotNull
@ApiModelProperty(value = "钉钉机器人加签密钥", required = true, example = "qwe***")
@ApiModelProperty(value = "机器人加签密钥", required = true, example = "qwe***")
String robotSecret;
@NotNull
@ApiModelProperty(value = "项目图标", required = true, example = "http://img.jpg")
Expand Down Expand Up @@ -65,6 +67,14 @@ public void setProjectDes(String projectDes) {
this.projectDes = projectDes;
}

public int getRobotType() {
return robotType;
}

public void setRobotType(int robotType) {
this.robotType = robotType;
}

public String getRobotToken() {
return robotToken;
}
Expand Down Expand Up @@ -103,6 +113,7 @@ public String toString() {
"id=" + id +
", projectName='" + projectName + '\'' +
", projectDes='" + projectDes + '\'' +
", robotType=" + robotType +
", robotToken='" + robotToken + '\'' +
", robotSecret='" + robotSecret + '\'' +
", projectImg='" + projectImg + '\'' +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import java.util.List;
import java.util.Set;

@Entity
@ApiModel("运行步骤模型")
Expand Down Expand Up @@ -49,10 +50,10 @@ public class Steps {
@ApiModelProperty(value = "包含元素列表")
@ManyToMany(fetch = FetchType.EAGER)
List<Elements> elements;
@ManyToMany(mappedBy = "steps")
@ManyToMany(mappedBy = "steps",fetch = FetchType.EAGER)
@JsonIgnore
@JSONField(serialize = false)
List<PublicSteps> publicSteps;
Set<PublicSteps> publicSteps;

public Steps() {
}
Expand Down Expand Up @@ -137,11 +138,11 @@ public void setElements(List<Elements> elements) {
this.elements = elements;
}

public List<PublicSteps> getPublicSteps() {
public Set<PublicSteps> getPublicSteps() {
return publicSteps;
}

public void setPublicSteps(List<PublicSteps> publicSteps) {
public void setPublicSteps(Set<PublicSteps> publicSteps) {
this.publicSteps = publicSteps;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.sonic.controller.models.interfaces;

public interface RobotType {
int DingTalk = 1;
int WeChat = 2;
int FeiShu = 3;
int YouSpace = 4;
}
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ public void sendDayReport() {
break;
}
}
if (projects.getRobotToken().length() > 0 && projects.getRobotSecret().length() > 0) {
if (projects.getRobotType() != 0 && projects.getRobotToken().length() > 0 && projects.getRobotSecret().length() > 0) {
robotMsgTool.sendDayReportMessage(projects.getRobotToken(), projects.getRobotSecret(), projects.getId()
, projects.getProjectName(), sf.format(yesterday), sf.format(today), suc, warn, fail);
, projects.getProjectName(), sf.format(yesterday), sf.format(today), suc, warn, fail, projects.getRobotType());
}
}
}
Expand Down Expand Up @@ -253,9 +253,9 @@ public void sendWeekReport() {
break;
}
}
if (projects.getRobotToken().length() > 0 && projects.getRobotSecret().length() > 0) {
if (projects.getRobotType() != 0 && projects.getRobotToken().length() > 0 && projects.getRobotSecret().length() > 0) {
robotMsgTool.sendWeekReportMessage(projects.getRobotToken(), projects.getRobotSecret(), projects.getId()
, projects.getProjectName(), sf.format(lastWeek), sf.format(today), suc, warn, fail, count);
, projects.getProjectName(), sf.format(lastWeek), sf.format(today), suc, warn, fail, count, projects.getRobotType());
}
}
}
Expand Down Expand Up @@ -317,9 +317,9 @@ public void setStatus(Results results) {
results.setEndTime(new Date());
save(results);
Projects projects = projectsService.findById(results.getProjectId());
if (projects != null && projects.getRobotToken().length() > 0 && projects.getRobotSecret().length() > 0) {
if (projects != null && projects.getRobotType() != 0 && projects.getRobotToken().length() > 0 && projects.getRobotSecret().length() > 0) {
robotMsgTool.sendResultFinishReport(projects.getRobotToken(), projects.getRobotSecret(),
results.getSuiteName(), sucCount, warnCount, failCount, projects.getId(), results.getId());
results.getSuiteName(), sucCount, warnCount, failCount, projects.getId(), results.getId(), projects.getRobotType());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public boolean resetCaseId(int id) {
@Override
public boolean delete(int id) {
if (stepsRepository.existsById(id)) {
Steps steps = stepsRepository.findById(id).get();
for (PublicSteps publicSteps : steps.getPublicSteps()) {
publicSteps.getSteps().remove(steps);
publicStepsService.save(publicSteps);
}
stepsRepository.deleteById(id);
return true;
} else {
Expand Down
Loading

0 comments on commit 9ae6e7d

Please sign in to comment.