Skip to content

Commit

Permalink
Merge pull request #55 from ZhouYixun/dev
Browse files Browse the repository at this point in the history
修复删除用例时出错的Bug
  • Loading branch information
ZhouYixun authored Oct 22, 2021
2 parents d9d6098 + fa9e94a commit 6cd5b6c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ services:
ports:
- "8094:8094"
sonic-server-controller:
image: "zhouyixun/sonic-server-controller:v1.0.0"
image: "zhouyixun/sonic-server-controller:v1.0.1"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
Expand Down
2 changes: 1 addition & 1 deletion 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.0</version>
<version>1.0.1</version>
<packaging>jar</packaging>

<!-- 依赖列表 -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import java.util.Date;
import java.util.List;
import java.util.Set;

@Entity
Expand Down Expand Up @@ -48,10 +49,10 @@ public class TestCases {
@LastModifiedDate
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
Date editTime;
@ManyToMany(mappedBy = "testCases")
@ManyToMany(mappedBy = "testCases", fetch = FetchType.EAGER)
@JsonIgnore
@JSONField(serialize = false)
Set<TestSuites> testSuites;
List<TestSuites> testSuites;

public TestCases() {
}
Expand Down Expand Up @@ -128,11 +129,11 @@ public void setEditTime(Date editTime) {
this.editTime = editTime;
}

public Set<TestSuites> getTestSuites() {
public List<TestSuites> getTestSuites() {
return testSuites;
}

public void setTestSuites(Set<TestSuites> testSuites) {
public void setTestSuites(List<TestSuites> testSuites) {
this.testSuites = testSuites;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public List<TestCases> findAll(int projectId, int platform) {
public boolean delete(int id) {
if (testCasesRepository.existsById(id)) {
TestCases testCases = testCasesRepository.findById(id).get();
Set<TestSuites> testSuitesSet = testCases.getTestSuites();
List<TestSuites> testSuitesSet = testCases.getTestSuites();
for (TestSuites testSuites : testSuitesSet) {
testSuites.getTestCases().remove(testCases);
}
Expand Down

0 comments on commit 6cd5b6c

Please sign in to comment.