美文网首页
2019-01-03 json格式

2019-01-03 json格式

作者: 鈤汌冈板 | 来源:发表于2019-01-03 15:28 被阅读8次

    首页:

    homepage?page=1
    

    详情页:

    /pagedetail?articalId=1268&sessionId=fjdljflsdjfldsjlsdff
    

    上传文章图片:

    post   /upLoadArticalImages
    
    {
    image : file,
    desc: , //图片描述
    time:1546400800
    firstPic:true //bool   是否是封面图
    }
    
    {
        "success": true,
        "msg": "ok",
        "errorCode": 10000,
        "data":{
            "success": true,
            "msg": "图片上传成功",
            "imageName": "images/CBZBjV3PdmTjh7zIemqUWKgp4PXicVgQ9qUrehEU.png"
            firstPic:true //bool   是否是封面图
          }
     }
    

    上传文章/继续添加文章:

    post  /saveArtical
    
    {
      "sessionId":"usertest",
      "address":"清徐县",   //继续添加,不传
      "country":"中国", //继续添加,不传
      "articalTitle":"题目", //继续添加,不传
      "articalId":"", //文章id,继续添加则传,如果新建文章,则不传
      "contentList":[
        {
          "time":"1546300800",
          "imageList": [
                {
                    "url":"images/ueHumPjCgK4RWeHAMZMusy7o2i1SnqXgOWyTCUtb.jpeg",
                    "firstPic":true
                },
                {
                    "url":"images/i2g4XUK55oN0F7YC1KMYw1uzU0Z1aJdjOwNtCut8.png",
                    "firstPic":false
                }
            ],
          "paragraph":"段落1"
        },
        {
          "time":"1546400800",
          "imageList": [
                {
                    "url":"images/r0TkmUQrM27NtuqrjvNOETe9owQQXev31hzL3c1a.jpeg",
                    "firstPic":false
                }
            ],
          "paragraph":"段落2"
        }
      ]
    }
    
    response:
    
    {
    "success": true,
    "msg": "ok",
    "errorCode": 10000,
    "data":{
    "success": true,
    "msg": "发布成功"
    }
    }
    

    添加用户:

    post  /addUser
    
    {
      "username":"123",
      "userphone":"123",
      "userpwd":"123"
    }
    
    {
    "success": true,
    "msg": "ok",
    "errorCode": 10000,
    "data":{
    "success": true,
    "msg": "注册成功",
    "sessionId": "730086ac-0f28-11e9-b9e2-acbc32d67229"
    }
    }
    

    上传头像:

    post  /upLoadHeadImage
    
    {
          "sessionId":"",
          "image": file
    }
    
    
    response:
    {
    "success": true,
    "msg": "ok",
    "errorCode": 10000,
    "data":{
    "success": true,
    "msg": "头像上传成功",
    "sessionId": null
    }
    }
    

    添加评论

    get  /addComments
    {
        "articalId"=1
        "comment"="这是评论..."
        "reply"=12    //这个id是回复的评论所属用户的id。如果是自己发的评论,这个值传空就行
        "sessionId"="usertest"
    }
    

    获取文章评论

    get   
    getComments?articalId=1
    

    关注/取消关注

    get  /addFavor
    {
          "sessionId"= "usertest"
          "articalId"=1
          "type"=1 //int  1 表示关注  2取消关注
    }
    
    {
    "success": true,
    "msg": "ok",
    "errorCode": 10000,
    "data":{
    "success": false,
    "msg": "已关注"
    }
    }
    

    判断是否已经关注:

    get  /isFavor
    {
        articalId=10,  //文章id
        sessionId=""
    }
    
    
    {
    "success": true,
    "msg": "ok",
    "errorCode": 10000,
    "data":{
    "success": false,
    "msg": "未关注"
    }
    }
    

    增加文章阅读数

    get  addRead?articalId=1
    
    {
         articalId=1
    }
    
    
    {
    "success": true,
    "msg": "ok",
    "errorCode": 10000,
    "data":{
    "success": true,
    "msg": "成功"
    }
    }
    

    获取个人喜欢列表

    /getFavorList?sessionId=usertest
    
    {
        "success": true,
        "msg": "ok",
        "errorCode": 10000,
        "data":{
            "success": true,
            "msg": "查询成功",
            "data":[
                          {
                          "artical_id": 1,
                          "artical_title": "Crazy in Boracay~",
                          "user_id": 1,
                          "address_id": 1,
                           "artical_favor": 44,
                              "artical_read": 77,
                              "artical_cover": null,
                            "created_at": null
                            }
                          ]
                   }
    }
    

    获取个人发表的文章列表

    /getMyArticalList?sessionId=usertest
    
    {
    "success": true,
    "msg": "ok",
    "errorCode": 10000,
    "data":{
    "success": true,
    "msg": "查询成功",
    "data":[
                  { 文章model参考上面}
                ]
    }
    }
    

    删除文章

    /deleteArtical?sessionId=usertest&articalId=1234
    
    {
    "success": true,
    "msg": "ok",
    "errorCode": 10000,
    "data":{
    "success": false,
    "msg": "您不是该文章作者",
    "data": null
    }
    }
    

    修改昵称

    /editName?sessionId=usertest&username=哈哈
    
    
    "success": true,
    "msg": "ok",
    "errorCode": 10000,
    "data":{
    "success": true,
    "msg": "修改成功",
    "data": null
    }
    }
    

    修改密码

    post
    
    /editPwd
    {
      "sessionId":"usertest",
      "userpwd":"ssss"
    }
    
    {
    "success": true,
    "msg": "ok",
    "errorCode": 10000,
    "data":{
    "success": true,
    "msg": "修改成功",
    "data": null
    }
    }
    
    

    退出登录

    /logout?sessionId=usertest
    
    {
    "success": true,
    "msg": "ok",
    "errorCode": 10000,
    "data":{
    "success": true,
    "msg": "退出成功",
    "data": null
    }
    }
    

    相关文章

      网友评论

          本文标题:2019-01-03 json格式

          本文链接:https://www.haomeiwen.com/subject/xiefrqtx.html