Skip to content

Commit

Permalink
Merge pull request #76 from StuBee2/Refactor/#74
Browse files Browse the repository at this point in the history
Refactor/#74
  • Loading branch information
suw0n authored Jan 15, 2024
2 parents da18fd8 + 246c287 commit 21ca650
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private List<CompanyJPAEntity> findByOptionWithPaging(Predicate option, PageRequ
.selectFrom(companyJPAEntity)
.where(option)
.orderBy(companyJPAEntity.createdAt.desc())
.offset(pageRequest.page())
.offset((pageRequest.page()-1)*pageRequest.size())
.limit(pageRequest.size())
.fetch();
}
Expand All @@ -84,7 +84,7 @@ List<CompanyJPAEntity> findAll(PageRequest pageRequest) {
return jpaQueryFactory
.selectFrom(companyJPAEntity)
.where(companyJPAEntity.companyStatus.eq(CompanyStatus.ACCEPTED))
.offset(pageRequest.page())
.offset((pageRequest.page()-1)*pageRequest.size())
.limit(pageRequest.size())
.fetch();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class JwtProperties {

private String accessKey;
private String secretKey;
private long accessExpire;
private long refreshExpire;
private String accessExpire;
private String refreshExpire;

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public String generateAccessToken(final Long id, final MemberRole memberRole) {
.setSubject(id.toString())
.claim("authority", memberRole)
.setIssuedAt(new Date())
.setExpiration(new Date(System.currentTimeMillis() + jwtProperties.getAccessExpire()))
.setExpiration(new Date(System.currentTimeMillis() + Long.parseLong(jwtProperties.getAccessExpire())))
.signWith(SignatureAlgorithm.HS512, jwtProperties.getAccessKey())
.compact();
}
Expand All @@ -35,7 +35,7 @@ public String generateRefreshToken(final Long id, final MemberRole memberRole) {
.setSubject(id.toString())
.claim("authority", memberRole)
.setIssuedAt(new Date())
.setExpiration(new Date(System.currentTimeMillis() + jwtProperties.getRefreshExpire()))
.setExpiration(new Date(System.currentTimeMillis() + Long.parseLong(jwtProperties.getRefreshExpire())))
.signWith(SignatureAlgorithm.HS512, jwtProperties.getSecretKey())
.compact();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void modify(final ModifyStoryCommand command) {

story.modify(employmentDetails, corporationDetails, reviewGrades, memberSessionPort.currentId());

commandStoryPort.save(story);
commandStoryPort.update(story);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static CorporationDetails toCorporationDetails(final ModifyStoryCommand command)
}

static ReviewGrades toReviewGrades(final ModifyStoryCommand command) {
return ReviewGrades.builder()
return ReviewGrades.ExceptTotalBuilder()
.salaryAndBenefits(Double.valueOf(command.salaryAndBenefits()))
.workLifeBalance(Double.valueOf(command.workLifeBalance()))
.organizationalCulture(Double.valueOf(command.organizationalCulture()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

public final class ReviewGrades extends Grades {

@Builder(builderClassName = "ExceptTotalBuilder", builderMethodName = "ExceptTotalBuilder")
public ReviewGrades(Double salaryAndBenefits, Double workLifeBalance, Double organizationalCulture, Double careerAdvancement) {
super(salaryAndBenefits, workLifeBalance, organizationalCulture, careerAdvancement);
}

@Builder
public ReviewGrades(Double total, Double salaryAndBenefits, Double workLifeBalance, Double organizationalCulture, Double careerAdvancement) {
super(total, salaryAndBenefits, workLifeBalance, organizationalCulture, careerAdvancement);
Expand Down

0 comments on commit 21ca650

Please sign in to comment.