Total Complexity | 1 |
Complexity/F | 1 |
Lines of Code | 50 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | const Response = require('../../util/response') |
||
2 | const ServiceStore = require('../../services/catering/store') |
||
3 | |||
4 | module.exports = { |
||
5 | /** |
||
6 | * @api {get} /api/catering/v1/stores/:storeId 获取店铺信息 |
||
7 | * @apiVersion 1.0.0 |
||
8 | * @apiGroup store |
||
9 | * @apiPermission store |
||
10 | * |
||
11 | * @apiDescription API to edit the customer information. |
||
12 | * |
||
13 | * @apiExample Example usage: |
||
14 | curl --request PUT \ |
||
15 | --url https://garylv.com/api/catering/v1/stores/1 \ |
||
16 | --header 'mina-source: catering' \ |
||
17 | --header 'store-id: 1' |
||
18 | * |
||
19 | * |
||
20 | * @apiSuccess {String} data response data |
||
21 | * |
||
22 | * @apiSuccessExample {json} Visual Preview: |
||
23 | { |
||
24 | "success": true, |
||
25 | "code": 200, |
||
26 | "data": { |
||
27 | "id": 1, |
||
28 | "seller_id": 1, |
||
29 | "name": "新视觉烧烤", |
||
30 | "thumb": "https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83eo13vc2RhqKyJI8f5qaGCcj2ZeRfic696O0a2PDZvJ2JrGL8ia8EJHA6KjR37ia2neD11IBcNJ4HianZg/132", |
||
31 | "store_type_id": 0, |
||
32 | "theme": "", |
||
33 | "tel": "234", |
||
34 | "wechat": "", |
||
35 | "address": "12", |
||
36 | "status": 1, |
||
37 | "created_at": "2018-07-03T06:59:01.000Z", |
||
38 | "updated_at": null |
||
39 | }, |
||
40 | "message": "请求成功" |
||
41 | } |
||
42 | * @apiSampleRequest https://garylv.com/api/catering/v1/stores/:storeId |
||
43 | */ |
||
44 | detail: async function (ctx) { |
||
45 | |||
46 | let data = await ServiceStore.getStore(ctx.params.storeId) |
||
47 | return Response.output(ctx, data) |
||
48 | }, |
||
49 | |||
50 | } |