Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
redgreat committed Aug 27, 2024
1 parent e13f324 commit 21ca12c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
%% Release profiles
%% To create a release just run
%% rebar3 as prod release
{relx, [{release, {eadm, "0.1.39"},
{relx, [{release, {eadm, "0.1.40"},
[eadm, nova, epgsql, poolboy, lager, sasl, inets, observer, runtime_tools]},
{mode, minimal},
{extended_start_script, true},
Expand Down
5 changes: 5 additions & 0 deletions src/apis/api_watch.erl
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ index(#{params := Params}) ->
end;
<<"6">> ->
% 心率数据
lager:info("心率原始数据:~p~n", [Params]),
try
Heartbeat = erlang:binary_to_integer(maps:get(<<"heartbeat">>, Params, null)),
BTUtcTime = eadm_utils:parse_date_time(maps:get(<<"BTUtcTime">>, Params, null)),
lager:info("心率数据:~p~n", [Heartbeat]),
eadm_pgpool:equery(pool_pg, "insert into lc_watchhb(ptime, heartbeat)
values($1, $2) on conflict (ptime)
do update set heartbeat=excluded.heartbeat;", [BTUtcTime, Heartbeat]),
Expand Down Expand Up @@ -171,10 +173,13 @@ index(#{params := Params}) ->
end;
<<"30">> ->
% 信号/电量
lager:info("信号/电量原始数据:~p~n", [Params]),
try
Signal = erlang:binary_to_integer(maps:get(<<"signal">>, Params, null)),
Battery = erlang:binary_to_integer(maps:get(<<"battery">>, Params, null)),
BTUtcTime = eadm_utils:parse_date_time(maps:get(<<"BTUtcTime">>, Params, null)),
lager:info("信号:~p~n", [Signal]),
lager:info("电量:~p~n", [Battery]),
eadm_pgpool:equery(pool_pg, "insert into lc_watchsb(ptime, signal, battery)
values($1, $2, $3) on conflict (ptime)
do update set signal=excluded.signal, battery=excluded.battery;",
Expand Down
2 changes: 1 addition & 1 deletion src/eadm.app.src
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
{application, eadm,
[{description, "RG管理平台"},
{vsn, "0.1.39"},
{vsn, "0.1.40"},
{registered, []},
{mod, {eadm_app, []}},
{included_applications, []},
Expand Down

0 comments on commit 21ca12c

Please sign in to comment.