作者 郭盛
1 个管道 的构建 通过 耗费 0 秒

图片

... ... @@ -2,6 +2,7 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="e93f11c2-a7d9-4d35-8b1c-8dd18e7f5fef" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/api/controller/User.php" afterPath="$PROJECT_DIR$/application/api/controller/User.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/public/api.html" afterPath="$PROJECT_DIR$/public/api.html" />
</list>
... ... @@ -17,8 +18,8 @@
<file leaf-file-name="User.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/application/api/controller/User.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="254">
<caret line="219" column="17" lean-forward="true" selection-start-line="219" selection-start-column="17" selection-end-line="219" selection-end-column="17" />
<state relative-caret-position="329">
<caret line="271" column="5" lean-forward="true" selection-start-line="271" selection-start-column="5" selection-end-line="271" selection-end-column="5" />
<folding>
<element signature="e#38#68#0#PHP" expanded="true" />
<element signature="e#312#384#0#PHP" expanded="false" />
... ... @@ -27,6 +28,7 @@
<element signature="e#2802#3330#0#PHP" expanded="false" />
<element signature="e#3335#4106#0#PHP" expanded="false" />
<element signature="e#4112#4519#0#PHP" expanded="false" />
<element signature="e#4873#5474#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ... @@ -110,8 +112,8 @@
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds">
<option name="x" value="362" />
<option name="y" value="79" />
<option name="x" value="667" />
<option name="y" value="102" />
<option name="width" value="1589" />
<option name="height" value="930" />
</component>
... ... @@ -207,7 +209,7 @@
<workItem from="1574122453532" duration="15780000" />
<workItem from="1574141466352" duration="745000" />
<workItem from="1574143209694" duration="3660000" />
<workItem from="1574146994475" duration="4250000" />
<workItem from="1574146994475" duration="4813000" />
</task>
<task id="LOCAL-00001" summary="调试">
<created>1574145133364</created>
... ... @@ -220,7 +222,7 @@
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="52603000" />
<option name="totallyTimeSpent" value="53166000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
... ... @@ -232,7 +234,7 @@
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="362" y="79" width="1589" height="930" extended-state="0" />
<frame x="667" y="102" width="1589" height="930" extended-state="0" />
<layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.18574232" sideWeight="0.5" order="1" side_tool="false" content_ui="combo" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32912987" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
... ... @@ -639,8 +641,8 @@
</entry>
<entry file="file://$PROJECT_DIR$/application/api/controller/User.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="254">
<caret line="219" column="17" lean-forward="true" selection-start-line="219" selection-start-column="17" selection-end-line="219" selection-end-column="17" />
<state relative-caret-position="329">
<caret line="271" column="5" lean-forward="true" selection-start-line="271" selection-start-column="5" selection-end-line="271" selection-end-column="5" />
<folding>
<element signature="e#38#68#0#PHP" expanded="true" />
<element signature="e#312#384#0#PHP" expanded="false" />
... ... @@ -649,6 +651,7 @@
<element signature="e#2802#3330#0#PHP" expanded="false" />
<element signature="e#3335#4106#0#PHP" expanded="false" />
<element signature="e#4112#4519#0#PHP" expanded="false" />
<element signature="e#4873#5474#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ...
... ... @@ -175,7 +175,7 @@ class User extends Api
"data": {
"id": 4,//视频id/图片id,
"thumbnail": //视频封面图地址/图片地址,
"video": //视频路径,
"video": //视频路径/精美大片视频路径,
}
})
*/
... ... @@ -226,6 +226,49 @@ class User extends Api
}
/**
* @ApiTitle (图片列表)
* @ApiSummary (图片列表)
* @ApiMethod (POST)
* @ApiRoute (/api/user/pic)
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiParams (name="type_id", type="inter", required=false, description="地区ID")
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1571492001",
"data": {
"id": 4,//图片id,
"thumbnail": //缩略图,
}
})
*/
public function pic()
{
$rule = config('verify.path');
$type_id = $this->request->post('type_id');
if(empty($type_id)){
$data = Db::name('pic')
->field('id,thumbnail')
->order('id desc')
->select();
foreach ($data as &$v){
$v['thumbnail'] = $rule.$v['thumbnail'];
}
$this->success('SUCCESS',$data);
}else{
$type = ','.$type_id.',';
$where['type_ids'] = ['like',"%$type%"];
$data = Db::name('pic')
->where($where)
->field('id,thumbnail')
->order('id desc')
->select();
foreach ($data as &$v){
$v['thumbnail'] = $rule.$v['thumbnail'];
}
$this->success('SUCCESS',$data);
}
}
}
... ...
... ... @@ -168,6 +168,7 @@
<a href="javascript:;" data-id="9" class="list-group-item">首页视频、图片、精美大片入口</a>
<a href="javascript:;" data-id="10" class="list-group-item">地区分类</a>
<a href="javascript:;" data-id="11" class="list-group-item">搜索页</a>
<a href="javascript:;" data-id="12" class="list-group-item">图片列表</a>
</div>
</div>
</div>
... ... @@ -1681,7 +1682,153 @@
"data": {
"id": 4,//视频id/图片id,
"thumbnail": //视频封面图地址/图片地址,
"video": //视频路径,
"video": //视频路径/精美大片视频路径,
}
}</pre>
</div>
</div>
</div><!-- #sample -->
</div><!-- .tab-content -->
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" id="heading-12">
<h4 class="panel-title">
<span class="label label-primary">POST</span>
<a data-toggle="collapse" data-parent="#accordion12" href="#collapseOne12"> 图片列表 <span class="text-muted">/api/user/pic</span></a>
</h4>
</div>
<div id="collapseOne12" class="panel-collapse collapse">
<div class="panel-body">
<!-- Nav tabs -->
<ul class="nav nav-tabs" id="doctab12">
<li class="active"><a href="#info12" data-toggle="tab">基础信息</a></li>
<li><a href="#sandbox12" data-toggle="tab">在线测试</a></li>
<li><a href="#sample12" data-toggle="tab">返回示例</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="info12">
<div class="well">
图片列表 </div>
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
<table class="table table-hover">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>token</td>
<td>string</td>
<td></td>
<td>请求的Token</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<table class="table table-hover">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>type_id</td>
<td>inter</td>
<td></td>
<td>地区ID</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>正文</strong></div>
<div class="panel-body">
</div>
</div>
</div><!-- #info -->
<div class="tab-pane" id="sandbox12">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
<div class="headers">
<div class="form-group">
<label class="control-label" for="token">token</label>
<input type="string" class="form-control input-sm" id="token" required placeholder="请求的Token - Ex: " name="token">
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/pic" method="POST" name="form12" id="form12">
<div class="form-group">
<label class="control-label" for="type_id">type_id</label>
<input type="inter" class="form-control input-sm" id="type_id" placeholder="地区ID" name="type_id">
</div>
<div class="form-group">
<button type="submit" class="btn btn-success send" rel="12">提交</button>
<button type="reset" class="btn btn-info" rel="12">重置</button>
</div>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>响应输出</strong></div>
<div class="panel-body">
<div class="row">
<div class="col-md-12" style="overflow-x:auto">
<pre id="response_headers12"></pre>
<pre id="response12"></pre>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>返回参数</strong></div>
<div class="panel-body">
</div>
</div>
</div>
</div>
</div><!-- #sandbox -->
<div class="tab-pane" id="sample12">
<div class="row">
<div class="col-md-12">
<pre id="sample_response12">{
"code": 1,
"msg": "成功",
"time": "1571492001",
"data": {
"id": 4,//图片id,
"thumbnail": //缩略图,
}
}</pre>
</div>
... ... @@ -1698,7 +1845,7 @@
<div class="row mt0 footer">
<div class="col-md-6" align="left">
Generated on 2019-11-19 16:14:05 </div>
Generated on 2019-11-19 16:23:27 </div>
<div class="col-md-6" align="right">
<a href="https://www.fastadmin.net" target="_blank">FastAdmin</a>
</div>
... ...