-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dingo/api component and jwt-auth component #23
base: dev-website
Are you sure you want to change the base?
Conversation
.gitignore
Outdated
/public/bower-assets | ||
.DS_Store | ||
composer.lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为了保持 vendor 的一致,不应该忽略 composer.lock 文件
|
||
$user = $this->auth->user(); | ||
|
||
$timelines = $query->get()->each(function($item, $key)use($user){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
代码风格问题
if (!$user) { | ||
$item->is_like = false; | ||
} else { | ||
$item->is_like = TimelineLike::where(['timeline_id' => $item->id, 'user_id' => $user->id])->count() ? true : false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
count() 或以替换成 exists()
Test URI:
|
Response Data Structure: Successhttp status code : 200
Failedhttp status code : 4xx or 5xx
|
找到一个方法,需要传入一个自定义的函数来实现返回数据的自定义格式。 |
Need to do: