Giter Club home page Giter Club logo

gymbackend's Introduction

Tworzenie Szkieletu aplikacji Webowej, Łączenie z bazą danych, Mockowanie danych, Tworzenie trójwarstwowej aplikacji, Proste zapytania, Przekazywanie parametrów w adresie N+1 problem + rozwiązanie Java Data, własne zapytania JPQL, następnie generowane przez konwencję nazewniczą Stronicowanie applying in memory problem + rozwiązanie - nie zwracanie fetchowanych danych

Problem z encjami podczas wyrzukiwania Eventów po Id Trenera -> należało dodać adnotacje JoinColumn - dodaje kolumnę TRAINER_ID do eventow. ale blad byl jednak w maperze, bo nie dodawalem id. Bez JoinColumn tworzona jest nowa tabela. Rowniez jest problem przy zwracaniu eventow. w naszym przypadku każdy event (większość) powinna mieć prowadzących, więc wydajniej jest dodać kolumnę.

fetch z Pageable - rozwiązanie - podwójne zapytanie id z pageable, potem dociaganie

zwracanie fetchowanych parametrów z encji.

relacja wiele do wielu z określeniem własnej tabeli

modyfikacja, usuwanie - pamiętać o cascade,

problem przy modyfikowaniu (uczestnikow eventu), najpiewr usuwa wszystko a potem dodaje?

image

Screenshot from 2024-03-13 20-45-23

Screenshot from 2024-03-13 21-02-39

Rekurencyjny problem: image

Antywzorzec modyfikacji - bo są listy a nie sety? img.png

Endpoints

TODO /events/{id}/enroll /events/{id}/unenroll /home... /dashboard... /trainer - jakies modyfikacje trenera? update.

  • /home

    • TODO GET ???
      • Request
        • Empty
      • Response
        • usersCount (Long)
        • trainerCount (Long)
    • TODO /find - wyszukiwarka
      • GET

        • Request
          • dyskryminator (Long) - czego szukamy (Event, Trainer, User)
          • .......
          • konkretne parametry ??? głównie po nazwie
          • page (Long)
          • size (Long)
        • Response
          • result (List< ??? >) w zalezności od wyszukiwania to się zwróci?
      • TODO /events - eventy

        • Specyficzne dla eventow?
      • TODO /trainers - trenerzy

        • specyficzne dla trenerow?
  • /events - lista wszystkich eventów

    • GET

      • Request
        • page (Long)
        • size (Long)
      • Response
        • events (List< EventShortDto>)
    • POST TODO: Zrobić Posta

      • Request
        • event (EventDto)
        • Trainer (z tokena?)
    • /{id} - konkretny event

      • GET
        • Request
          • eventId (Long)
        • Response
          • eventDto (EventDto)
      • DELETE - wycofanie się z eventu
        • Request
          • courseId (Long) - path
          • userId (Long)
        • Response
          • success (boolean)
      • /participants - uczestnicy
        • GET
          • Request
            • courseId (Long) - path
            • page (Long)
            • size (Long)
          • Resonse
            • participants (List< UserShortDto>)
        • PUT - zapisanie się na event.
          • Request
            • courseId (Long) - path
            • userId (Long)
          • Response
            • success (boolean)
            • info (String) - informacja od konkretnego eventu
  • /trainers - lista trenerów

    • GET
      • Request
        • page (Long)
        • size (Long)
      • Response
        • trainers (List< TrainerShortDto>)
    • /{id} - konkretny trener
      • GET
        • Request
          • trainerId (Long) - path
        • Response
          • trainer (TrainerDto)
      • /events - lista eventów które prowadzi
        • GET
          • Request
            • trainerId (Long) - path
            • page (Long)
            • size (Long)
          • Response
            • events (List< EventShortDto>)
  • /dashboard/{id}

Tu będzie profil usera konkretnego, razem z możliwościa modyfikacji - tylko ten konkretny user, po jakimś tokenie?

/events img.png

/events/{id} img_1.png

/events/{id}/participants img_2.png

/events/{id}/participants PUT - zapisanie się na event img.png img.png

/events/{id} DELETE - usunięcie eventu img.png

/events/{id} PUT - modyfikacja eventu img.png

/events POST - dodanie eventu img_1.png img.png img_2.png

/trainers img_3.png

/trainers/{id} img_4.png

/trainers/{id}/events/ img_5.png

gymbackend's People

Contributors

mateoswiatek avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.