Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ai-api
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
ai-api
Commits
2e8893bd
Commit
2e8893bd
authored
Nov 21, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改部分接口返回参数
parent
08b0e4c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
src/main/java/com/lilosoft/api/controller/ReceiveMsgController.java
...ava/com/lilosoft/api/controller/ReceiveMsgController.java
+61
-0
No files found.
src/main/java/com/lilosoft/api/controller/ReceiveMsgController.java
0 → 100644
View file @
2e8893bd
package
com.lilosoft.api.controller
;
import
cn.hutool.core.util.IdUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.lilosoft.api.api.RobotApi
;
import
com.lilosoft.api.bean.RobotCaseRecord
;
import
com.lilosoft.api.bean.receive.ReceiveMsgInfo
;
import
com.lilosoft.api.service.ComplexService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Date
;
import
java.util.HashMap
;
@RestController
@Slf4j
@RequestMapping
(
"complex"
)
public
class
ReceiveMsgController
{
@Autowired
private
ComplexService
complexService
;
@Autowired
private
RobotApi
robotApi
;
@PostMapping
(
"receiveMessage"
)
public
String
refreshMessage
(
@RequestBody
HashMap
<
String
,
String
>
text
)
{
JSONObject
jsonObject
=
new
JSONObject
();
RobotCaseRecord
caseRecord
=
new
RobotCaseRecord
();
caseRecord
.
setId
(
IdUtil
.
simpleUUID
());
caseRecord
.
setContent
(
text
.
get
(
"content"
));
caseRecord
.
setSendFlag
(
"0"
);
caseRecord
.
setUpdateTime
(
new
Date
());
try
{
robotApi
.
saveRecord
(
caseRecord
);
String
content
=
text
.
get
(
"content"
);
ReceiveMsgInfo
receiveMsgInfo
=
JSON
.
parseObject
(
content
,
ReceiveMsgInfo
.
class
);
complexService
.
windowApply
(
receiveMsgInfo
);
robotApi
.
saveRecord
(
caseRecord
);
jsonObject
.
put
(
"code"
,
1
);
jsonObject
.
put
(
"msg"
,
"成功"
);
}
catch
(
Exception
e
)
{
caseRecord
.
setSendFlag
(
"1"
);
caseRecord
.
setMsg
(
e
.
getMessage
());
robotApi
.
saveRecord
(
caseRecord
);
log
.
error
(
e
.
getMessage
());
jsonObject
.
put
(
"code"
,
-
1
);
jsonObject
.
put
(
"msg"
,
e
.
getMessage
());
}
return
jsonObject
.
toJSONString
();
}
}
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