Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
The Social Network
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marc Feger
The Social Network
Commits
04899639
Commit
04899639
authored
3 years ago
by
Andreas Burbach
Browse files
Options
Downloads
Patches
Plain Diff
update
parent
84bcc816
No related branches found
No related tags found
1 merge request
!3
Feeding chicken with chicken
Pipeline
#75551
passed
3 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
social_network/README.md
+44
-1
44 additions, 1 deletion
social_network/README.md
with
44 additions
and
1 deletion
social_network/README.md
+
44
−
1
View file @
04899639
...
@@ -33,8 +33,11 @@ Add *'the_social_network'* to **INSTALLED_APPS** and save the file.
...
@@ -33,8 +33,11 @@ Add *'the_social_network'* to **INSTALLED_APPS** and save the file.
Next open the urls.py and add the following line to your
**urlpatterns**
Next open the urls.py and add the following line to your
**urlpatterns**
> url(r'^authentication/', include('the_social_network.urls.authenticationUrls')),
> url(r'^authentication/', include('the_social_network.urls.authenticationUrls')),
>
> url(r'^accounts/', include('the_social_network.urls.accountUrls')),
> url(r'^accounts/', include('the_social_network.urls.accountUrls')),
>
> url(r'^search/', include('the_social_network.urls.searchUrls')),
> url(r'^search/', include('the_social_network.urls.searchUrls')),
>
> url(r'^contents/', include('the_social_network.urls.contentUrls'))
> url(r'^contents/', include('the_social_network.urls.contentUrls'))
Now everything is ready to run django with
**the-social-network**
.
Now everything is ready to run django with
**the-social-network**
.
...
@@ -54,12 +57,14 @@ For authorization use the header name "Authorization" and the value "Token <toke
...
@@ -54,12 +57,14 @@ For authorization use the header name "Authorization" and the value "Token <toke
#### Authentication
#### Authentication
##### POST url: ".../authentication/register/"
##### POST url: ".../authentication/register/"
Register a user
Register a user
Requestbody:
Requestbody:
{
{
"username": "username",
"username": "username",
"password": "password",
"password": "password",
"email": "
"email": "
}
}
Responsebody:
Responsebody:
{
{
"token": "token"
"token": "token"
...
@@ -67,11 +72,13 @@ Responsebody:
...
@@ -67,11 +72,13 @@ Responsebody:
##### POST url: ".../authentication/login/"
##### POST url: ".../authentication/login/"
Login a user
Login a user
Requestbody:
Requestbody:
{
{
"username": "username",
"username": "username",
"password": "password"
"password": "password"
}
}
Responsebody:
Responsebody:
{
{
"token": "token"
"token": "token"
...
@@ -79,20 +86,28 @@ Responsebody:
...
@@ -79,20 +86,28 @@ Responsebody:
##### POST url: ".../authentication/logout/"
##### POST url: ".../authentication/logout/"
Logout a user
Logout a user
Requestbody: None
Requestbody: None
Responsebody: None
Responsebody: None
Success: HTTP/200
Success: HTTP/200
##### GET url: ".../authentication/validate/"
##### GET url: ".../authentication/validate/"
Validate a token
Validate a token
Requestbody: None
Requestbody: None
Responsebody: None
Responsebody: None
Success: HTTP/200
Success: HTTP/200
#### Account
#### Account
##### GET url: ".../accounts/show/<user_id>/"
##### GET url: ".../accounts/show/<user_id>/"
Show a public user
Show a public user
Requestbody: None
Requestbody: None
Responsebody:
Responsebody:
[{
[{
"user": {
"user": {
...
@@ -111,7 +126,9 @@ Responsebody:
...
@@ -111,7 +126,9 @@ Responsebody:
##### GET url: ".../accounts/show/own/"
##### GET url: ".../accounts/show/own/"
Show the own user
Show the own user
Requestbody: None
Requestbody: None
Responsebody:
Responsebody:
[{
[{
"user": {
"user": {
...
@@ -129,7 +146,9 @@ Responsebody:
...
@@ -129,7 +146,9 @@ Responsebody:
##### GET url: ".../accounts/show/all/"
##### GET url: ".../accounts/show/all/"
Show all public users
Show all public users
Requestbody: None
Requestbody: None
Responsebody:
Responsebody:
[{
[{
"user": {
"user": {
...
@@ -149,33 +168,44 @@ Responsebody:
...
@@ -149,33 +168,44 @@ Responsebody:
##### PUT url: ".../accounts/update/"
##### PUT url: ".../accounts/update/"
Updates the own account. Only "Biography" and "Image" are allowed to be updated.
Updates the own account. Only "Biography" and "Image" are allowed to be updated.
Requestbody:
Requestbody:
{
{
"biography": "...",
"biography": "...",
"file": "..."
"file": "..."
}
}
Responsebody: None
Responsebody: None
Success: HTTP/200
Success: HTTP/200
##### PUT url: ".../accounts/follow/<user_id>/"
##### PUT url: ".../accounts/follow/<user_id>/"
Follow a user
Follow a user
Requestbody: None
Requestbody: None
Responsebody: None
Responsebody: None
Success: HTTP/200
Success: HTTP/200
##### PUT url: ".../accounts/unfollow/<user_id>/"
##### PUT url: ".../accounts/unfollow/<user_id>/"
Unfollow a user
Unfollow a user
Requestbody: None
Requestbody: None
Responsebody: None
Responsebody: None
Success: HTTP/200
Success: HTTP/200
##### PUT url: ".../accounts/operation/add/statement/"
##### PUT url: ".../accounts/operation/add/statement/"
Add a statement to the own account
Add a statement to the own account
Requestbody:
Requestbody:
{
{
"input": "
<statement>
"
"input": "
<statement>
"
"reactions": { "to":
<reaction_to_a_statement_id>
, "relation":
<
"
attack
"
or
"
support
"
>
} <--- optional
"reactions": { "to":
<reaction_to_a_statement_id>
, "relation":
<
"
attack
"
or
"
support
"
>
} <--- optional
}
}
Responsebody:
Responsebody:
{
{
"id": ...,
"id": ...,
...
@@ -192,12 +222,15 @@ Responsebody:
...
@@ -192,12 +222,15 @@ Responsebody:
"created": "...",
"created": "...",
"relation_to_parent": ...
"relation_to_parent": ...
}
}
Success: HTTP/200
Success: HTTP/200
#### Contents
#### Contents
##### GET url: ".../contents/statements/get/<statement_id>/"
##### GET url: ".../contents/statements/get/<statement_id>/"
Get a statement
Get a statement
Requestbody: None
Requestbody: None
Responsebody:
Responsebody:
[
[
{
{
...
@@ -220,8 +253,11 @@ Responsebody:
...
@@ -220,8 +253,11 @@ Responsebody:
##### GET url: ".../contents/statements/with/hashtag/"
##### GET url: ".../contents/statements/with/hashtag/"
Get all statements with a hashtag
Get all statements with a hashtag
Requestbody: None
Requestbody: None
Queryparameters: "?q=
<hashtag>
"
Queryparameters: "?q=
<hashtag>
"
Responsebody:
Responsebody:
[
[
{
{
...
@@ -245,7 +281,9 @@ Responsebody:
...
@@ -245,7 +281,9 @@ Responsebody:
##### GET url: ".../contents/statements/feed/"
##### GET url: ".../contents/statements/feed/"
Get all statements of the accounts that are followed by the user
Get all statements of the accounts that are followed by the user
Requestbody: None
Requestbody: None
Responsebody:
Responsebody:
[
[
{
{
...
@@ -269,15 +307,20 @@ Responsebody:
...
@@ -269,15 +307,20 @@ Responsebody:
##### GET url: ".../contents/trending/hashtag/"
##### GET url: ".../contents/trending/hashtag/"
Get all trending hashtags which are most used in statements
Get all trending hashtags which are most used in statements
Requestbody: None
Requestbody: None
Reponsebody: ++++++ TODO: Setting of a hashtag not clear ++++++
Reponsebody: ++++++ TODO: Setting of a hashtag not clear ++++++
#### Search
#### Search
##### GET url: ".../search/"
##### GET url: ".../search/"
Searchs for a user or hashtag
Searchs for a user or hashtag
Requestbody: None
Requestbody: None
Queryparameters: "?q=
<search_query>
&filter=
<
"
user
"
or
"
hashtag
"
>
"
Queryparameters: "?q=
<search_query>
&filter=
<
"
user
"
or
"
hashtag
"
>
"
Responsebody:
Responsebody:
{
{
"accounts": [
"accounts": [
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment