點贊

接口約定

  • 使用https
  • restful風格
  • 用戶端:https://{域名}/api/{接口版本號}/{resource}/{resource_id}/{sub_resource}/{sub_resource_id}/{action}?{query_string}
  • 管理端:https://{域名}/admin/api/{接口版本號}/{resource}/{resource_id}/{sub_resource}/{sub_resource_id}/{action}?{query_string}
  • 測試環(huán)境域名babieta.xivan.cn
  • 正式環(huán)境域名待定
  • 公共參數(shù)放在header,如userid,session_key,unionid,version等
  • resource: praises

接口


POST /praises/<busi_type>/<busi_id>/<action>

name cname type Description
用途 點贊
版本號 v1.0
busi_type 業(yè)務(wù)類型 string comment(評論)/soak(浸泡訓練音頻)/comm_sound(交流語音)
busi_id 業(yè)務(wù)id string
action 業(yè)務(wù)id praise(點贊)/unpraise(取消點贊)
請求數(shù)據(jù):

body 參數(shù)/可選參數(shù)

name cname type Description

curl -i "https://babieta.xivan.cn/api/v1.0/praises/comment/2/praise" -H "userid:oslC94mGqAAEz6iWhKhL9dEY5l3o" -H "token:25e8ba0469c6f1c0c6dcd4fe952b8e4e" 

wx.request({
      "url":"https://babieta.xivan.cn/api/v1.0/praises/comment/2/praise", 
      "method":"GET",
      "success": res =>{
        console.log(res)
      },
      "data":{},
      "dataType":"json", 
      "header": { "content-type":"application/x-www-form-urlencoded",
        "userid": "oslC94mGqAAEz6iWhKhL9dEY5l3o", "token":"25e8ba0469c6f1c0c6dcd4fe952b8e4e"},
      "complete": res => {
        console.log(res)
      }
    })
返回數(shù)據(jù):
name cname type Description
code int 返回碼 0成功 非0失敗
msg string 錯誤信息
praise_count string 當前點贊數(shù)

{
    "msg": "",
    "code": 0,
        "praise_count":5
}
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容