Share.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. namespace Content\V1;
  3. use Dever;
  4. class Share
  5. {
  6. public function url_api($link)
  7. {
  8. $link = base64_decode($link);
  9. Dever::location($link);
  10. }
  11. /**
  12. * @api {get} v1/share.submit 提交分享
  13. * @apiVersion 1.0.0
  14. * @apiName share.submit
  15. * @apiGroup Comment
  16. *
  17. * @apiDescription 用户提交分享接口
  18. *
  19. * @apiParam {Number} appid 小程序id
  20. * @apiParam {Number} uid 用户id
  21. * @apiParam {String} session 验证用户的session
  22. * @apiParam {Number} type 评论的类型:1为资讯2为课程3为会议
  23. * @apiParam {Number} id 分享的类型id
  24. * @apiParam {String} content 分享的内容
  25. *
  26. * @apiSuccess {Number} share_uid 用户id
  27. * @apiSuccess {String} share_key 分享的session
  28. * @apiSuccess {Number} share_id 分享的唯一id
  29. * @apiSuccess {String} desc 请将上述几个字段都放到分享的path中:/path/?share_uid=1&share_key=1&share_id=1
  30. *
  31. * @apiSuccessExample 操作成功
  32. * {"status":1,"code":1,"msg":"success","data":{"type":1,"id":1,"uid":1,"key":"11", "share_id":1}}
  33. *
  34. * @apiErrorExample 操作失败
  35. * {"status":2,"code":1,"msg":"\u9519\u8bef\u7684\u5c0f\u7a0b\u5e8fid"}
  36. */
  37. public function submit_api()
  38. {
  39. return Dever::load('comment/share.submit');
  40. }
  41. /**
  42. * @api {get} v1/share.reflux 分享回流
  43. * @apiVersion 1.0.0
  44. * @apiName share.reflux
  45. * @apiGroup Comment
  46. *
  47. * @apiDescription 用户分享回流接口,当path路径中有share_id时,请调用本接口
  48. *
  49. * @apiParam {Number} appid 小程序id
  50. * @apiParam {Number} uid 用户id
  51. * @apiParam {String} session 验证用户的session
  52. * @apiParam {Number} share_uid 分享人的用户id
  53. * @apiParam {Number} share_id 分享的id
  54. * @apiParam {Number} share_key 分享的session
  55. *
  56. * @apiSuccess {Bool} state 是否成功,无需关注这个接口返回值
  57. *
  58. * @apiSuccessExample 操作成功
  59. * {"status":1,"code":1,"msg":"success","data":true}
  60. *
  61. * @apiErrorExample 操作失败
  62. * {"status":2,"code":1,"msg":"\u9519\u8bef\u7684\u5c0f\u7a0b\u5e8fid"}
  63. */
  64. public function reflux_api()
  65. {
  66. return Dever::load('comment/share.reflux');
  67. }
  68. }