Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ public class PruneEdgeTasklet implements Tasklet {
@Override
public RepeatStatus execute(@NonNull StepContribution con, @NonNull ChunkContext ctx) {
String del = """
MATCH (:User)-[r:PREFERRED]->(:Activity)
WHERE r.score < 0.4
MATCH ()-[r]->()
WHERE (type(r) = "PREFERRED" OR type(r) = "SIMILAR")
AND r.score < 0.85
DELETE r
""";
recommendActivityService.execWrite(del);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ WITH pair AS (
(CASE
WHEN cnt1 = 0 AND cnt2 > 0 THEN pref_sim
ELSE 0.7 * pref_sim + 0.3 * act_sim
END) >= 0.5;
END) >= 0.9;
""";

List<Map<String, Object>> simRows = jdbc.queryForList(similarSql, Map.of());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
package com.example.silverbridgeX_user.matching.scheduler;

import com.example.silverbridgeX_user.matching.service.MatchingService;
import java.time.LocalDateTime;
import lombok.RequiredArgsConstructor;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

@Component
@RequiredArgsConstructor
public class MatchingScheduler {

private final MatchingService matchingService;

@Scheduled(cron = "0 18,38,58 * * * *")
@Scheduled(cron = "0 9,19,29,39,49,59 * * * *")
public void executeMatching() {
System.out.println("매칭 알고리즘 실행됨: " + LocalDateTime.now());
matchingService.executeMatchingAlgorithm();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ public JwtTokenUtils(
@Value("${jwt.secret}") String jwtSecret,
@Value("${jwt.accessExpirationTime}") int accessExpirationTime,
@Value("${jwt.refreshExpirationTime}") int refreshExpirationTime
)
{
) {
this.signingKey = Keys.hmacShaKeyFor(jwtSecret.getBytes());
this.jwtParser = Jwts.parserBuilder().setSigningKey(this.signingKey).build();
this.accessExpirationTime = accessExpirationTime;
Expand Down Expand Up @@ -66,6 +65,7 @@ public JwtDto generateToken(UserDetails userDetails) {
.setExpiration(Date.from(Instant.now().plusSeconds(refreshExpirationTime)));
String refreshToken = Jwts.builder()
.setClaims(refreshTokenClaims)
.claim("authorities", authorities)
.signWith(signingKey)
.compact();

Expand Down Expand Up @@ -111,7 +111,7 @@ public boolean validateToken(String token) {
}

// 문자열로 저장된 authorities를 다시 Collection으로 변환
public Collection<? extends GrantedAuthority> getAuthFromClaims(Claims claims){
public Collection<? extends GrantedAuthority> getAuthFromClaims(Claims claims) {

String authoritiesString = (String) claims.get("authorities"); // authorities 정보 가져오기

Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
spring:
profiles:
active: local
jackson:
time-zone: Asia/Seoul

springdoc:
swagger-ui:
Expand Down