Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
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
haoban3.0
haoban-manage3.0
Commits
cf2ec92c
Commit
cf2ec92c
authored
Oct 27, 2023
by
王祖波
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-content4-2' into developer
parents
d441220f
c22b5381
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
4 deletions
+41
-4
pom.xml
haoban-manage3-wx/pom.xml
+25
-0
ContentThirdController.java
...manage/web/controller/content/ContentThirdController.java
+15
-4
spring-servlet.xml
haoban-manage3-wx/src/main/webapp/WEB-INF/spring-servlet.xml
+1
-0
No files found.
haoban-manage3-wx/pom.xml
View file @
cf2ec92c
...
...
@@ -37,6 +37,31 @@
</dependencyManagement>
<dependencies>
<dependency>
<groupId>
com.azure
</groupId>
<artifactId>
azure-ai-openai
</artifactId>
<version>
1.0.0-beta.5
</version>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.core
</groupId>
<artifactId>
jackson-core
</artifactId>
<version>
2.10.0
</version>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.core
</groupId>
<artifactId>
jackson-annotations
</artifactId>
<version>
2.10.0
</version>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.core
</groupId>
<artifactId>
jackson-databind
</artifactId>
<version>
2.10.0
</version>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
open-ai-sdk
</artifactId>
<version>
3.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.11
</version>
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/ContentThirdController.java
View file @
cf2ec92c
...
...
@@ -7,13 +7,12 @@ import com.gic.content.api.dto.aigc.AIGCContent;
import
com.gic.content.api.qdto.aigc.ContentAIGCQDTO
;
import
com.gic.content.api.service.common.ThirdApiService
;
import
com.gic.haoban.manage.web.qo.content.ContentAIGCQO
;
import
com.open.ai.OpenAIUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.servlet.mvc.method.annotation.SseEmitter
;
/**
* 好办-三方接口
...
...
@@ -43,4 +42,16 @@ public class ContentThirdController {
}
return
RestResponse
.
successResult
(
response
.
getResult
());
}
/**
* openAI会话
* @param question
* @return
*/
@RequestMapping
(
value
=
"/ai/chat"
,
method
=
RequestMethod
.
GET
,
produces
=
"text/event-stream;charset=UTF-8"
)
public
SseEmitter
openAiChat
(
String
question
,
String
userId
,
String
enterpriseId
)
{
SseEmitter
emitter
=
new
SseEmitter
(
30000L
);
OpenAIUtil
.
chat
(
emitter
,
question
,
userId
,
enterpriseId
);
return
emitter
;
}
}
haoban-manage3-wx/src/main/webapp/WEB-INF/spring-servlet.xml
View file @
cf2ec92c
...
...
@@ -55,6 +55,7 @@
<list>
<value>
text/html;charset=UTF-8
</value>
<value>
application/x-www-form-urlencoded;charset=UTF-8
</value>
<value>
text/plain;charset=UTF-8
</value>
<!--默认是 iso-8859-1 -->
</list>
</property>
...
...
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