修复问题
parent
6e94380244
commit
d32457f28b
|
@ -1,5 +1,7 @@
|
|||
#include "test.h"
|
||||
#include "application.h"
|
||||
#include "common/date_util.h"
|
||||
#include "common/snowflake.h"
|
||||
|
||||
namespace zsy
|
||||
{
|
||||
|
@ -58,8 +60,7 @@ namespace zsy
|
|||
{
|
||||
LOGGER_ERROR("错误", e.what());
|
||||
j["结果"] = "错误";
|
||||
}
|
||||
catch (...)
|
||||
} catch (...)
|
||||
{
|
||||
LOGGER_ERROR("错误");
|
||||
j["结果"] = "错误";
|
||||
|
@ -79,8 +80,7 @@ namespace zsy
|
|||
{
|
||||
LOGGER_ERROR("错误", e.what());
|
||||
j["结果"] = "错误";
|
||||
}
|
||||
catch (...)
|
||||
} catch (...)
|
||||
{
|
||||
LOGGER_ERROR("错误");
|
||||
j["结果"] = "错误";
|
||||
|
@ -100,8 +100,7 @@ namespace zsy
|
|||
{
|
||||
LOGGER_ERROR("错误", e.what());
|
||||
j["结果"] = "错误";
|
||||
}
|
||||
catch (...)
|
||||
} catch (...)
|
||||
{
|
||||
LOGGER_ERROR("错误");
|
||||
j["结果"] = "错误";
|
||||
|
@ -116,13 +115,16 @@ namespace zsy
|
|||
{
|
||||
auto sn = req.get_param_value("sn");
|
||||
auto photograph = Application::deviceHolder->getVidicon(sn)->photograph();
|
||||
j["结果"] = "";
|
||||
std::string date = DateUtil::format(Ymd);
|
||||
auto photoId = Snowflake::genIdStr();
|
||||
auto [carFrontUrlSucc,carFrontUrl] = Application::oss->upload(date + "/" + "front_" + photoId + ".jpg", photograph);
|
||||
j["结果"] = carFrontUrlSucc;
|
||||
j["地址"] = carFrontUrl;
|
||||
} catch (std::exception &e)
|
||||
{
|
||||
LOGGER_ERROR("错误", e.what());
|
||||
j["结果"] = "错误";
|
||||
}
|
||||
catch (...)
|
||||
} catch (...)
|
||||
{
|
||||
LOGGER_ERROR("错误");
|
||||
j["结果"] = "错误";
|
||||
|
|
Loading…
Reference in New Issue