Skip to content

pphui8/phidippides

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phidippides

backend of huihuiblog

basic usage

phidippides [option]

  1. help : this help
  2. version : phidippides version
  3. filepath : configuration file path

todo list

  • read config file
  • open default page
  • build the frame

GET /   >> API test

expected return
{
    "status": 200
}

GET / index   >> get index of blog

expected return
[
    {
        "id": 1,
        "name": "pphui8",
        "descript": "hello world",
        "tag": "tag",
    },
    ......
]

GET / blog / { id }   >> get blog

expected return
{
    "status": 200,
    "blog_root": "https://xx.xxx.xxx",
}

POST / addblog   >> add blog

request body format
{
    "blog_name": "blog_name",
    "desc": "blog description",
    "value": "pphui8",
    "token": "xxxx",
    "tag": "tag"
}
expected return
# success
{
    "status": "success"
}
# failed
{
    "status": "failed",
    "error": "failed to add blog"
}
tag:
1.test  
2.note  
3.blog  
4.code  

GET / delblog / <blog_name> /   >> delete blog

expected return
// success
{
    "status": "success"
}
// failed
{
    "status": "failed",
    "error": "wrong token"
}GET

GET / comment   >> get comment

expected return
[
    {
        "id":1,
        "username":"pphui8",
        "url":"pphui8.com",
        "value":"test",
        "time": "xxxx/xx/xx",
    },
    .....
]

POST / addcomment   >> add comment

request body format
{
    "username": "blog_name",
    "url": "blog description",
    "value": "pphui8",
    "token": "xxx",
    "time": "time",
}
expected return
# success
{
    "status": "success"
}
# failed
{
    "status": "failed",
    "error": "failed to add blog"
}

GET / delcomment / <comment_id> /   >> delete comment

expected return
// success
{
    "status": "success"
}
// failed
{
    "status": "failed",
    "error": "wrong token"
}GET

GET / filing   >> get filing

expected return
{ 
    "test":0,
    "note":0,
    "blog":0,
    "code":0,
}