明树Git Lab
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
L
letian_backend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zengfanpei
letian_backend
Commits
197ccad1
Commit
197ccad1
authored
Sep 04, 2024
by
zengfanpei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
27254597
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
167 additions
and
81 deletions
+167
-81
.gitignore
.gitignore
+1
-0
collectIPS.js
db/models/collectIPS.js
+3
-2
ecosystem.config.js
ecosystem.config.js
+18
-0
collectIPSModule.js
module/collectIPSModule.js
+137
-74
httpRequest.js
utils/httpRequest.js
+8
-5
No files found.
.gitignore
View file @
197ccad1
...
...
@@ -3,4 +3,5 @@ node_modules/
package-lock.json
.vscode
test/
test.js
public/avatar
\ No newline at end of file
db/models/collectIPS.js
View file @
197ccad1
...
...
@@ -89,9 +89,10 @@ const collectInsectPestSituationSchema = new Schema({
comment
:
"上一次标注后的图片(压缩后)"
,
},
/*
图片识别结果
*/
/*
识别结果 不管哪一种形式,只要结果确认有效则写入,为空则表示此条数据无效,后续需要根据业务定期处理这类数据
*/
cameraRecognition
:
{
type
:
String
type
:
String
,
default
:
null
,
},
createdAt
:
{
...
...
ecosystem.config.js
0 → 100644
View file @
197ccad1
let
curDate
=
new
Date
();
let
curDateStr
=
curDate
.
getFullYear
()
+
""
+
String
(
curDate
.
getMonth
()
+
1
).
padStart
(
2
,
'0'
)
+
""
+
curDate
.
getDate
();
module
.
exports
=
{
apps
:
[{
name
:
"letian"
,
script
:
'server.js'
,
watch
:
true
,
ignore_watch
:
[
'node_modules'
,
'logs'
],
env_dev
:
{
NODE_ENV
:
"dev"
},
log_date_format
:
"YYYY-MM-DD HH:mm:ss"
,
out_file
:
`logs/
${
curDateStr
}
.log`
,
error_file
:
`logs/
${
curDateStr
}
.log`
,
}]
};
module/collectIPSModule.js
View file @
197ccad1
This diff is collapsed.
Click to expand it.
utils/httpRequest.js
View file @
197ccad1
const
axios
=
require
(
'axios'
);
const
requestLogModule
=
require
(
"../module/requestLogModule"
);
async
function
httpRequest
({
url
,
method
,
data
,
params
,
headers
,
responseType
})
{
console
.
log
(
`
${
url
}
,
${
JSON
.
stringify
(
data
)}
,
${
JSON
.
stringify
(
params
)}
`
)
async
function
httpRequest
({
url
,
method
,
data
,
params
,
headers
=
{},
responseType
})
{
try
{
let
opt
=
{
url
,
...
...
@@ -18,11 +17,13 @@ async function httpRequest ({url, method, data, params, headers, responseType})
requestLogModule
.
createRequestLog
({
url
,
method
,
params
:
JSON
.
stringify
(
params
)
+
JSON
.
stringify
(
data
),
params
:
JSON
.
stringify
(
params
)
+
JSON
.
stringify
(
(
headers
[
"Content-Type"
]
==
"mutipart/form-data"
?
""
:
data
)
),
headers
:
JSON
.
stringify
(
headers
),
type
:
"device"
,
status
:
ret
&&
ret
.
status
,
result
:
JSON
.
stringify
(
ret
.
data
)
result
:
responseType
==
'stream'
?
""
:
JSON
.
stringify
(
ret
.
data
)
}).
catch
(
error
=>
{
console
.
log
(
error
);
});
if
(
ret
&&
ret
.
status
==
200
)
{
...
...
@@ -36,10 +37,12 @@ async function httpRequest ({url, method, data, params, headers, responseType})
requestLogModule
.
createRequestLog
({
url
,
method
,
params
:
JSON
.
stringify
(
params
)
+
JSON
.
stringify
(
data
),
params
:
JSON
.
stringify
(
params
)
+
JSON
.
stringify
(
(
headers
[
"Content-Type"
]
==
"mutipart/form-data"
?
""
:
data
)
),
headers
:
JSON
.
stringify
(
headers
),
type
:
"device"
,
msg
:
error
.
message
,
}).
catch
(
error
=>
{
console
.
log
(
error
);
});
return
{
data
:
null
,
status
:
false
};
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment