Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elleai
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
ai-tech
E
ellehuis-group
backend
elleai
Commits
b63df60b
Commit
b63df60b
authored
Oct 14, 2024
by
陈立彬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口&文档
parent
074189bd
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
251 additions
and
57 deletions
+251
-57
pom.xml
pom.xml
+27
-5
ElleaiApplication.java
src/main/java/cn/breeze/elleai/ElleaiApplication.java
+2
-0
Knife4jConfiguration.java
src/main/java/cn/breeze/elleai/Knife4jConfiguration.java
+38
-0
Swagger2Config.java
src/main/java/cn/breeze/elleai/Swagger2Config.java
+2
-4
PageResult.java
...ain/java/cn/breeze/elleai/application/dto/PageResult.java
+4
-0
ExamineRecordRequestDto.java
...leai/application/dto/request/ExamineRecordRequestDto.java
+3
-0
ExamineRequestDto.java
...eze/elleai/application/dto/request/ExamineRequestDto.java
+3
-2
ExamineSceneCategoryRequestDto.java
...plication/dto/request/ExamineSceneCategoryRequestDto.java
+3
-2
ExamineSceneRequestDto.java
...lleai/application/dto/request/ExamineSceneRequestDto.java
+8
-2
QaAssistantRequestDto.java
...elleai/application/dto/request/QaAssistantRequestDto.java
+7
-1
UserQaHistoryRequestDto.java
...leai/application/dto/request/UserQaHistoryRequestDto.java
+13
-2
ExamineDetailRecordMobileDto.java
...pplication/dto/response/ExamineDetailRecordMobileDto.java
+17
-0
ExamineMobileDto.java
...eze/elleai/application/dto/response/ExamineMobileDto.java
+20
-0
ExamineQaDifyDto.java
...eze/elleai/application/dto/response/ExamineQaDifyDto.java
+9
-0
ExamineRecordMobileDto.java
...leai/application/dto/response/ExamineRecordMobileDto.java
+27
-0
ExamineSceneCategoryDto.java
...eai/application/dto/response/ExamineSceneCategoryDto.java
+13
-7
ExamineSceneDto.java
...eeze/elleai/application/dto/response/ExamineSceneDto.java
+8
-5
HotQaMobileDto.java
...reeze/elleai/application/dto/response/HotQaMobileDto.java
+15
-0
QaAssistantDto.java
...reeze/elleai/application/dto/response/QaAssistantDto.java
+10
-5
AppExamineService.java
.../breeze/elleai/application/service/AppExamineService.java
+4
-7
ChatCompletionMobileController.java
...eze/elleai/controller/ChatCompletionMobileController.java
+4
-3
ExamineMobileController.java
.../cn/breeze/elleai/controller/ExamineMobileController.java
+14
-12
No files found.
pom.xml
View file @
b63df60b
...
...
@@ -70,11 +70,11 @@
<artifactId>
hutool-all
</artifactId>
<version>
5.8.20
</version>
</dependency>
<dependency
>
<groupId>
org.springdoc
</groupId
>
<artifactId>
springdoc-openapi-starter-webmvc-ui
</artifactId
>
<version>
2.6.0
</version
>
</dependency
>
<!-- <dependency>--
>
<!-- <groupId>org.springdoc</groupId>--
>
<!-- <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>--
>
<!-- <version>2.6.0</version>--
>
<!-- </dependency>--
>
<dependency>
<groupId>
javax.servlet
</groupId>
<artifactId>
javax.servlet-api
</artifactId>
...
...
@@ -92,6 +92,28 @@
<artifactId>
spring-boot-starter-data-redis
</artifactId>
</dependency>
<!-- 接口API文档 -->
<dependency>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
knife4j-gateway-spring-boot-starter
</artifactId>
<version>
4.1.0
</version>
</dependency>
<dependency>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
knife4j-openapi3-jakarta-spring-boot-starter
</artifactId>
<version>
4.1.0
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
<version>
3.0.0
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger-ui
</artifactId>
<version>
3.0.0
</version>
</dependency>
</dependencies>
<build>
...
...
src/main/java/cn/breeze/elleai/ElleaiApplication.java
View file @
b63df60b
package
cn
.
breeze
.
elleai
;
import
com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
@EnableKnife4j
public
class
ElleaiApplication
{
public
static
void
main
(
String
[]
args
)
{
...
...
src/main/java/cn/breeze/elleai/Knife4jConfiguration.java
0 → 100644
View file @
b63df60b
package
cn
.
breeze
.
elleai
;
import
com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
springfox.documentation.builders.ApiInfoBuilder
;
import
springfox.documentation.builders.PathSelectors
;
import
springfox.documentation.builders.RequestHandlerSelectors
;
import
springfox.documentation.service.ApiInfo
;
import
springfox.documentation.service.Contact
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
@Configuration
@EnableSwagger2
@EnableKnife4j
public
class
Knife4jConfiguration
{
@Bean
public
Docket
createRestApi
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
useDefaultResponseMessages
(
false
)
.
apiInfo
(
apiInfo
())
.
select
().
apis
(
RequestHandlerSelectors
.
basePackage
(
"cn.breeze.elleai.controller"
))
.
paths
(
PathSelectors
.
any
())
.
build
();
}
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
.
description
(
"Kinfe4j 集成测试文档"
)
.
version
(
"v1.1.0"
)
.
title
(
"API测试文档"
)
.
build
();
}
}
src/main/java/cn/breeze/elleai/Swagger2Config.java
View file @
b63df60b
...
...
@@ -19,10 +19,8 @@ public class Swagger2Config {
addList
(
"Bearer Authentication"
))
.
components
(
new
Components
().
addSecuritySchemes
(
"Bearer Authentication"
,
createAPIKeyScheme
()))
.
info
(
new
Info
().
title
(
"Scaffold API"
)
.
description
(
"description of Scaffold API."
)
.
version
(
"1.0"
).
contact
(
new
Contact
().
name
(
"yunzhiliu"
)
.
email
(
"1360194505@qq.com"
).
url
(
"salloszraj@gmail.com"
))
.
info
(
new
Info
().
title
(
"伊丽汇 API"
)
.
version
(
"1.0"
).
contact
(
new
Contact
().
name
(
"chain"
))
.
license
(
new
License
().
name
(
"License of API"
)
.
url
(
"API license URL"
)));
}
...
...
src/main/java/cn/breeze/elleai/application/dto/PageResult.java
View file @
b63df60b
package
cn
.
breeze
.
elleai
.
application
.
dto
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
...
...
@@ -16,12 +17,15 @@ public class PageResult<T> implements Serializable {
private
Integer
total
;
@Schema
(
description
=
"总页数"
)
@JsonProperty
(
"total_page"
)
private
Integer
totalPage
;
@Schema
(
description
=
"页码"
)
@JsonProperty
(
"page_no"
)
private
Integer
pageNo
;
@Schema
(
description
=
"分页大小"
)
@JsonProperty
(
"page_size"
)
private
Integer
pageSize
;
/**
...
...
src/main/java/cn/breeze/elleai/application/dto/request/ExamineRecordRequestDto.java
View file @
b63df60b
...
...
@@ -9,12 +9,15 @@ import java.io.Serializable;
@Data
public
class
ExamineRecordRequestDto
implements
Serializable
{
@Schema
(
description
=
"页码"
)
@JsonProperty
(
"page_no"
)
private
Integer
pageNo
;
@Schema
(
description
=
"分页数量"
)
@JsonProperty
(
"page_size"
)
private
Integer
pageSize
;
@Schema
(
description
=
"用户ID"
)
@JsonProperty
(
"user_id"
)
private
String
userId
;
...
...
src/main/java/cn/breeze/elleai/application/dto/request/ExamineRequestDto.java
View file @
b63df60b
...
...
@@ -9,16 +9,17 @@ import java.io.Serializable;
@Data
public
class
ExamineRequestDto
implements
Serializable
{
@Schema
(
description
=
"页码"
)
@JsonProperty
(
"page_no"
)
private
Integer
pageNo
;
@Schema
(
description
=
"分页数量"
)
@JsonProperty
(
"page_size"
)
private
Integer
pageSize
;
@Schema
(
description
=
"对练名称"
)
private
String
name
;
private
Integer
status
;
@Schema
(
description
=
"场景分类ID"
)
@JsonProperty
(
"category_id"
)
private
Integer
categoryId
;
...
...
src/main/java/cn/breeze/elleai/application/dto/request/ExamineSceneCategoryRequestDto.java
View file @
b63df60b
...
...
@@ -10,16 +10,17 @@ import java.io.Serializable;
public
class
ExamineSceneCategoryRequestDto
implements
Serializable
{
@Schema
(
description
=
"页码"
)
@JsonProperty
(
"page_no"
)
private
Integer
pageNo
;
@Schema
(
description
=
"分页数量"
)
@JsonProperty
(
"page_size"
)
private
Integer
pageSize
;
@Schema
(
description
=
"场景分类名称"
)
private
String
name
;
private
Integer
status
;
@Schema
(
description
=
"场景ID"
)
@JsonProperty
(
"scene_id"
)
private
Integer
sceneId
;
...
...
src/main/java/cn/breeze/elleai/application/dto/request/ExamineSceneRequestDto.java
View file @
b63df60b
package
cn
.
breeze
.
elleai
.
application
.
dto
.
request
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -7,11 +10,14 @@ import java.io.Serializable;
@Data
public
class
ExamineSceneRequestDto
implements
Serializable
{
@Schema
(
description
=
"页码"
)
@JsonProperty
(
"page_no"
)
private
Integer
pageNo
;
@Schema
(
description
=
"分页数量"
)
@JsonProperty
(
"page_size"
)
private
Integer
pageSize
;
@Schema
(
description
=
"场景名称"
)
private
String
name
;
private
Integer
status
;
}
src/main/java/cn/breeze/elleai/application/dto/request/QaAssistantRequestDto.java
View file @
b63df60b
package
cn
.
breeze
.
elleai
.
application
.
dto
.
request
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -7,11 +9,15 @@ import java.io.Serializable;
@Data
public
class
QaAssistantRequestDto
implements
Serializable
{
@Schema
(
description
=
"页码"
)
@JsonProperty
(
"page_no"
)
private
Integer
pageNo
;
@Schema
(
description
=
"分页数量"
)
@JsonProperty
(
"page_size"
)
private
Integer
pageSize
;
@Schema
(
description
=
"助手名称"
)
private
String
name
;
}
src/main/java/cn/breeze/elleai/application/dto/request/UserQaHistoryRequestDto.java
View file @
b63df60b
package
cn
.
breeze
.
elleai
.
application
.
dto
.
request
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -7,17 +9,26 @@ import java.io.Serializable;
@Data
public
class
UserQaHistoryRequestDto
implements
Serializable
{
@Schema
(
description
=
"页码"
)
@JsonProperty
(
"page_no"
)
private
Integer
pageNo
;
@Schema
(
description
=
"分页数量"
)
@JsonProperty
(
"page_size"
)
private
Integer
pageSize
;
@Schema
(
description
=
"用户ID"
)
@JsonProperty
(
"user_id"
)
private
String
userId
;
private
Integer
type
;
@Schema
(
description
=
"会话ID"
)
@JsonProperty
(
"session_id"
)
private
String
sessionId
;
@Schema
(
description
=
"内容"
)
private
String
content
;
@Schema
(
description
=
"会话记录ID"
)
@JsonProperty
(
"chat_completion_id"
)
private
Integer
chatCompletionId
;
}
src/main/java/cn/breeze/elleai/application/dto/response/ExamineDetailRecordMobileDto.java
View file @
b63df60b
package
cn
.
breeze
.
elleai
.
application
.
dto
.
response
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -8,50 +10,65 @@ import java.time.LocalDateTime;
@Data
public
class
ExamineDetailRecordMobileDto
implements
Serializable
{
@Schema
(
description
=
"对练记录明细ID"
)
private
Integer
id
;
/**
* 对练记录ID
*/
@Schema
(
description
=
"对练记录ID"
)
@JsonProperty
(
"record_id"
)
private
Integer
recordId
;
/**
* 题目ID
*/
@Schema
(
description
=
"题目ID"
)
@JsonProperty
(
"qa_id"
)
private
Integer
qaId
;
/**
* 题目
*/
@Schema
(
description
=
"题目"
)
private
String
question
;
/**
* 标准答案
*/
@Schema
(
description
=
"标准答案"
)
private
String
answer
;
/**
* 员工答案
*/
@Schema
(
description
=
"用户答案"
)
@JsonProperty
(
"user_answer"
)
private
String
userAnswer
;
/**
* 评分
*/
@Schema
(
description
=
"评分"
)
private
Float
score
;
/**
* 评价
*/
@Schema
(
description
=
"评价"
)
private
String
evaluation
;
/**
* 创建时间
*/
@Schema
(
description
=
"创建时间"
)
@JsonProperty
(
"create_time"
)
private
LocalDateTime
createTime
;
/**
* 更新时间
*/
@Schema
(
description
=
"更新时间"
)
@JsonProperty
(
"update_time"
)
private
LocalDateTime
updateTime
;
}
src/main/java/cn/breeze/elleai/application/dto/response/ExamineMobileDto.java
View file @
b63df60b
package
cn
.
breeze
.
elleai
.
application
.
dto
.
response
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -8,57 +9,73 @@ import java.io.Serializable;
@Data
public
class
ExamineMobileDto
implements
Serializable
{
@Schema
(
description
=
"对练ID"
)
private
Integer
id
;
/**
* 对练名称
*/
@Schema
(
description
=
"对练名称"
)
private
String
name
;
/**
* 对练描述
*/
@Schema
(
description
=
"对练描述"
)
private
String
description
;
/**
* 海报图
*/
@Schema
(
description
=
"海报图"
)
private
String
poster
;
/**
* 对练场景ID
*/
@Schema
(
description
=
"对练场景ID"
)
@JsonProperty
(
"scene_id"
)
private
Integer
sceneId
;
/**
* 对练分类ID
*/
@Schema
(
description
=
"对练分类ID"
)
@JsonProperty
(
"category_id"
)
private
Integer
categoryId
;
/**
* 开始时间
*/
@Schema
(
description
=
"对练开始时间"
)
@JsonProperty
(
"start_time"
)
private
Long
startTime
;
/**
* 结束时间
*/
@Schema
(
description
=
"对练结束时间"
)
@JsonProperty
(
"end_time"
)
private
Long
endTime
;
/**
* 题目数量
*/
@Schema
(
description
=
"题目数量"
)
@JsonProperty
(
"qa_num"
)
private
Integer
qaNum
;
/**
* 已考试次数
*/
@Schema
(
description
=
"已考试次数"
)
@JsonProperty
(
"exam_total_count"
)
private
long
examTotalCount
;
/**
* 是否参与考试
*/
@Schema
(
description
=
"是否参加考试"
)
@JsonProperty
(
"exam_flag"
)
private
boolean
examFlag
;
...
...
@@ -66,18 +83,21 @@ public class ExamineMobileDto implements Serializable {
/**
* 练习次数
*/
@Schema
(
description
=
"练习次数"
)
@JsonProperty
(
"practice_count"
)
private
long
practiceCount
;
/**
* 对练次数
*/
@Schema
(
description
=
"对练次数"
)
@JsonProperty
(
"exam_count"
)
private
long
examCount
;
/**
* 最高综合评分
*/
@Schema
(
description
=
"最高综合评分"
)
@JsonProperty
(
"max_overall_score"
)
private
double
maxOverallScore
;
}
src/main/java/cn/breeze/elleai/application/dto/response/ExamineQaDifyDto.java
View file @
b63df60b
package
cn
.
breeze
.
elleai
.
application
.
dto
.
response
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -9,43 +10,51 @@ import java.time.LocalDateTime;
@Data
public
class
ExamineQaDifyDto
implements
Serializable
{
@Schema
(
description
=
"题目ID"
)
@JsonProperty
(
"question_id"
)
private
Integer
questionId
;
/**
* 问题
*/
@Schema
(
description
=
"问题"
)
private
String
question
;
/**
* 答案
*/
@Schema
(
description
=
"标准答案"
)
private
String
answer
;
/**
* 对练分类ID
*/
@Schema
(
description
=
"对练分类ID"
)
@JsonProperty
(
"category_id"
)
private
Integer
categoryId
;
/**
* 对练分类ID
*/
@Schema
(
description
=
"对练分类名称"
)
@JsonProperty
(
"category_name"
)
private
String
categoryName
;
/**
* 对练分类ID
*/
@Schema
(
description
=
"DIFY字段"
)
private
String
project
;
/**
* 对练分类ID
*/
@Schema
(
description
=
"DIFY字段"
)
private
String
code
;
/**
* dify 节点字段
*/
@Schema
(
description
=
"DIFY字段"
)
private
boolean
next
;
}
src/main/java/cn/breeze/elleai/application/dto/response/ExamineRecordMobileDto.java
View file @
b63df60b
package
cn
.
breeze
.
elleai
.
application
.
dto
.
response
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -9,59 +11,84 @@ import java.util.List;
@Data
public
class
ExamineRecordMobileDto
implements
Serializable
{
@Schema
(
description
=
"对练记录ID"
)
private
Integer
id
;
/**
* 用户ID
*/
@Schema
(
description
=
"用户ID"
)
@JsonProperty
(
"user_id"
)
private
String
userId
;
/**
* 会话ID
*/
@Schema
(
description
=
"会话ID"
)
@JsonProperty
(
"session_id"
)
private
String
sessionId
;
/**
* 对练ID
*/
@Schema
(
description
=
"对练ID"
)
@JsonProperty
(
"examine_id"
)
private
Integer
examineId
;
@Schema
(
description
=
"对练名称"
)
@JsonProperty
(
"examine_name"
)
private
String
examineName
;
@Schema
(
description
=
"对练描述"
)
@JsonProperty
(
"examine_description"
)
private
String
examineDescription
;
/**
* 对练模式(0练习 1对练)
*/
@Schema
(
description
=
"对练模式(0练习 1对练)"
)
@JsonProperty
(
"examine_mode"
)
private
Integer
examineMode
;
/**
* 已答题数量
*/
@Schema
(
description
=
"已答题数量"
)
@JsonProperty
(
"answered_num"
)
private
Integer
answeredNum
;
/**
* 综合评分
*/
@Schema
(
description
=
"用户ID"
)
@JsonProperty
(
"overall_score"
)
private
Float
overallScore
;
/**
* 综合评价
*/
@Schema
(
description
=
"综合评价"
)
@JsonProperty
(
"overall_evaluation"
)
private
String
overallEvaluation
;
/**
* 创建时间
*/
@Schema
(
description
=
"创建时间"
)
@JsonProperty
(
"create_time"
)
private
LocalDateTime
createTime
;
/**
* 更新时间
*/
@Schema
(
description
=
"更新时间"
)
@JsonProperty
(
"update_time"
)
private
LocalDateTime
updateTime
;
/**
* 答题明细
*/
@Schema
(
description
=
"答题明细列表"
)
@JsonProperty
(
"details"
)
private
List
<
ExamineDetailRecordMobileDto
>
details
;
}
src/main/java/cn/breeze/elleai/application/dto/response/ExamineSceneCategoryDto.java
View file @
b63df60b
...
...
@@ -2,6 +2,7 @@ package cn.breeze.elleai.application.dto.response;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -10,40 +11,47 @@ import java.time.LocalDateTime;
@Data
public
class
ExamineSceneCategoryDto
implements
Serializable
{
@Schema
(
description
=
"场景分类ID"
)
private
Integer
id
;
/**
* 分类名称
*/
@Schema
(
description
=
"场景分类名称"
)
private
String
name
;
/**
* 场景ID
描述
* 场景ID
*/
@Schema
(
description
=
"场景ID"
)
@JsonProperty
(
"scene_id"
)
private
Integer
sceneId
;
/**
* 场景
ID描述
* 场景
名称
*/
@Schema
(
description
=
"场景名称"
)
@JsonProperty
(
"scene_name"
)
private
String
sceneName
;
/**
* 可见角色IDS
*/
@Schema
(
description
=
"可见角色IDS,逗号分隔"
)
@JsonProperty
(
"visible_role_ids"
)
private
String
visibleRoleIds
;
/**
* 可见角色名称S
*/
@Schema
(
description
=
"可见角色名称S,逗号分隔"
)
@JsonProperty
(
"visible_role_names"
)
private
String
visibleRoleNames
;
/**
* 分类描述
*/
@Schema
(
description
=
"场景分类描述"
)
private
String
description
;
/**
...
...
@@ -51,14 +59,10 @@ public class ExamineSceneCategoryDto implements Serializable {
*/
private
Integer
status
;
/**
* 是否删除(0否 1是)
*/
private
Integer
deleted
;
/**
* 创建时间
*/
@Schema
(
description
=
"创建时间"
)
@JsonProperty
(
"create_time"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
LocalDateTime
createTime
;
...
...
@@ -66,6 +70,7 @@ public class ExamineSceneCategoryDto implements Serializable {
/**
* 更新时间
*/
@Schema
(
description
=
"更新时间"
)
@JsonProperty
(
"update_time"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
LocalDateTime
updateTime
;
...
...
@@ -73,6 +78,7 @@ public class ExamineSceneCategoryDto implements Serializable {
/**
* 父级分类ID
*/
@Schema
(
description
=
"父级ID"
)
@JsonProperty
(
"parent_id"
)
private
Integer
parentId
;
}
src/main/java/cn/breeze/elleai/application/dto/response/ExamineSceneDto.java
View file @
b63df60b
...
...
@@ -2,6 +2,7 @@ package cn.breeze.elleai.application.dto.response;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -10,36 +11,37 @@ import java.time.LocalDateTime;
@Data
public
class
ExamineSceneDto
implements
Serializable
{
@Schema
(
description
=
"场景ID"
)
private
Integer
id
;
/**
* 场景名称
*/
@Schema
(
description
=
"场景名称"
)
private
String
name
;
/**
* 场景描述
*/
@Schema
(
description
=
"场景描述"
)
private
String
description
;
/**
* 场景海报图
*/
@Schema
(
description
=
"海报图"
)
private
String
poster
;
/**
* 状态(0禁用 1启用)
*/
@Schema
(
description
=
"状态(0禁用 1启用)"
)
private
Integer
status
;
/**
* 是否删除(0否 1是)
*/
private
Integer
deleted
;
/**
* 创建时间
*/
@Schema
(
description
=
"创建时间"
)
@JsonProperty
(
"create_time"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
LocalDateTime
createTime
;
...
...
@@ -47,6 +49,7 @@ public class ExamineSceneDto implements Serializable {
/**
* 更新时间
*/
@Schema
(
description
=
"update_time"
)
@JsonProperty
(
"update_time"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
LocalDateTime
updateTime
;
...
...
src/main/java/cn/breeze/elleai/application/dto/response/HotQaMobileDto.java
0 → 100644
View file @
b63df60b
package
cn
.
breeze
.
elleai
.
application
.
dto
.
response
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
@Data
public
class
HotQaMobileDto
implements
Serializable
{
@Schema
(
description
=
"问题"
)
private
String
question
;
}
src/main/java/cn/breeze/elleai/application/dto/response/QaAssistantDto.java
View file @
b63df60b
package
cn
.
breeze
.
elleai
.
application
.
dto
.
response
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -9,55 +10,59 @@ import java.time.LocalDateTime;
@Data
public
class
QaAssistantDto
implements
Serializable
{
@Schema
(
description
=
"助手ID"
)
private
Integer
id
;
/**
* 助手名称
*/
@Schema
(
description
=
"助手名称"
)
private
String
name
;
/**
* 助手描述
*/
@Schema
(
description
=
"助手描述"
)
private
String
description
;
/**
* 助手图标
*/
@Schema
(
description
=
"助手图标"
)
@JsonProperty
(
"icon_url"
)
private
String
iconUrl
;
/**
* 知识库分类IDS,以逗号分隔
*/
@Schema
(
description
=
"知识库分类IDS,逗号分隔"
)
@JsonProperty
(
"category_ids"
)
private
String
categoryIds
;
/**
* 可见角色IDS,以逗号分隔
*/
@Schema
(
description
=
"可见角色IDS,逗号分隔"
)
@JsonProperty
(
"visible_role_ids"
)
private
String
visibleRoleIds
;
/**
* 状态(0禁用 1启用)
*/
@Schema
(
description
=
"状态(0禁用 1启用)"
)
private
Integer
status
;
/**
* 是否删除(0否 1是)
*/
private
Integer
deleted
;
/**
* 创建时间
*/
@Schema
(
description
=
"创建时间"
)
@JsonProperty
(
"create_time"
)
private
LocalDateTime
createTime
;
/**
* 更新时间
*/
@Schema
(
description
=
"更新时间"
)
@JsonProperty
(
"update_time"
)
private
LocalDateTime
updateTime
;
}
src/main/java/cn/breeze/elleai/application/service/AppExamineService.java
View file @
b63df60b
...
...
@@ -142,9 +142,8 @@ public class AppExamineService {
*/
public
PageResult
<
ExamineSceneCategoryDto
>
examineSceneCategoryMobilePaginQuery
(
ExamineSceneCategoryRequestDto
request
)
{
request
.
setStatus
(
1
);
ExamineSceneCategoryRequestModel
requestModel
=
BeanUtil
.
copyProperties
(
request
,
ExamineSceneCategoryRequestModel
.
class
);
requestModel
.
setStatus
(
1
);
Page
<
ExamineSceneCategoryResponseModel
>
page
=
examineService
.
sceneCategoryPaginQuery
(
requestModel
);
...
...
@@ -269,10 +268,9 @@ public class AppExamineService {
*/
public
PageResult
<
ExamineSceneDto
>
examineMobileScenePaginQuery
(
ExamineSceneRequestDto
request
)
{
// 移动端默认查询启用状态
request
.
setStatus
(
1
);
ExamineSceneRequestModel
requestModel
=
BeanUtil
.
copyProperties
(
request
,
ExamineSceneRequestModel
.
class
);
// 移动端默认查询启用状态
requestModel
.
setStatus
(
1
);
Page
<
ExamineSceneResponseModel
>
page
=
examineService
.
scenePaginQuery
(
requestModel
);
...
...
@@ -589,9 +587,8 @@ public class AppExamineService {
*/
public
PageResult
<
ExamineMobileDto
>
examineMobilePaginQuery
(
ExamineRequestDto
request
)
{
request
.
setStatus
(
1
);
ExamineRequestModel
requestModel
=
BeanUtil
.
copyProperties
(
request
,
ExamineRequestModel
.
class
);
requestModel
.
setStatus
(
1
);
Page
<
ExamineResponseModel
>
page
=
examineService
.
examinePaginQuery
(
requestModel
);
...
...
src/main/java/cn/breeze/elleai/controller/ChatCompletionMobileController.java
View file @
b63df60b
...
...
@@ -5,6 +5,7 @@ import cn.breeze.elleai.application.dto.ApiResponse;
import
cn.breeze.elleai.application.dto.PageResult
;
import
cn.breeze.elleai.application.dto.request.QaAssistantRequestDto
;
import
cn.breeze.elleai.application.dto.request.UserQaHistoryRequestDto
;
import
cn.breeze.elleai.application.dto.response.HotQaMobileDto
;
import
cn.breeze.elleai.application.dto.response.QaAssistantDto
;
import
cn.breeze.elleai.application.dto.response.UserChatCompletionHistoryDto
;
import
cn.breeze.elleai.application.service.AppChatCompletionService
;
...
...
@@ -15,7 +16,7 @@ import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping
(
value
=
"/front/chat"
)
@Tag
(
name
=
"
对练移动端"
,
description
=
"对练
"
)
@Tag
(
name
=
"
AI问答移动端
"
)
@RequiredArgsConstructor
public
class
ChatCompletionMobileController
{
...
...
@@ -30,8 +31,8 @@ public class ChatCompletionMobileController {
@Operation
(
summary
=
"热门提问"
)
@PostMapping
(
"/hot/list"
)
public
ApiResponse
<
PageResult
<
QaAssistant
Dto
>>
hotList
(
@RequestBody
QaAssistantRequestDto
request
)
{
PageResult
<
QaAssistantDto
>
pageResult
=
chatCompletionService
.
qaAssistantPaginQuery
(
request
);
public
ApiResponse
<
PageResult
<
HotQaMobile
Dto
>>
hotList
(
@RequestBody
QaAssistantRequestDto
request
)
{
PageResult
<
HotQaMobileDto
>
pageResult
=
new
PageResult
<>(
);
return
ApiResponse
.
ok
(
pageResult
);
}
...
...
src/main/java/cn/breeze/elleai/controller/ExamineMobileController.java
View file @
b63df60b
...
...
@@ -13,6 +13,7 @@ import cn.hutool.core.bean.BeanUtil;
import
com.alibaba.fastjson.JSONObject
;
import
io.micrometer.common.util.StringUtils
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -28,7 +29,7 @@ import java.util.stream.Collectors;
@RestController
@RequestMapping
(
value
=
"/front/examine"
)
@Tag
(
name
=
"
对练移动端"
,
description
=
"对练
"
)
@Tag
(
name
=
"
AI对练移动端
"
)
@RequiredArgsConstructor
public
class
ExamineMobileController
{
...
...
@@ -42,7 +43,7 @@ public class ExamineMobileController {
}
@Operation
(
summary
=
"对练场景分类列表"
)
@
Reque
stMapping
(
"/scene_category/list"
)
@
Po
stMapping
(
"/scene_category/list"
)
public
ApiResponse
<
PageResult
<
ExamineSceneCategoryDto
>>
list
(
@RequestBody
ExamineSceneCategoryRequestDto
request
)
{
PageResult
<
ExamineSceneCategoryDto
>
pageResult
=
examineService
.
examineSceneCategoryMobilePaginQuery
(
request
);
return
ApiResponse
.
ok
(
pageResult
);
...
...
@@ -57,7 +58,7 @@ public class ExamineMobileController {
@Operation
(
summary
=
"对练详情"
)
@GetMapping
(
"/detail/{id}"
)
public
ApiResponse
<
ExamineMobileDto
>
detail
(
@PathVariable
(
"id"
)
Integer
id
)
{
public
ApiResponse
<
ExamineMobileDto
>
detail
(
@
Schema
(
description
=
"对练ID"
)
@
PathVariable
(
"id"
)
Integer
id
)
{
ExamineMobileDto
detail
=
examineService
.
examineMobileDetail
(
id
);
return
ApiResponse
.
ok
(
detail
);
}
...
...
@@ -74,12 +75,12 @@ public class ExamineMobileController {
@Operation
(
summary
=
"用户对练记录详情"
)
@GetMapping
(
"/record/detail/{id}"
)
public
ApiResponse
<
ExamineRecordMobileDto
>
recordDetail
(
@PathVariable
(
"id"
)
Integer
id
)
{
public
ApiResponse
<
ExamineRecordMobileDto
>
recordDetail
(
@
Schema
(
description
=
"对练记录ID"
)
@
PathVariable
(
"id"
)
Integer
id
)
{
ExamineRecordMobileDto
detail
=
examineService
.
examineRecordMobileDetail
(
id
);
return
ApiResponse
.
ok
(
detail
);
}
@Operation
(
summary
=
"
对练
列表"
)
@Operation
(
summary
=
"
获取题目
列表"
)
@PostMapping
(
"/get_examine_qa"
)
public
ApiResponse
<
PageResult
<
ExamineMobileDto
>>
getExamineQa
(
@RequestBody
ExamineRequestDto
request
)
{
PageResult
<
ExamineMobileDto
>
pageResult
=
examineService
.
examineMobilePaginQuery
(
request
);
...
...
@@ -87,20 +88,21 @@ public class ExamineMobileController {
}
@Operation
(
summary
=
"获取当前题目"
)
@GetMapping
(
value
=
"/get_current_question"
)
public
ApiResponse
<
ExamineQaDifyDto
>
getCurrentQuestion
(
@
RequestParam
(
"tenant
"
)
Integer
examineId
,
@RequestParam
(
"session_id"
)
String
sessionId
,
@RequestParam
(
"user_id"
)
String
userId
)
{
public
ApiResponse
<
ExamineQaDifyDto
>
getCurrentQuestion
(
@
Schema
(
description
=
"对练ID"
)
@RequestParam
(
"examine_id
"
)
Integer
examineId
,
@
Schema
(
description
=
"会话ID"
)
@
RequestParam
(
"session_id"
)
String
sessionId
,
@
Schema
(
description
=
"用户ID"
)
@
RequestParam
(
"user_id"
)
String
userId
)
{
ExamineQaDifyDto
result
=
examineService
.
getCurrentQuestion
(
examineId
,
sessionId
,
userId
);
return
ApiResponse
.
ok
(
result
);
}
@Operation
(
summary
=
"开始考试,获取出题"
)
@GetMapping
(
value
=
"/get_question"
)
public
ApiResponse
<
ExamineQaDifyDto
>
getQuestion
(
@RequestParam
(
"tenant"
)
Integer
tenant
,
@RequestParam
(
"examine_id"
)
Integer
examineId
,
@RequestParam
(
"session_id"
)
String
sessionId
,
@RequestParam
(
"user_id"
)
String
userId
)
{
public
ApiResponse
<
ExamineQaDifyDto
>
getQuestion
(
@Schema
(
description
=
"对练ID"
)
@RequestParam
(
"examine_id"
)
Integer
examineId
,
@Schema
(
description
=
"会话ID"
)
@RequestParam
(
"session_id"
)
String
sessionId
,
@Schema
(
description
=
"用户ID"
)
@RequestParam
(
"user_id"
)
String
userId
)
{
ExamineQaDifyDto
result
=
new
ExamineQaDifyDto
();
...
...
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