接口详情 - GicaterTeam/gicater-pad-api GitHub Wiki

#activate 请求激活设备,每台设备的设备号需要唯一。 ###请求参数

Name Required Type Description
command true string activate
device true string 设备号

JSON样例

{"device":"D2FA7C61-2","command":"activate"}

###返回结果 Name|Type|Description ---|---|---|---| command|string|activate access|int|0 成功 ;其他值,不允许访问

#update 下载菜品数据库和图片到客户端。 ###请求参数

Name Required Type Description
command true string update
revision_d true int 当前数据库的版本号
revision_i false int 当前图片文件夹的版本号。
nodata false bool 服务器是否需要返回数据,如果为true表明只是查询是否需要更新。

JSON样例 {"command":"update","revision_d":-220950490, "revision_i":150201907} ###返回结果 Name|Type|Description ---|---|---|---| command|string|update revision_d|int|服务器端数据库的版本号 revision_i | int |服务器端图片文件夹的版本号 file_num | int |要更新的文件数目

JSON样例

{"command":"update","revision_d":-220950490,"revision_i":150201907,"file_num":0}

#login 用户登录 ###请求参数

Name Required Type Description
command true string login
userid true string 用户id和密码

JSON样例

{"userid":"101","command":"login"}

###返回结果 Name|Type|Description ---|---|---|---| command| string| login result| int| 0 成功 1 失败 name|string|员工名字 auth_pay|int|可使用的支付方式权限 auth_free|int|送菜单价上限

JSON样例

{"command":"login","result":0,"name":"管理员"}

#queryorder 查询已点的菜单状态。(不支持分单,仅返回第一个账单) ###请求参数

Name Required Type Description
command true string queryorder
table_id true int 要查询的桌号
employee true string 员工ID

JSON样例

{"command":"queryorder","table_id":3}

###返回结果 Name|Type|Description ---|---|---|---| command |string | queryorder table_id | int| 桌号 tax| double| 税金 due |double | 应付金额 order_list | array | 菜品列表 id | int order_detail|表ID item_id| int| 菜品ID num| double| 菜品数量 price| double| 菜品实际价格(总价) name | string | 菜品名称 unit | string | 规格 req |string | 附加要求 cdm| int |是否配料 state| int| 状态:0-未处理,1-已送厨房,2-已配菜, 3-正在制作,4-已上菜

注:折扣&服务费和菜品一起放在order_list中

JSON样例

{"command":"queryorder","table_id":5,"order_list":[{"id":29,"item_id":4204,"state":1,"num":1,"price":32,"name":"美味猪扒饭","unit":"","req":""}]}

#voiditem 退一个或多个菜 ###请求参数

Name Required Type Description
command true string voiditem
employee true string 员工ID
reason true string 退菜原因
order_list true array
id true int 菜品数据库ID

JSON样例

{"employee":"101","command":"voiditem","order_list":[{"id":4}],"reason":"重复输入"}

###返回结果 Name|Type|Description ---|---|---|---| command| string | voiditem result| int |0 成功; 1 权限不够