File tree Expand file tree Collapse file tree
src/main/java/app/smartpot/api/sessions Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- package app .smartpot .api .Sessions .Service ;
1+ package app .smartpot .api .sessions .Service ;
22
3- import app .smartpot .api .Sessions . Model . Entity .Session ;
3+ import app .smartpot .api .sessions . model . entity .Session ;
44
55import java .util .List ;
66
7- public interface SSessionI {
7+ public interface SessionService {
88 Session getSessionById (String sessionId );
99
1010 List <Session > getSessionsByUser (String user );
Original file line number Diff line number Diff line change 1- package app .smartpot .api .Sessions .Service ;
1+ package app .smartpot .api .sessions .Service ;
22
3+ import app .smartpot .api .sessions .repository .SessionRepository ;
34import lombok .Builder ;
45import lombok .Data ;
56import org .bson .types .ObjectId ;
89import org .springframework .stereotype .Service ;
910import app .smartpot .api .Exception .ApiException ;
1011import app .smartpot .api .Exception .ApiResponse ;
11- import app .smartpot .api .Sessions .Model .Entity .Session ;
12- import app .smartpot .api .Sessions .Repository .RSession ;
12+ import app .smartpot .api .sessions .model .entity .Session ;
1313import app .smartpot .api .users .model .dto .UserDTO ;
1414import app .smartpot .api .users .service .UserService ;
1515
2020@ Data
2121@ Builder
2222@ Service
23- public class SSession implements SSessionI {
23+ public class SessionServiceImpl implements SessionService {
2424
25- private final RSession repositorySession ;
25+ private final SessionRepository repositorySession ;
2626 private final UserService user ;
2727
2828 @ Autowired
29- public SSession ( RSession repositorySession , UserService user ) {
29+ public SessionServiceImpl ( SessionRepository repositorySession , UserService user ) {
3030 this .repositorySession = repositorySession ;
3131 this .user = user ;
3232 }
Original file line number Diff line number Diff line change 1- package app .smartpot .api .Sessions . Controller ;
1+ package app .smartpot .api .sessions . controller ;
22
33import org .springframework .beans .factory .annotation .Autowired ;
44import org .springframework .http .HttpStatus ;
55import org .springframework .http .ResponseEntity ;
66import org .springframework .web .bind .annotation .*;
77import app .smartpot .api .Responses .ErrorResponse ;
8- import app .smartpot .api .Sessions . Model . Entity .Session ;
9- import app .smartpot .api .Sessions .Service .SSessionI ;
8+ import app .smartpot .api .sessions . model . entity .Session ;
9+ import app .smartpot .api .sessions .Service .SessionService ;
1010
1111import java .util .List ;
1212
1313@ RestController
1414@ RequestMapping ("/Sessions" )
1515public class SessionController {
1616
17- private final SSessionI session ;
17+ private final SessionService session ;
1818
1919 @ Autowired
20- public SessionController (SSessionI session ) {
20+ public SessionController (SessionService session ) {
2121 this .session = session ;
2222 }
2323
Original file line number Diff line number Diff line change 1- package app .smartpot .api .Sessions . Mapper ;
1+ package app .smartpot .api .sessions . mapper ;
22
33import org .bson .types .ObjectId ;
44import org .mapstruct .Mapper ;
55import org .mapstruct .Mapping ;
66import org .mapstruct .factory .Mappers ;
7- import app .smartpot .api .Sessions . Model . DTO .SessionDTO ;
8- import app .smartpot .api .Sessions . Model . Entity .Session ;
7+ import app .smartpot .api .sessions . model . dto .SessionDTO ;
8+ import app .smartpot .api .sessions . model . entity .Session ;
99
1010@ Mapper (componentModel = "spring" )
11- public interface MSession {
12- MSession INSTANCE = Mappers .getMapper (MSession .class );
11+ public interface SessionMapper {
12+ SessionMapper INSTANCE = Mappers .getMapper (SessionMapper .class );
1313
1414 @ Mapping (source = "id" , target = "id" , qualifiedByName = "stringToObjectId" )
1515 Session toEntity (SessionDTO sessionDTO );
Original file line number Diff line number Diff line change 1- package app .smartpot .api .Sessions . Model . DTO ;
1+ package app .smartpot .api .sessions . model . dto ;
22
33import lombok .Data ;
44
Original file line number Diff line number Diff line change 1- package app .smartpot .api .Sessions . Model . Entity ;
1+ package app .smartpot .api .sessions . model . entity ;
22
33import com .fasterxml .jackson .annotation .JsonFormat ;
44import jakarta .validation .constraints .FutureOrPresent ;
Original file line number Diff line number Diff line change 1- package app .smartpot .api .Sessions . Repository ;
1+ package app .smartpot .api .sessions . repository ;
22
33import org .springframework .data .mongodb .repository .MongoRepository ;
44import org .springframework .data .mongodb .repository .Query ;
55import org .springframework .stereotype .Repository ;
66import org .springframework .transaction .annotation .Transactional ;
7- import app .smartpot .api .Sessions . Model . Entity .Session ;
7+ import app .smartpot .api .sessions . model . entity .Session ;
88
99import java .util .Date ;
1010import java .util .List ;
1111
1212@ Repository
13- public interface RSession extends MongoRepository <Session , String > {
13+ public interface SessionRepository extends MongoRepository <Session , String > {
1414
1515
1616 @ Query ("{ 'user' : ?0 }" )
You can’t perform that action at this time.
0 commit comments