#42 rename variables

This commit is contained in:
T-Midnight 2019-04-18 13:09:50 +04:00
parent 506fa01fab
commit e284298200
3 changed files with 20 additions and 20 deletions

View File

@ -30,8 +30,8 @@ public class GrantDto {
private Set<UserDto> authors;
private Integer leaderId;
private boolean wasLeader;
private boolean birthDate;
private boolean degree;
private boolean hasAge;
private boolean hasDegree;
public GrantDto() {
deadlines.add(new Deadline());
@ -48,8 +48,8 @@ public class GrantDto {
@JsonProperty("authors") Set<UserDto> authors,
@JsonProperty("leader") Integer leaderId,
@JsonProperty("wasLeader") boolean wasLeader,
@JsonProperty("birthDate") boolean birthDate,
@JsonProperty("degree") boolean degree) {
@JsonProperty("hasAge") boolean hasAge,
@JsonProperty("hasDegree") boolean hasDegree) {
this.id = id;
this.title = title;
this.status = status;
@ -60,8 +60,8 @@ public class GrantDto {
this.authors = authors;
this.leaderId = leaderId;
this.wasLeader = wasLeader;
this.birthDate = birthDate;
this.degree = degree;
this.hasAge = hasAge;
this.hasDegree = hasDegree;
}
public GrantDto(Grant grant) {
@ -76,8 +76,8 @@ public class GrantDto {
this.authors = convert(grant.getAuthors(), UserDto::new);
this.leaderId = grant.getLeader().getId();
this.wasLeader = false;
this.birthDate = false;
this.degree = false;
this.hasAge = false;
this.hasDegree = false;
}
public Integer getId() {
@ -175,19 +175,19 @@ public class GrantDto {
this.wasLeader = wasLeader;
}
public boolean isBirthDate() {
return birthDate;
public boolean isHasAge() {
return hasAge;
}
public void setBirthDate(boolean birthDate) {
this.birthDate = birthDate;
public void setHasAge(boolean hasAge) {
this.hasAge = hasAge;
}
public boolean isDegree() {
return degree;
public boolean isHasDegree() {
return hasDegree;
}
public void setDegree(boolean degree) {
this.degree = degree;
public void setHasDegree(boolean hasDegree) {
this.hasDegree = hasDegree;
}
}

View File

@ -140,7 +140,7 @@ public class GrantService {
}
public List<User> getGrantAuthors(GrantDto grantDto) {
List<User> filteredUsers = userService.filterByAgeAndDegree(grantDto.isBirthDate(), grantDto.isDegree());
List<User> filteredUsers = userService.filterByAgeAndDegree(grantDto.isHasAge(), grantDto.isHasDegree());
if (grantDto.isWasLeader()) {
filteredUsers = filteredUsers
.stream()

View File

@ -87,7 +87,7 @@
aria-expanded="false"
aria-controls="collapse-filter">Фильтр рабочей группы
</label>
<div th:class="${grantDto.wasLeader || grantDto.birthDate || grantDto.degree} ?
<div th:class="${grantDto.wasLeader || grantDto.hasAge || grantDto.hasDegree} ?
'form-check' : 'form-check collapse'" id="collapse-filter">
<div class="row">
<div class="col">
@ -97,14 +97,14 @@
</div>
<div class="col">
<input class="form-check-input" type="checkbox" id="f2"
th:field="*{birthDate}" th:onclick="|$('#filter').click();|"/>
th:field="*{hasAge}" th:onclick="|$('#filter').click();|"/>
<label class="form-check-label" for="f2">Младше 35 лет</label>
</div>
</div>
<div class="row">
<div class="col">
<input class="form-check-input" type="checkbox" id="f3"
th:field="*{degree}" th:onclick="|$('#filter').click();|"/>
th:field="*{hasDegree}" th:onclick="|$('#filter').click();|"/>
<label class="form-check-label" for="f3">епень к.т.н.</label>
</div>
<div class="col">