正在显示
2 个修改的文件
包含
91 行增加
和
0 行删除
application/api/controller/Data.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | + | ||
4 | +namespace app\api\controller; | ||
5 | + | ||
6 | +use think\Db; | ||
7 | +use app\common\controller\Api; | ||
8 | + | ||
9 | +/** | ||
10 | + * 数据存储 | ||
11 | + */ | ||
12 | +class Data extends Api | ||
13 | +{ | ||
14 | + protected $noNeedLogin = ['*']; | ||
15 | + protected $noNeedRight = ['*']; | ||
16 | + | ||
17 | + /** | ||
18 | + * @ApiTitle (产品移动轨迹记录) | ||
19 | + * @ApiSummary (产品移动轨迹记录) | ||
20 | + * @ApiMethod (POST) | ||
21 | + * @ApiRoute (/api/Data/BatteryWhere) | ||
22 | + * @ApiParams (name="cp_xulehao", type="string", required=true, description="产品序列号") | ||
23 | + * @ApiParams (name="lng", type="string", required=true, description="经度") | ||
24 | + * @ApiParams (name="lat", type="string", required=true, description="纬度") | ||
25 | + * @ApiReturnParams (name="code", type="integer", required=true, sample="0") | ||
26 | + * @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功") | ||
27 | + * @ApiReturn ({ | ||
28 | + 'code':'1', | ||
29 | + 'msg':'返回成功', | ||
30 | + 'data':{ | ||
31 | + }) | ||
32 | + */ | ||
33 | + public function BatteryWhere() | ||
34 | + { | ||
35 | + $Params = $this->request->param(); | ||
36 | + Db::name('gis')->insert(['cp_xulehao' => $Params['cp_xulehao'], 'lng' => $Params['lng'], 'lat' => $Params['lat'], 'createtime' => time()]); | ||
37 | + $this->success('成功', 1); | ||
38 | + } | ||
39 | + | ||
40 | + | ||
41 | + /** | ||
42 | + * @ApiTitle (动态数据记录) | ||
43 | + * @ApiSummary (动态数据记录) | ||
44 | + * @ApiMethod (POST) | ||
45 | + * @ApiRoute (/api/Data/DynamicData) | ||
46 | + * @ApiParams (name="cp_xulehao", type="string", required=true, description="产品序列号") | ||
47 | + * @ApiParams (name="yydt_jb", type="string", required=true, description="警报信息") | ||
48 | + * @ApiParams (name="yydt_dqdl", type="string", required=true, description="当前电量") | ||
49 | + * @ApiParams (name="yydt_gfbhcs", type="string", required=true, description="过放保护次数") | ||
50 | + * @ApiParams (name="yydt_gfbcsj", type="string", required=true, description="过放保护时间") | ||
51 | + * @ApiParams (name="yydt_ljxhcs", type="string", required=true, description="累计循环次数") | ||
52 | + * @ApiParams (name="yydt_dqrl", type="string", required=true, description="当前容量") | ||
53 | + * @ApiParams (name="yydt_zfdl", type="string", required=true, description="总放电量") | ||
54 | + * @ApiParams (name="yydt_zcdl", type="string", required=true, description="总充电量") | ||
55 | + * @ApiParams (name="yydt_pjdy", type="string", required=true, description="平均电压") | ||
56 | + * @ApiParams (name="yydt_zgdtdy", type="string", required=true, description="最高单体电压") | ||
57 | + * @ApiParams (name="yydt_zddtdy", type="string", required=true, description="最低单体电压") | ||
58 | + * @ApiParams (name="yydt_dqzgwd", type="string", required=true, description="当前最高温度") | ||
59 | + * @ApiParams (name="yydt_dqzdwd", type="string", required=true, description="当前最低温度") | ||
60 | + * @ApiReturnParams (name="code", type="integer", required=true, sample="0") | ||
61 | + * @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功") | ||
62 | + * @ApiReturn ({ | ||
63 | + 'code':'1', | ||
64 | + 'msg':'返回成功', | ||
65 | + 'data':{ | ||
66 | + }) | ||
67 | + */ | ||
68 | + public function DynamicData() | ||
69 | + { | ||
70 | + $Params = $this->request->param(); | ||
71 | + $data = [ | ||
72 | + 'cp_xulehao' => $Params['cp_xulehao'], | ||
73 | + 'yydt_jb' => $Params['yydt_jb'], | ||
74 | + 'yydt_dqdl' => $Params['yydt_dqdl'], | ||
75 | + 'yydt_gfbhcs' => $Params['yydt_gfbhcs'], | ||
76 | + 'yydt_gfbcsj' => $Params['yydt_gfbcsj'], | ||
77 | + 'yydt_ljxhcs' => $Params['yydt_ljxhcs'], | ||
78 | + 'yydt_dqrl' => $Params['yydt_dqrl'], | ||
79 | + 'yydt_zfdl' => $Params['yydt_zfdl'], | ||
80 | + 'yydt_zcdl' => $Params['yydt_zcdl'], | ||
81 | + 'yydt_pjdy' => $Params['yydt_pjdy'], | ||
82 | + 'yydt_zgdtdy' => $Params['yydt_zgdtdy'], | ||
83 | + 'yydt_zddtdy' => $Params['yydt_zddtdy'], | ||
84 | + 'yydt_dqzgwd' => $Params['yydt_dqzgwd'], | ||
85 | + 'yydt_dqzdwd' => $Params['yydt_dqzdwd'], | ||
86 | + 'createtime' => time() | ||
87 | + ]; | ||
88 | + Db::name('yydtsjb')->insert($data); | ||
89 | + $this->success('成功', 1); | ||
90 | + } | ||
91 | +} |
此 diff 太大无法显示。
-
请 注册 或 登录 后发表评论