File tree Expand file tree Collapse file tree
collector/src/main/java/ru/practicum/service Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212@ NoArgsConstructor
1313@ Builder
1414@ Entity
15- @ Table (name = "events_similarity " )
15+ @ Table (name = "similarities " )
1616@ FieldDefaults (level = AccessLevel .PRIVATE )
1717public class EventSimilarity {
1818 @ Id
1919 @ GeneratedValue (strategy = GenerationType .IDENTITY )
2020 Long id ;
21-
21+ @ Column ( name = "event_id_a" )
2222 Long eventA ;
23+ @ Column (name = "event_id_b" )
2324 Long eventB ;
25+ @ Column (name = "score" )
2426 Double score ;
27+ @ Column (name = "timestamp" )
2528 Instant timestamp ;
2629}
Original file line number Diff line number Diff line change 11package ru .practicum .model ;
22
33
4- import jakarta .persistence .Entity ;
5- import jakarta .persistence .GeneratedValue ;
6- import jakarta .persistence .GenerationType ;
7- import jakarta .persistence .Id ;
8- import jakarta .persistence .Table ;
4+ import jakarta .persistence .*;
95import lombok .AllArgsConstructor ;
106import lombok .Builder ;
117import lombok .Getter ;
2016@ NoArgsConstructor
2117@ Builder
2218@ Entity
23- @ Table (name = "user_actions " )
19+ @ Table (name = "actions " )
2420public class UserAction {
2521 @ Id
2622 @ GeneratedValue (strategy = GenerationType .IDENTITY )
2723 private Long id ;
28-
24+ @ Column ( name = "user_id" )
2925 private Long userId ;
26+ @ Column (name = "event_id" )
3027 private Long eventId ;
31-
28+ @ Column ( name = "score" )
3229 private Double score ;
33-
30+ @ Column ( name = "lastInteraction" )
3431 private Instant lastInteraction ;
3532}
Original file line number Diff line number Diff line change @@ -13,6 +13,12 @@ spring:
1313 retry :
1414 useRandomPolicy : true
1515 max-interval : 6000
16+ flyway :
17+ flyway :
18+ database : postgresql
19+ ignore-future-migrations : true
20+ postgresql :
21+ transactional-lock : false
1622eureka :
1723 client :
1824 serviceUrl :
Original file line number Diff line number Diff line change 1+ CREATE TABLE similarities (
2+ id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL ,
3+ event_id_a BIGINT ,
4+ event_id_b BIGINT ,
5+ score DOUBLE PRECISION ,
6+ timestamp TIMESTAMP with time zone ,
7+ CONSTRAINT pk_similarities PRIMARY KEY (id)
8+ );
9+
10+ CREATE TABLE actions (
11+ id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL ,
12+ user_id BIGINT ,
13+ event_id BIGINT ,
14+ score DOUBLE PRECISION ,
15+ last_interaction TIMESTAMP with time zone ,
16+ CONSTRAINT pk_actions PRIMARY KEY (id)
17+ );
Original file line number Diff line number Diff line change 11package ru .practicum .service ;
22
3- import com .google .protobuf .Empty ;
43import io .grpc .Status ;
54import io .grpc .StatusRuntimeException ;
65import io .grpc .stub .StreamObserver ;
You can’t perform that action at this time.
0 commit comments