diff --git a/application/api/controller/Index.php b/application/api/controller/Index.php index 0b695e5..0dec30b 100644 --- a/application/api/controller/Index.php +++ b/application/api/controller/Index.php @@ -28,36 +28,6 @@ class Index extends Base * * @ApiReturn({ "code": 1, - "msg": "优惠券中心", - "time": "1607909742", - "data": [{ - "id": 1, //优惠券ID - "name": "满100减10", //优惠券名称 - "type": "cash", - "goods_ids": "0", - "amount": "10.00", //减免金额 - "enough": "100.00", //使用门槛 - "stock": 0, //剩余券数量 - "limit": 1, //每人限领 - "gettime": { - "start": 1607875200, - "end": 1610640000 - }, - "usetime": { //有效期 - "start": "2020.12.18", //开始时间 - "end": "2021.01.30" //结束时间 - }, - "description": "满100减10", //优惠券描述 - "usetimestart": 1608220800, - "usetimeend": 1611936000, - "gettimestart": 1607875200, - "gettimeend": 1610640000, - "user_coupons_id": 1, //领取ID - "status_code": 1610640000, //状态码:no_use=未使用,used=已使用,expired=已过期 - "status_name": "未使用" //状态名称 - }] - }{ - "code": 1, "msg": "首页", "time": "1608036399", "data": { @@ -77,10 +47,10 @@ class Index extends Base "minute": 12, "second": 19 }, - "soon_starttime": [ //即将开始时间 + "soon_starttime": { //即将开始时间 "hour": 14, "minute": 00 - ], + }, "goodsList": [{ "id": 1, //商品ID "type": "normal", @@ -156,10 +126,10 @@ class Index extends Base "minute": 12, "second": 19 }, - "soon_starttime": [ //即将开始时间 + "soon_starttime": { //即将开始时间 "hour": 14, "minute": 00 - ], + }, "goodsList":[{ "id": 2, //商品ID "type": "normal", diff --git a/public/api.html b/public/api.html index ab57dfc..3868e6c 100755 --- a/public/api.html +++ b/public/api.html @@ -146,7 +146,7 @@ </div> <a href="#首页接口" class="list-group-item" data-toggle="collapse" data-parent="#sidebar">首页接口 <i class="fa fa-caret-down"></i></a> <div class="child collapse" id="首页接口"> - <a href="javascript:;" data-id="26" class="list-group-item">@ApiWeigh (99)</a> + <a href="javascript:;" data-id="26" class="list-group-item">首页</a> <a href="javascript:;" data-id="27" class="list-group-item">上传文件</a> <a href="javascript:;" data-id="28" class="list-group-item">上传 base64 图片</a> </div> @@ -649,7 +649,7 @@ <div class="panel-heading" id="heading-26"> <h4 class="panel-title"> <span class="label label-success">GET</span> - <a data-toggle="collapse" data-parent="#accordion26" href="#collapseOne26"> @ApiWeigh (99) <span class="text-muted">/api/index/index</span></a> + <a data-toggle="collapse" data-parent="#accordion26" href="#collapseOne26"> 首页 <span class="text-muted">/api/index/index</span></a> </h4> </div> <div id="collapseOne26" class="panel-collapse collapse"> @@ -667,11 +667,28 @@ <div class="tab-pane active" id="info26"> <div class="well"> - @ApiWeigh (99) </div> + 首页 </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"> @@ -691,9 +708,20 @@ <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" 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/index/index" method="get" name="form26" id="form26"> + <form enctype="application/x-www-form-urlencoded" role="form" action="/api/index/index" method="GET" name="form26" id="form26"> <div class="form-group"> 无 </div> @@ -728,7 +756,188 @@ <div class="tab-pane" id="sample26"> <div class="row"> <div class="col-md-12"> - <pre id="sample_response26">无</pre> + <pre id="sample_response26">{ + "code": 1, + "msg": "首页", + "time": "1608036399", + "data": { + "banner_list": [{ //轮播图 + "id": 3, //轮播图ID + "image": "http://www.ant.top/uploads/20201214/b655ea4dc4779222ab7a4e2b95feb3a4.png" //图片地址 + }], + "category_list": [{ //一级分类 + "id": 1, //分类ID + "name": "商品分类", //分类名称 + "image": "http://www.ant.top/uploads/20201221/559d2a240ec20b096590a902217009ff.png", //分类图片 + }], + "seckill_list": { + "type": "ing", // 类型:ing=进行中,nostart=即将开始,tomorrow=明日预告 + "current_endtime": { //距离本场结束 + "hour": 10, + "minute": 12, + "second": 19 + }, + "soon_starttime": { //即将开始时间 + "hour": 14, + "minute": 00 + }, + "goodsList": [{ + "id": 1, //商品ID + "type": "normal", + "title": "测试商品", //标题 + "subtitle": "测试啊", //副标题 + "weigh": 0, + "category_ids": "3", //所属分类ID + "image": "http://www.ant.top/assets/img/qrcode.png", //商品主图 + "price": "0.01", //商品价格 + "original_price": "10000.00", //原价 + "is_sku": 0, + "likes": 0, + "views": 3, + "sales": 0, //销量 + "show_sales": 0, //显示销量 + "dispatch_type": "express", + "dispatch_ids": "1", + "deletetime": null, + "activity": { + "id": 7, + "title": "秒杀测试", + "type": "seckill", + "richtext_id": 0, + "richtext_title": "", + "starttime": 1607616000, + "endtime": 1607702400, + "rules": { + "limit_buy": "1", + "order_auto_close": "", + "activity_auto_close": "" + } + }, + "activity_type": "seckill", + "sku_price": [{ + "id": 1, + "goods_sku_ids": null, + "goods_id": 1, + "weigh": 0, + "image": null, + "stock": 20, + "sales": 0, + "sn": "", + "weight": 0, + "price": "0.01", + "goods_sku_text": null, + "status": "up", + "activity_type": "seckill", + "activity_id": 7, + "item_goods_sku_price": { + "id": 4, + "activity_id": 7, + "sku_price_id": 1, + "goods_id": 1, + "stock": 20, + "sales": 0, + "price": "0.01", + "status": "up" + }, + "goods_sku_id_arr": [ + "" + ] + }], + "stock": 20, + "dispatch_type_arr": [ + "express" + ] + }] + }, + "groupon_list": { + "type": "ing", // 类型:ing=进行中,nostart=即将开始,tomorrow=明日预告 + "current_endtime": { + "hour": 10, + "minute": 12, + "second": 19 + }, + "soon_starttime": { //即将开始时间 + "hour": 14, + "minute": 00 + }, + "goodsList":[{ + "id": 2, //商品ID + "type": "normal", + "title": "测试商品2", //商品标题 + "subtitle": "测试啊啊", //商品副标题 + "weigh": 0, + "category_ids": "3", + "image": "http://www.ant.top/uploads/20201211/8894d62100f2f920ffb2f38063b63f2d.jpg", //商品主图 + "price": "0.02", //现价 + "original_price": "1000.00", //原价 + "is_sku": 0, //是否多规格:0=否,1=是 + "likes": 0, + "views": 1, + "sales": 0, + "show_sales": 0, //显示销量 + "dispatch_type": "express", + "dispatch_ids": "1", + "deletetime": null, + "activity": { + "id": 9, //活动ID + "title": "拼团测试", //活动标题 + "type": "groupon", //活动类型:seckill=秒杀,groupon=拼团 + "richtext_id": 0, + "richtext_title": "", + "starttime": 1607616000, + "endtime": 1607702400, + "rules": { //活动规则 + "limit_buy": "1", //每人限购件数 + "order_auto_close": "", + "activity_auto_close": "", + "team_num": "2", //成团人数 + "is_alone": "0", //是否允许单独购买 + "is_fictitious": "0", + "fictitious_num": "", + "valid_time": "", + "team_card": "0" + } + }, + "activity_type": "groupon", + "groupon_price": "0.01", + "sku_price": [{ + "id": 2, + "goods_sku_ids": null, + "goods_id": 2, + "weigh": 0, + "image": null, + "stock": 10, + "sales": 0, + "sn": "", + "weight": 0, + "price": "0.02", + "goods_sku_text": null, + "status": "up", + "groupon_price": "0.01", + "activity_type": "groupon", + "activity_id": 9, + "item_goods_sku_price": { + "id": 5, + "activity_id": 9, + "sku_price_id": 2, + "goods_id": 2, + "stock": 10, + "sales": 0, + "price": "0.01", + "status": "up" + }, + "goods_sku_id_arr": [ + "" + ] + }], + "stock": 10, + "dispatch_type_arr": [ + "express" + ] + }] + } + } + }</pre> </div> </div> </div><!-- #sample --> @@ -10088,7 +10297,7 @@ <div class="row mt0 footer"> <div class="col-md-6" align="left"> - Generated on 2020-12-21 16:56:10 </div> + Generated on 2020-12-21 17:04:13 </div> <div class="col-md-6" align="right"> <a href="./" target="_blank">My Website</a> </div>