Ændr ConnectionString i appsettings.json for eget MongoDb ConnectionString, hvis nødvendigt.
Første kørsel af SocialNetwork solution:
- Byg solution
- Kør projekt med Ctrl + F5
- Åbn Postman program
- Seed databasen ved at lave en GET request på: https://localhost:/api/seed
Tilgå de forskellige collections i SocialNetwork databasen:
- Kør projekt med Ctrl + F5
- Åbn Postman program
- Tilgå collection ved at lave en GET request på: 3a. https://localhost:/api/blocked 3b. https://localhost:/api/circle 3c. https://localhost:/api/comment 3d. https://localhost:/api/follows 3e. https://localhost:/api/post 3f. https://localhost:/api/user
Querying Feed for user eller User Wall hvor Guest har adgangsrettigheder:
Tilgå feed for user:
- Kør projekt med Ctrl + F5
- Åbn Postman program
- Tilgå feed ved lave en GET request på: https://localhost:/api/feeduser/User fx: https://localhost:/api/feeduser/User1 https://localhost:/api/feeduser/User2 osv..
Tilgå wall for user, som guest har adgangsrettigheder til:
- Kør projekt med Ctrl + F5
- Åbn Postman program
- Tilgå wall ved at lave en GET request på: https://localhost:/api/walluserguest/User/User fx: https://localhost:/api/walluserguest/User2/User1 hvor User2 er User og User1 er Guest
Post data til databasen:
Opret en post lavet af en user ved at:
- Kør projekt med Ctrl + F5
- Åbn Postman program
- Lav en POST request til: https://localhost:44315/api/createpost/User fx: https://localhost:44315/api/createpost/User1
hvor body består af en raw JSON med følgende indhold:
{ "postId": "PostId", "post_": "", "date":"Thh:mm:ssZ, "contentType": <"text" || "image">, "isPublic": <true || false>, "comments": [], "circleRef": [] }
fx:
{ "postId": "PostId7", "post_": "this is post 7", "date": "2020-05-05T22:00:00Z", "contentType": "text", "isPublic": true, "comments": [], "circleRef": [] }
JSON indhold: : Består af enten tekst for en post eller imaginær URL/string for beliggenhed af det uploadede image "contentType": "text" hvis det er en tekst post, "image" hvis det er en image post "isPublic": er false hvis post er til en circle "circleRef": CircleId'er hvorpå denne post er postet til.
Lav en comment for PostId:
- Kør projekt med Ctrl + F5
- Åbn Postman program
- Lav en POST request til: https://localhost:/api/createcomment/PostId
hvor body består af en raw JSON med følgende indhold:
{ "commentId": "CommentId", "userId": "User", "text": "", "date": "Thh:mm:ssZ" }
fx:
{ "commentId": "CommentId5", "userId": "User1", "text": "Post comment", "date": "2020-05-05T22:00:00Z" }
JSON indhold: "userId" : User der har oprettet selve kommentaren