rabin 7 years ago
parent
commit
45f50d7daf

+ 1 - 13
comment/database/review.php

@@ -22,7 +22,7 @@ return array
 	# 表名
 	'name' => 'review',
 	# 显示给用户看的名称
-	'lang' => '评论',
+	'lang' => '评论列表',
 	# 是否显示在后台菜单
 	'order' => 80,
 	# 数据结构
@@ -100,18 +100,6 @@ return array
 			'modal'		=> '查看详情',
 		),
 		
-		'ip'		=> array
-		(
-			'type' 		=> 'varchar-32',
-			'name' 		=> 'IP',
-			'default' 	=> '',
-			'desc' 		=> '请输入IP',
-			'match' 	=> 'option',
-			'update'	=> 'text',
-			//'search'	=> 'fulltext',
-			'list'		=> true,
-		),
-		
 		'state'		=> array
 		(
 			'type' 		=> 'tinyint-1',

+ 156 - 0
comment/database/share.php

@@ -0,0 +1,156 @@
+<?php
+
+$table = array
+(
+	1 => '资讯',
+	2 => '课程',
+);
+
+$info = function()
+{
+	$array = array();
+	$info = Dever::load('set/info-state');
+	if($info)
+	{
+		$array += $info;
+	}
+	return $array;
+};
+
+return array
+(
+	# 表名
+	'name' => 'share',
+	# 显示给用户看的名称
+	'lang' => '分享列表',
+	# 是否显示在后台菜单
+	'order' => 70,
+	# 数据结构
+	'struct' => array
+	(
+		'id' 		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> 'ID',
+			'default' 	=> '',
+			'desc' 		=> '',
+			'match' 	=> 'is_numeric',
+			'order'		=> 'desc',
+			//'list'		=> true,
+		),
+		
+
+		'uid'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '用户',
+			'default' 	=> '0',
+			'desc' 		=> '请选择用户',
+			'match' 	=> 'is_numeric',
+			//'update'	=> 'select',
+			//'search'	=> 'select',
+			'list'		=> '{uid} > 0 ? Dever::load("passport/user-one#name", {uid}) : "匿名用户"',
+		),
+
+		'info_id'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '所属小程序',
+			'default' 	=> '1',
+			'desc' 		=> '请选择所属小程序',
+			'match' 	=> 'is_numeric',
+			'update'	=> 'select',
+			'option'	=> $info,
+			'search'	=> 'select',
+			'list'		=> '{info_id} > 0 ? Dever::load("set/info-one#name", {info_id}) : "未知"',
+		),
+
+		'source_table' 		=> array
+		(
+			'type' 		=> 'tinyint-1',
+			'name' 		=> '分享类别',
+			'default' 	=> '',
+			'desc' 		=> '分享类别',
+			'match' 	=> 'option',
+			'option' 	=> $table,
+			'list'		=> true,
+		),
+		
+		'source_id' 		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '标题',
+			'default' 	=> '',
+			'desc' 		=> '标题',
+			'match' 	=> 'option',
+			'list'		=> '{source_table} == 1 ? Dever::load("content/news-one#name", {source_id}) : Dever::load("content/course-one#name", {source_id})',
+		),
+		
+		'content'		=> array
+		(
+			'type' 		=> 'text-255',
+			'name' 		=> '分享内容',
+			'update' 	=> 'textarea',
+			'key'		=> 1,
+			'default' 	=> '',
+			'desc' 		=> '请输入内容',
+			'match' 	=> 'is_string',
+			'search'	=> 'fulltext',
+			'list'		=> 'table',
+			'modal'		=> '查看详情',
+		),
+
+		'key'		=> array
+		(
+			'type' 		=> 'varchar-32',
+			'name' 		=> '分享标识',
+			'default' 	=> '',
+			'desc' 		=> '请输入分享标识',
+			'match' 	=> 'option',
+		),
+		
+		'state'		=> array
+		(
+			'type' 		=> 'tinyint-1',
+			'name' 		=> '状态',
+			'default' 	=> '1',
+			'desc' 		=> '请选择状态',
+			'match' 	=> 'is_numeric',
+		),
+		
+		'cdate'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '录入时间',
+			'match' 	=> array('is_numeric', time()),
+			'desc' 		=> '',
+			# 只有insert时才生效
+			'insert'	=> true,
+			'list'		=> 'date("Y-m-d H:i:s", {cdate})',
+		),
+	),
+
+	'manage' => array
+	(
+		'insert' => false,
+	),
+
+	# request 请求接口定义
+	'request' => array
+	(
+		'getAll' => array
+		(
+			# 匹配的正则或函数 选填项
+			'option' => array
+			(
+				'info_id' => 'yes',
+				'source_table' => 'yes',
+				'source_id' => 'yes',
+			),
+			'type' => 'all',
+			'order' => array('id' => 'desc'),
+			'page' => array(10, 'list'),
+			'col' => '*',
+		),
+	),
+);

+ 139 - 0
comment/database/share_reflux.php

@@ -0,0 +1,139 @@
+<?php
+
+$table = array
+(
+	1 => '资讯',
+	2 => '课程',
+);
+
+$info = function()
+{
+	$array = array();
+	$info = Dever::load('set/info-state');
+	if($info)
+	{
+		$array += $info;
+	}
+	return $array;
+};
+
+return array
+(
+	# 表名
+	'name' => 'share_reflux',
+	# 显示给用户看的名称
+	'lang' => '分享回流',
+	# 是否显示在后台菜单
+	'order' => 60,
+	# 数据结构
+	'struct' => array
+	(
+		'id' 		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> 'ID',
+			'default' 	=> '',
+			'desc' 		=> '',
+			'match' 	=> 'is_numeric',
+			'order'		=> 'desc',
+			//'list'		=> true,
+		),
+		
+
+		'uid'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '用户',
+			'default' 	=> '0',
+			'desc' 		=> '请选择用户',
+			'match' 	=> 'is_numeric',
+			//'update'	=> 'select',
+			//'search'	=> 'select',
+			'list'		=> '{uid} > 0 ? Dever::load("passport/user-one#name", {uid}) : "匿名用户"',
+		),
+
+		'info_id'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '所属小程序',
+			'default' 	=> '1',
+			'desc' 		=> '请选择所属小程序',
+			'match' 	=> 'is_numeric',
+			'update'	=> 'select',
+			'option'	=> $info,
+			'search'	=> 'select',
+			'list'		=> '{info_id} > 0 ? Dever::load("set/info-one#name", {info_id}) : "未知"',
+		),
+
+		'source_table' 		=> array
+		(
+			'type' 		=> 'tinyint-1',
+			'name' 		=> '分享类别',
+			'default' 	=> '',
+			'desc' 		=> '分享类别',
+			'match' 	=> 'option',
+			'option' 	=> $table,
+			'list'		=> true,
+		),
+		
+		'source_id' 		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '标题',
+			'default' 	=> '',
+			'desc' 		=> '标题',
+			'match' 	=> 'option',
+			'list'		=> '{source_table} == 1 ? Dever::load("content/news-one#name", {source_id}) : Dever::load("content/course-one#name", {source_id})',
+		),
+
+		'source_uid' 		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '分享者',
+			'default' 	=> '',
+			'desc' 		=> '分享者',
+			'match' 	=> 'option',
+			'list'		=> '{uid} > 0 ? Dever::load("passport/user-one#name", {uid}) : "匿名用户"',
+		),
+		
+		'share_id' 		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '分享id',
+			'default' 	=> '',
+			'desc' 		=> '分享id',
+			'match' 	=> 'option',
+		),
+		
+		'state'		=> array
+		(
+			'type' 		=> 'tinyint-1',
+			'name' 		=> '状态',
+			'default' 	=> '1',
+			'desc' 		=> '请选择状态',
+			'match' 	=> 'is_numeric',
+		),
+		
+		'cdate'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '录入时间',
+			'match' 	=> array('is_numeric', time()),
+			'desc' 		=> '',
+			# 只有insert时才生效
+			'insert'	=> true,
+			'list'		=> 'date("Y-m-d H:i:s", {cdate})',
+		),
+	),
+
+	'manage' => array
+	(
+		'insert' => false,
+	),
+
+	# request 请求接口定义
+	'request' => array
+	(
+		
+	),
+);

+ 0 - 12
comment/database/vote.php

@@ -83,18 +83,6 @@ return array
 			'match' 	=> 'option',
 			'list'		=> '{source_table} == 1 ? Dever::load("content/news-one#name", {source_id}) : Dever::load("content/course-one#name", {source_id})',
 		),
-		
-		'ip'		=> array
-		(
-			'type' 		=> 'varchar-32',
-			'name' 		=> 'IP',
-			'default' 	=> '',
-			'desc' 		=> '请输入IP',
-			'match' 	=> 'option',
-			'update'	=> 'text',
-			'search'	=> 'fulltext',
-			'list'		=> true,
-		),
 
 		'state'		=> array
 		(

+ 2 - 2
comment/src/Review.php

@@ -42,7 +42,7 @@ class Review extends Base
         $source_id = Dever::input('id');
         $content = Dever::input('content');
         //后续添加内容过滤
-        $ip = Dever::ip();
+        //$ip = Dever::ip();
         $uid = Dever::input('uid');
 
         $data = Dever::load('comment/review-one', array('option_info_id' => $this->data['info']['id'], 'option_source_table' => $source_table, 'option_source_id' => $source_id, 'option_uid' => $uid, 'option_content' => $content));
@@ -55,7 +55,7 @@ class Review extends Base
         } else {
             $insert['add_source_table'] = $source_table;
             $insert['add_source_id'] = $source_id;
-            $insert['add_ip'] = $ip;
+            //$insert['add_ip'] = $ip;
             $insert['content'] = $content;
             $insert['add_uid'] = $uid;
             $insert['add_info_id'] = $this->data['info']['id'];

+ 67 - 0
comment/src/Share.php

@@ -0,0 +1,67 @@
+<?php
+
+namespace Comment\Src;
+
+use Dever;
+use Content\Lib\Base;
+
+class Share extends Base
+{
+    /**
+     * 分享
+     *
+     * @return mixed
+     */
+    public function submit_api()
+    {
+        $this->check_user();
+        $source_table = Dever::input('type');
+        $source_id = Dever::input('id');
+        $uid = Dever::input('uid');
+        $content = Dever::input('content');
+
+        $insert['add_source_table'] = $source_table;
+        $insert['add_source_id'] = $source_id;
+        $insert['add_uid'] = $uid;
+        $insert['add_info_id'] = $this->data['info']['id'];
+        $insert['add_key'] = $this->session($uid);
+        $insert['add_content'] = $content;
+
+        $id = Dever::load('comment/share-insert', $insert);
+
+        $result['share_uid'] = $uid;
+        $result['share_key'] = $insert['add_key'];
+        $result['share_id'] = $id;
+
+        return $result;
+    }
+
+    /**
+     * 分享回流
+     *
+     * @return mixed
+     */
+    public function reflux_api()
+    {
+        $this->check_user();
+        $source_uid = Dever::input('share_uid');
+        $key = Dever::input('key');
+        $id = Dever::input('share_id');
+        $uid = Dever::input('uid');
+
+        $info = Dever::load('comment/share-one', $id);
+        if ($info) {
+            $insert['add_source_table'] = $info['source_table'];
+            $insert['add_source_id'] = $info['source_id'];
+            $insert['add_share_id'] = $id;
+            $insert['add_source_uid'] = $source_uid;
+            $insert['add_uid'] = $uid;
+            $insert['add_info_id'] = $this->data['info']['id'];
+            if ($source_uid != $uid && $this->check_session($source_uid)) {
+                Dever::load('comment/share_reflux-insert', $insert);
+            }
+        }
+
+        return true;
+    }
+}

+ 2 - 2
comment/src/Vote.php

@@ -17,7 +17,7 @@ class Vote extends Base
         $this->check_user();
         $source_table = Dever::input('type');
         $source_id = Dever::input('id');
-        $ip = Dever::ip();
+        //$ip = Dever::ip();
         $uid = Dever::input('uid');
 
         $data = Dever::load('comment/vote-one', array('option_info_id' => $this->data['info']['id'], 'option_source_table' => $source_table, 'option_source_id' => $source_id, 'option_uid' => $uid));
@@ -30,7 +30,7 @@ class Vote extends Base
         } else {
             $insert['add_source_table'] = $source_table;
             $insert['add_source_id'] = $source_id;
-            $insert['add_ip'] = $ip;
+            //$insert['add_ip'] = $ip;
             $insert['add_uid'] = $uid;
             $insert['add_info_id'] = $this->data['info']['id'];
 

+ 8 - 5
content/lib/Base.php

@@ -92,6 +92,9 @@ class Base
         $session = Dever::input('session');
 
         $state = $this->check_session($uid, $session);
+        if (!$state) {
+            Dever::alert('请重新登录');
+        }
 
         return $state;
     }
@@ -101,9 +104,9 @@ class Base
      *
      * @return mixed
      */
-    protected function session($uid)
+    protected function session($uid, $prefix = 'user')
     {
-        $secret = md5($uid . '_' . Dever::config('base')->secret);
+        $secret = md5($prefix . '_' . $uid . '_' . Dever::config('base')->secret);
 
         return $secret;
     }
@@ -113,11 +116,11 @@ class Base
      *
      * @return mixed
      */
-    protected function check_session($uid, $session)
+    protected function check_session($uid, $session, $prefix = 'user')
     {
-        $secret = $this->session($uid);
+        $secret = $this->session($uid, $prefix);
         if ($secret != $session) {
-            Dever::alert('请重新登录');
+            return false;
         }
         return true;
     }

+ 67 - 0
content/v1/Share.php

@@ -0,0 +1,67 @@
+<?php
+
+namespace Content\V1;
+
+use Dever;
+
+class Share
+{
+    /**
+     * @api {get} v1/share.submit 提交分享
+     * @apiVersion 1.0.0
+     * @apiName share.submit
+     * @apiGroup Comment
+     *
+     * @apiDescription 用户提交分享接口
+     *
+     * @apiParam {Number} appid 小程序id
+     * @apiParam {Number} uid 用户id
+     * @apiParam {String} session 验证用户的session
+     * @apiParam {Number} type 分享的类型:1为资讯2为课程
+     * @apiParam {Number} id 分享的类型id
+     * @apiParam {String} content 分享的内容
+     *
+     * @apiSuccess {Number}   share_uid  用户id
+     * @apiSuccess {String}   share_key  分享的session
+     * @apiSuccess {Number}   share_id  分享的唯一id
+     * @apiSuccess {String}   desc  请将上述几个字段都放到分享的path中:/path/?share_uid=1&share_key=1&share_id=1
+     *
+     * @apiSuccessExample 操作成功
+     * {"status":1,"code":1,"msg":"success","data":{"type":1,"id":1,"uid":1,"key":"11", "share_id":1}}
+     *
+     * @apiErrorExample 操作失败
+     * {"status":2,"code":1,"msg":"\u9519\u8bef\u7684\u5c0f\u7a0b\u5e8fid"}
+     */
+    public function submit_api()
+    {
+        return Dever::load('comment/share.submit');
+    }
+
+    /**
+     * @api {get} v1/share.reflux 分享回流
+     * @apiVersion 1.0.0
+     * @apiName share.reflux
+     * @apiGroup Comment
+     *
+     * @apiDescription 用户分享回流接口,当path路径中有share_id时,请调用本接口
+     *
+     * @apiParam {Number} appid 小程序id
+     * @apiParam {Number} uid 用户id
+     * @apiParam {String} session 验证用户的session
+     * @apiParam {Number} share_uid 分享人的用户id
+     * @apiParam {Number} share_id 分享的id
+     * @apiParam {Number} share_key 分享的session
+     *
+     * @apiSuccess {Bool}   state  是否成功,无需关注这个接口返回值
+     *
+     * @apiSuccessExample 操作成功
+     * {"status":1,"code":1,"msg":"success","data":true}
+     *
+     * @apiErrorExample 操作失败
+     * {"status":2,"code":1,"msg":"\u9519\u8bef\u7684\u5c0f\u7a0b\u5e8fid"}
+     */
+    public function reflux_api()
+    {
+        return Dever::load('comment/share.reflux');
+    }
+}

+ 197 - 0
doc/api_data.js

@@ -266,6 +266,203 @@ define({ "api": [
     "filename": "/root/input/content/v1/Review.php",
     "groupTitle": "Comment"
   },
+  {
+    "type": "get",
+    "url": "v1/share.reflux",
+    "title": "分享回流",
+    "version": "1.0.0",
+    "name": "share_reflux",
+    "group": "Comment",
+    "description": "<p>用户分享回流接口,当path路径中有share_id时,请调用本接口</p>",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "Number",
+            "optional": false,
+            "field": "appid",
+            "description": "<p>小程序id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "Number",
+            "optional": false,
+            "field": "uid",
+            "description": "<p>用户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "String",
+            "optional": false,
+            "field": "session",
+            "description": "<p>验证用户的session</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "Number",
+            "optional": false,
+            "field": "share_uid",
+            "description": "<p>分享人的用户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "Number",
+            "optional": false,
+            "field": "share_id",
+            "description": "<p>分享的id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "Number",
+            "optional": false,
+            "field": "share_key",
+            "description": "<p>分享的session</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "fields": {
+        "Success 200": [
+          {
+            "group": "Success 200",
+            "type": "Bool",
+            "optional": false,
+            "field": "state",
+            "description": "<p>是否成功,无需关注这个接口返回值</p>"
+          }
+        ]
+      },
+      "examples": [
+        {
+          "title": "操作成功",
+          "content": "{\"status\":1,\"code\":1,\"msg\":\"success\",\"data\":true}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "操作失败",
+          "content": "{\"status\":2,\"code\":1,\"msg\":\"\\u9519\\u8bef\\u7684\\u5c0f\\u7a0b\\u5e8fid\"}",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "/root/input/content/v1/Share.php",
+    "groupTitle": "Comment"
+  },
+  {
+    "type": "get",
+    "url": "v1/share.submit",
+    "title": "提交分享",
+    "version": "1.0.0",
+    "name": "share_submit",
+    "group": "Comment",
+    "description": "<p>用户提交分享接口</p>",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "Number",
+            "optional": false,
+            "field": "appid",
+            "description": "<p>小程序id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "Number",
+            "optional": false,
+            "field": "uid",
+            "description": "<p>用户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "String",
+            "optional": false,
+            "field": "session",
+            "description": "<p>验证用户的session</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "Number",
+            "optional": false,
+            "field": "type",
+            "description": "<p>分享的类型:1为资讯2为课程</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "Number",
+            "optional": false,
+            "field": "id",
+            "description": "<p>分享的类型id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "String",
+            "optional": false,
+            "field": "content",
+            "description": "<p>分享的内容</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "fields": {
+        "Success 200": [
+          {
+            "group": "Success 200",
+            "type": "Number",
+            "optional": false,
+            "field": "share_uid",
+            "description": "<p>用户id</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "String",
+            "optional": false,
+            "field": "share_key",
+            "description": "<p>分享的session</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "Number",
+            "optional": false,
+            "field": "share_id",
+            "description": "<p>分享的唯一id</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "String",
+            "optional": false,
+            "field": "desc",
+            "description": "<p>请将上述几个字段都放到分享的path中:/path/?share_uid=1&amp;share_key=1&amp;share_id=1</p>"
+          }
+        ]
+      },
+      "examples": [
+        {
+          "title": "操作成功",
+          "content": "{\"status\":1,\"code\":1,\"msg\":\"success\",\"data\":{\"type\":1,\"id\":1,\"uid\":1,\"key\":\"11\", \"share_id\":1}}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "操作失败",
+          "content": "{\"status\":2,\"code\":1,\"msg\":\"\\u9519\\u8bef\\u7684\\u5c0f\\u7a0b\\u5e8fid\"}",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "/root/input/content/v1/Share.php",
+    "groupTitle": "Comment"
+  },
   {
     "type": "get",
     "url": "v1/vote.submit",

+ 197 - 0
doc/api_data.json

@@ -266,6 +266,203 @@
     "filename": "/root/input/content/v1/Review.php",
     "groupTitle": "Comment"
   },
+  {
+    "type": "get",
+    "url": "v1/share.reflux",
+    "title": "分享回流",
+    "version": "1.0.0",
+    "name": "share_reflux",
+    "group": "Comment",
+    "description": "<p>用户分享回流接口,当path路径中有share_id时,请调用本接口</p>",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "Number",
+            "optional": false,
+            "field": "appid",
+            "description": "<p>小程序id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "Number",
+            "optional": false,
+            "field": "uid",
+            "description": "<p>用户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "String",
+            "optional": false,
+            "field": "session",
+            "description": "<p>验证用户的session</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "Number",
+            "optional": false,
+            "field": "share_uid",
+            "description": "<p>分享人的用户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "Number",
+            "optional": false,
+            "field": "share_id",
+            "description": "<p>分享的id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "Number",
+            "optional": false,
+            "field": "share_key",
+            "description": "<p>分享的session</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "fields": {
+        "Success 200": [
+          {
+            "group": "Success 200",
+            "type": "Bool",
+            "optional": false,
+            "field": "state",
+            "description": "<p>是否成功,无需关注这个接口返回值</p>"
+          }
+        ]
+      },
+      "examples": [
+        {
+          "title": "操作成功",
+          "content": "{\"status\":1,\"code\":1,\"msg\":\"success\",\"data\":true}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "操作失败",
+          "content": "{\"status\":2,\"code\":1,\"msg\":\"\\u9519\\u8bef\\u7684\\u5c0f\\u7a0b\\u5e8fid\"}",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "/root/input/content/v1/Share.php",
+    "groupTitle": "Comment"
+  },
+  {
+    "type": "get",
+    "url": "v1/share.submit",
+    "title": "提交分享",
+    "version": "1.0.0",
+    "name": "share_submit",
+    "group": "Comment",
+    "description": "<p>用户提交分享接口</p>",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "Number",
+            "optional": false,
+            "field": "appid",
+            "description": "<p>小程序id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "Number",
+            "optional": false,
+            "field": "uid",
+            "description": "<p>用户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "String",
+            "optional": false,
+            "field": "session",
+            "description": "<p>验证用户的session</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "Number",
+            "optional": false,
+            "field": "type",
+            "description": "<p>分享的类型:1为资讯2为课程</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "Number",
+            "optional": false,
+            "field": "id",
+            "description": "<p>分享的类型id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "String",
+            "optional": false,
+            "field": "content",
+            "description": "<p>分享的内容</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "fields": {
+        "Success 200": [
+          {
+            "group": "Success 200",
+            "type": "Number",
+            "optional": false,
+            "field": "share_uid",
+            "description": "<p>用户id</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "String",
+            "optional": false,
+            "field": "share_key",
+            "description": "<p>分享的session</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "Number",
+            "optional": false,
+            "field": "share_id",
+            "description": "<p>分享的唯一id</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "String",
+            "optional": false,
+            "field": "desc",
+            "description": "<p>请将上述几个字段都放到分享的path中:/path/?share_uid=1&amp;share_key=1&amp;share_id=1</p>"
+          }
+        ]
+      },
+      "examples": [
+        {
+          "title": "操作成功",
+          "content": "{\"status\":1,\"code\":1,\"msg\":\"success\",\"data\":{\"type\":1,\"id\":1,\"uid\":1,\"key\":\"11\", \"share_id\":1}}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "操作失败",
+          "content": "{\"status\":2,\"code\":1,\"msg\":\"\\u9519\\u8bef\\u7684\\u5c0f\\u7a0b\\u5e8fid\"}",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "/root/input/content/v1/Share.php",
+    "groupTitle": "Comment"
+  },
   {
     "type": "get",
     "url": "v1/vote.submit",

+ 1 - 1
doc/api_project.js

@@ -13,7 +13,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2018-03-25T08:20:52.274Z",
+    "time": "2018-03-25T12:20:24.006Z",
     "url": "http://apidocjs.com",
     "version": "0.17.6"
   }

+ 1 - 1
doc/api_project.json

@@ -13,7 +13,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2018-03-25T08:20:52.274Z",
+    "time": "2018-03-25T12:20:24.006Z",
     "url": "http://apidocjs.com",
     "version": "0.17.6"
   }