notesite's People
notesite's Issues
Test the models separately and together in terms of the relationships using test module
api: Get the latest instant_content
Get the latest instant_content
Request
Get the latest instant_content
- Url: /instant_content/latest
Get the latest instant_content by the type - Url: /instant_content/latest/type/${type}
Response
{
"instant_content_id": "${str_id}",
"content_type": "${number}",
"content": "${base64}",
"compression_method":"${number}",
"text_version_content": "${str_content}"
}
api: Get the instant_content's text version content
Get the instant_content's text version content
This will trigger the convert and fill the data into the text_version_content field
Request
- Url: /instant_content/${id}/text_version_content
- Method: Get
Response
{
"text_version_content":"${str_content}"
}
222
Define the api structure
Implement an api template
Finish all model files in 'models' directory
api: "Login"
Login
Request
- Url: api/login
- Method: Post
Arguments
user_id=${userid}&password=${password}
Response
Success
HTTP Code 200
{
"user_id": "${user_id}",
"is_anonymous": "${boolean}",
"user_name":"${user_name}",
"user_ttl": "${number}"
}
Failure
HTTP Code 401
{
"failure_code": "${number}",
"failure_reason": "${string}"
}
api:"Register an normal user"
Register an normal user
Request
- Url: api/register
- Method: Post
Arguments
user_name=${user_name}
email=${email}
password=${password}
Response
Success
HTTP Code 200
{
"user_id": "${user_id}",
"is_anonymous": "${boolean}",
"user_name":"${user_name}",
"user_ttl": "${number}"
}
Failure
HTTP Code 401
{
"failure_code": "${number}",
"failure_reason": "${string}"
}
``
api: Write the instant content draft
Write the instant content draft
Update the draft data
Request
- Url: /instant_content/draft
- Method: Post
argument
content_type=${number}
content=${base64}
compression=${number}
Response
{
"status": "success"
}
Implement a model as template
api: Write the instant content
Write the instant content
Post a new instant content and delete the draft
Request
- Url: /instant_content
- Method: Post
argument
content_type=${number}
content=${base64}
compression=${number}
Response
{
"status": "success"
}
api:"Get an anonymous user"
authentication system
Get an anonymous user
Request
- Url: api/user/anon
- Method: Get
Response
{
"user_id": "${user_id}",
"is_anonymous": true,
"user_name":"anon",
"user_ttl": -1
}
user_ttl
The time the anonymous account(and its data and files) can keep alive
The account gets removed:
- 0: It gets never expired (Normal account's data gets never expired)
- -1: When the session in the server expires
- ${number}: Number seconds after the last operation is made, no more less than 3600.
api: Get the instant_contents
Get the instant_contents
Request
- Url: /instant_contents/${paginate_number}
- Method: Get
argument
paginate_size=5
Response
{
"total_page_number":"${number_number}",
"current_page_number": "${number_current_page_number}",
"contents_draft": {
"instant_content_id": "${str_id}",
"content_type": "${number}",
"content": "${base64}",
"compression_method":"${number}"
},
"contents":[{
"instant_content_id": "${str_id}",
"content_type": "${number}",
"content": "${base64}",
"compression_method":"${number}",
"text_version_content": "${str_content}"
}]
}
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.