| xqd
@@ -1224,6 +1224,8 @@ class MyController extends Controller
|
|
|
* @apiDescription 发送私信
|
|
|
* @apiGroup My
|
|
|
* @apiParam {string} content 私信内容
|
|
|
+ * @apiParam {string} [image] 图片
|
|
|
+ * @apiParam {string} [video] 视频
|
|
|
* @apiParam {int} to_user_id 私信对象
|
|
|
* @apiPermission Passport
|
|
|
* @apiVersion 0.1.0
|
| xqd
@@ -1259,6 +1261,8 @@ class MyController extends Controller
|
|
|
$user = $this->getUser();
|
|
|
$user_id = $user->id;
|
|
|
$info = $request->input('content');
|
|
|
+ $video = $request->input('video');
|
|
|
+ $image = $request->input('image');
|
|
|
$to_user_id = $request->input('to_user_id');
|
|
|
// 链接到最近的一个梦想
|
|
|
$dream = DreamInfoModel::where('user_id',$user_id)->orderBy('id','desc')->first();
|
| xqd
@@ -1269,6 +1273,8 @@ class MyController extends Controller
|
|
|
'message'=>$user->nickname.'给你发了个私信哦~点击看看!',
|
|
|
'to_user_id'=>$user_id,
|
|
|
'dream_id'=>$dream_id,
|
|
|
+ 'video'=>$video,
|
|
|
+ 'image'=>$image,
|
|
|
'type_id'=>2,
|
|
|
'is_url'=>1,
|
|
|
'attr_id'=>9,
|
| xqd
@@ -1281,7 +1287,8 @@ class MyController extends Controller
|
|
|
}else{
|
|
|
return $this->error(ErrorCode::OPERATION_FAILED);
|
|
|
}
|
|
|
- } /**
|
|
|
+ }
|
|
|
+ /**
|
|
|
* @api {get} /api/my/letter/show 查看私信
|
|
|
* @apiDescription 查看私信
|
|
|
* @apiGroup My
|
| xqd
@@ -1323,4 +1330,55 @@ class MyController extends Controller
|
|
|
return $this->api($data);
|
|
|
}
|
|
|
|
|
|
+// 梦想结束时梦想者是否同意见面
|
|
|
+ /**
|
|
|
+ * @api {get} /api/my/system/dream_isok 是否同意见面
|
|
|
+ * @apiDescription 梦想结束时梦想者是否同意见面
|
|
|
+ * @apiGroup My
|
|
|
+ * @apiParam {int} dream_id 梦想id
|
|
|
+ * @apiParam {int} value 0取消1确定
|
|
|
+ * @apiPermission Passport
|
|
|
+ * @apiVersion 0.1.0
|
|
|
+ * @apiSuccessExample {json} Success-Response:
|
|
|
+ * HTTP/1.1 200 OK
|
|
|
+ *{
|
|
|
+ * "status": true,
|
|
|
+ * "status_code": 0,
|
|
|
+ * "message": "",
|
|
|
+ * "data": ""
|
|
|
+ *}
|
|
|
+ * @apiErrorExample {json} Error-Response:
|
|
|
+ *{
|
|
|
+ * "status": false,
|
|
|
+ * "status_code": 700,
|
|
|
+ * "message": "操作失败",
|
|
|
+ * "data": null
|
|
|
+ *}
|
|
|
+ */
|
|
|
+ public function isOk(Request $request)
|
|
|
+ {
|
|
|
+ $validator = \Validator::make($request->all(),
|
|
|
+ [
|
|
|
+ 'value' => 'required',
|
|
|
+ 'dream_id' => 'required',
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 'value.required' => '参数错误',
|
|
|
+ 'dream_id.required' => '梦想不存在',
|
|
|
+ ]
|
|
|
+ );
|
|
|
+ if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
|
|
|
+ $dream_id = $request->input('dream_id');
|
|
|
+ $value = $request->input('value');
|
|
|
+ $dream = DreamInfoModel::find($dream_id);
|
|
|
+ if (empty($dream)) return $this->error(ErrorCode::DREAM_NOT_EXIST);
|
|
|
+ if (empty($value)) {
|
|
|
+
|
|
|
+ }else{
|
|
|
+// 同意见面
|
|
|
+ $dream->is_ok = 1;
|
|
|
+ $dream->save();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|