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
66c3f577
Commit
66c3f577
authored
Oct 18, 2024
by
陈立彬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口调整
parent
a9fe6b05
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
268 additions
and
99 deletions
+268
-99
CommonRequestDto.java
...eeze/elleai/application/dto/request/CommonRequestDto.java
+20
-0
ExamineSceneCategoryRequestDto.java
...plication/dto/request/ExamineSceneCategoryRequestDto.java
+2
-2
ExamineSceneCategorySaveDto.java
.../application/dto/request/ExamineSceneCategorySaveDto.java
+4
-6
ProperNounRequestDto.java
.../elleai/application/dto/request/ProperNounRequestDto.java
+2
-2
ProperNounSaveDto.java
...eze/elleai/application/dto/request/ProperNounSaveDto.java
+4
-6
QaAssistantSaveDto.java
...ze/elleai/application/dto/request/QaAssistantSaveDto.java
+7
-12
UserQaHistoryMobileRequestDto.java
...pplication/dto/request/UserQaHistoryMobileRequestDto.java
+2
-2
UserQaHistoryRequestDto.java
...leai/application/dto/request/UserQaHistoryRequestDto.java
+2
-2
AppRoleDto.java
...cn/breeze/elleai/application/dto/response/AppRoleDto.java
+13
-0
ExamineRecordDto.java
...eze/elleai/application/dto/response/ExamineRecordDto.java
+14
-0
ExamineSceneCategoryDto.java
...eai/application/dto/response/ExamineSceneCategoryDto.java
+4
-15
KnowledgeDataBaseCategoryDto.java
...pplication/dto/response/KnowledgeDataBaseCategoryDto.java
+16
-0
ProperNounDto.java
...breeze/elleai/application/dto/response/ProperNounDto.java
+6
-10
QaAssistantDto.java
...reeze/elleai/application/dto/response/QaAssistantDto.java
+7
-12
AppChatCompletionService.java
.../elleai/application/service/AppChatCompletionService.java
+17
-0
AppCommonService.java
...n/breeze/elleai/application/service/AppCommonService.java
+47
-1
AppExamineService.java
.../breeze/elleai/application/service/AppExamineService.java
+55
-0
CommonController.java
...a/cn/breeze/elleai/controller/admin/CommonController.java
+20
-1
ExamineController.java
.../cn/breeze/elleai/controller/admin/ExamineController.java
+2
-2
ExamineMobileController.java
...eeze/elleai/controller/front/ExamineMobileController.java
+1
-1
ProperNounSaveModel.java
...ai/domain/sparring/model/request/ProperNounSaveModel.java
+4
-6
QaAssistantSaveModel.java
...i/domain/sparring/model/request/QaAssistantSaveModel.java
+2
-2
ProperNounResponseModel.java
...main/sparring/model/response/ProperNounResponseModel.java
+1
-1
QaAssistantResponseModel.java
...ain/sparring/model/response/QaAssistantResponseModel.java
+2
-2
ChatCompletionServiceImpl.java
...ai/domain/sparring/service/ChatCompletionServiceImpl.java
+1
-1
CommonServiceImpl.java
...eze/elleai/domain/sparring/service/CommonServiceImpl.java
+1
-1
ExamineServiceImpl.java
...ze/elleai/domain/sparring/service/ExamineServiceImpl.java
+6
-6
ProperNounEntity.java
.../java/cn/breeze/elleai/infra/entity/ProperNounEntity.java
+1
-1
QaAssistantEntity.java
...java/cn/breeze/elleai/infra/entity/QaAssistantEntity.java
+2
-2
ProperNounTableDef.java
.../breeze/elleai/infra/entity/table/ProperNounTableDef.java
+1
-1
QaAssistantTableDef.java
...breeze/elleai/infra/entity/table/QaAssistantTableDef.java
+2
-2
No files found.
src/main/java/cn/breeze/elleai/application/dto/request/CommonRequestDto.java
0 → 100644
View file @
66c3f577
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
;
@Data
public
class
CommonRequestDto
implements
Serializable
{
@Schema
(
description
=
"页码"
)
@JsonProperty
(
"page_no"
)
private
Integer
pageNo
=
1
;
@Schema
(
description
=
"分页数量"
)
@JsonProperty
(
"page_size"
)
private
Integer
pageSize
=
10
;
}
src/main/java/cn/breeze/elleai/application/dto/request/ExamineSceneCategoryRequestDto.java
View file @
66c3f577
...
...
@@ -12,11 +12,11 @@ public class ExamineSceneCategoryRequestDto implements Serializable {
@Schema
(
description
=
"页码"
)
@JsonProperty
(
"page_no"
)
private
Integer
pageNo
;
private
Integer
pageNo
=
1
;
@Schema
(
description
=
"分页数量"
)
@JsonProperty
(
"page_size"
)
private
Integer
pageSize
;
private
Integer
pageSize
=
10
;
@Schema
(
description
=
"场景分类名称"
)
private
String
name
;
...
...
src/main/java/cn/breeze/elleai/application/dto/request/ExamineSceneCategorySaveDto.java
View file @
66c3f577
...
...
@@ -6,6 +6,7 @@ import lombok.Data;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
@Data
public
class
ExamineSceneCategorySaveDto
implements
Serializable
{
...
...
@@ -26,12 +27,9 @@ public class ExamineSceneCategorySaveDto implements Serializable {
@JsonProperty
(
"scene_id"
)
private
Integer
sceneId
;
/**
* 可见角色IDS
*/
@Schema
(
description
=
"可见角色IDS,逗号分隔"
)
@JsonProperty
(
"visible_role_ids"
)
private
String
visibleRoleIds
;
@Schema
(
description
=
"可见角色列表"
)
@JsonProperty
(
"visible_role_list"
)
private
List
<
String
>
visibleRoleList
;
/**
* 分类描述
...
...
src/main/java/cn/breeze/elleai/application/dto/request/ProperNounRequestDto.java
View file @
66c3f577
...
...
@@ -11,11 +11,11 @@ public class ProperNounRequestDto implements Serializable {
@Schema
(
description
=
"页码"
)
@JsonProperty
(
"page_no"
)
private
Integer
pageNo
;
private
Integer
pageNo
=
1
;
@Schema
(
description
=
"分页数量"
)
@JsonProperty
(
"page_size"
)
private
Integer
pageSize
;
private
Integer
pageSize
=
10
;
@Schema
(
description
=
"专有名词名称"
)
private
String
name
;
...
...
src/main/java/cn/breeze/elleai/application/dto/request/ProperNounSaveDto.java
View file @
66c3f577
...
...
@@ -6,6 +6,7 @@ import lombok.Data;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
@Data
public
class
ProperNounSaveDto
implements
Serializable
{
...
...
@@ -19,12 +20,9 @@ public class ProperNounSaveDto implements Serializable {
@Schema
(
description
=
"专有名词名称"
)
private
String
name
;
/**
* 相似词,以逗号分隔
*/
@Schema
(
description
=
"相似词,逗号分隔"
)
@JsonProperty
(
"similar_words"
)
private
String
similarWords
;
@Schema
(
description
=
"相似词列表"
)
@JsonProperty
(
"similar_word_list"
)
private
List
<
String
>
similarWordList
;
/**
* 状态(0禁用 1启用)
...
...
src/main/java/cn/breeze/elleai/application/dto/request/QaAssistantSaveDto.java
View file @
66c3f577
...
...
@@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
public
class
QaAssistantSaveDto
implements
Serializable
{
...
...
@@ -31,18 +32,12 @@ public class QaAssistantSaveDto implements Serializable {
@JsonProperty
(
"icon_url"
)
private
String
iconUrl
;
/**
* 知识库分类IDS,以逗号分隔
*/
@Schema
(
description
=
"知识库分类IDS,逗号分隔"
)
@JsonProperty
(
"category_ids"
)
private
String
categoryIds
;
@Schema
(
description
=
"知识库分类ID列表"
)
@JsonProperty
(
"category_id_list"
)
private
List
<
String
>
categoryIdList
;
/**
* 可见角色IDS,以逗号分隔
*/
@Schema
(
description
=
"可见角色IDS,逗号分隔"
)
@JsonProperty
(
"visible_role_ids"
)
private
String
visibleRoleIds
;
@Schema
(
description
=
"可见角色列表"
)
@JsonProperty
(
"visible_role_list"
)
private
List
<
String
>
visibleRoleList
;
}
src/main/java/cn/breeze/elleai/application/dto/request/UserQaHistoryMobileRequestDto.java
View file @
66c3f577
...
...
@@ -11,11 +11,11 @@ public class UserQaHistoryMobileRequestDto implements Serializable {
@Schema
(
description
=
"页码"
)
@JsonProperty
(
"page_no"
)
private
Integer
pageNo
;
private
Integer
pageNo
=
1
;
@Schema
(
description
=
"分页数量"
)
@JsonProperty
(
"page_size"
)
private
Integer
pageSize
;
private
Integer
pageSize
=
10
;
@Schema
(
description
=
"用户ID"
)
@JsonProperty
(
"user_id"
)
...
...
src/main/java/cn/breeze/elleai/application/dto/request/UserQaHistoryRequestDto.java
View file @
66c3f577
...
...
@@ -11,9 +11,9 @@ public class UserQaHistoryRequestDto implements Serializable {
@Schema
(
description
=
"页码"
)
@JsonProperty
(
"page_no"
)
private
Integer
pageNo
;
private
Integer
pageNo
=
1
;
@Schema
(
description
=
"分页数量"
)
@JsonProperty
(
"page_size"
)
private
Integer
pageSize
;
private
Integer
pageSize
=
10
;
}
src/main/java/cn/breeze/elleai/application/dto/response/AppRoleDto.java
0 → 100644
View file @
66c3f577
package
cn
.
breeze
.
elleai
.
application
.
dto
.
response
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
AppRoleDto
implements
Serializable
{
@Schema
(
description
=
"名称"
)
private
String
name
;
}
src/main/java/cn/breeze/elleai/application/dto/response/ExamineRecordDto.java
View file @
66c3f577
...
...
@@ -23,6 +23,13 @@ public class ExamineRecordDto implements Serializable {
@JsonProperty
(
"user_id"
)
private
String
userId
;
/**
* 用户名称
*/
@Schema
(
description
=
"用户名称"
)
@JsonProperty
(
"user_name"
)
private
String
userName
;
/**
* 会话ID
*/
...
...
@@ -59,6 +66,13 @@ public class ExamineRecordDto implements Serializable {
@JsonProperty
(
"answered_num"
)
private
Integer
answeredNum
;
/**
* 题目总数
*/
@Schema
(
description
=
"题目总数"
)
@JsonProperty
(
"qaNum"
)
private
Integer
qaNum
;
/**
* 综合评分
*/
...
...
src/main/java/cn/breeze/elleai/application/dto/response/ExamineSceneCategoryDto.java
View file @
66c3f577
...
...
@@ -7,6 +7,7 @@ import lombok.Data;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
@Data
public
class
ExamineSceneCategoryDto
implements
Serializable
{
...
...
@@ -34,19 +35,9 @@ public class ExamineSceneCategoryDto implements Serializable {
@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
=
"可见角色列表"
)
@JsonProperty
(
"visible_role_list"
)
private
List
<
String
>
visibleRoleList
;
/**
* 分类描述
...
...
@@ -64,7 +55,6 @@ public class ExamineSceneCategoryDto implements Serializable {
*/
@Schema
(
description
=
"创建时间"
)
@JsonProperty
(
"create_time"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
/**
...
...
@@ -72,7 +62,6 @@ public class ExamineSceneCategoryDto implements Serializable {
*/
@Schema
(
description
=
"更新时间"
)
@JsonProperty
(
"update_time"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
updateTime
;
/**
...
...
src/main/java/cn/breeze/elleai/application/dto/response/KnowledgeDataBaseCategoryDto.java
0 → 100644
View file @
66c3f577
package
cn
.
breeze
.
elleai
.
application
.
dto
.
response
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
KnowledgeDataBaseCategoryDto
implements
Serializable
{
@Schema
(
description
=
"ID"
)
private
Integer
id
;
@Schema
(
description
=
"名称"
)
private
String
name
;
}
src/main/java/cn/breeze/elleai/application/dto/response/ProperNounDto.java
View file @
66c3f577
...
...
@@ -2,10 +2,13 @@ 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
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
@Data
public
class
ProperNounDto
implements
Serializable
{
...
...
@@ -17,22 +20,15 @@ public class ProperNounDto implements Serializable {
*/
private
String
name
;
/**
* 相似词,以逗号分隔
*/
@JsonProperty
(
"similar_words"
)
private
String
similarWords
;
@Schema
(
description
=
"相似词列表"
)
@JsonProperty
(
"similar_word_list"
)
private
List
<
String
>
similarWordList
=
new
ArrayList
<>();
/**
* 状态(0禁用 1启用)
*/
private
Integer
status
;
/**
* 是否删除(0否 1是)
*/
private
Integer
deleted
;
/**
* 创建时间
*/
...
...
src/main/java/cn/breeze/elleai/application/dto/response/QaAssistantDto.java
View file @
66c3f577
...
...
@@ -6,6 +6,7 @@ import lombok.Data;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
@Data
public
class
QaAssistantDto
implements
Serializable
{
...
...
@@ -32,19 +33,13 @@ public class QaAssistantDto implements Serializable {
@JsonProperty
(
"icon_url"
)
private
String
iconUrl
;
/**
* 知识库分类IDS,以逗号分隔
*/
@Schema
(
description
=
"知识库分类IDS,逗号分隔"
)
@JsonProperty
(
"category_ids"
)
private
String
categoryIds
;
@Schema
(
description
=
"知识库分类ID列表"
)
@JsonProperty
(
"category_id_list"
)
private
List
<
String
>
categoryIdList
;
/**
* 可见角色IDS,以逗号分隔
*/
@Schema
(
description
=
"可见角色IDS,逗号分隔"
)
@JsonProperty
(
"visible_role_ids"
)
private
String
visibleRoleIds
;
@Schema
(
description
=
"可见角色列表"
)
@JsonProperty
(
"visible_role_list"
)
private
List
<
String
>
visibleRoleList
;
/**
* 状态(0禁用 1启用)
...
...
src/main/java/cn/breeze/elleai/application/service/AppChatCompletionService.java
View file @
66c3f577
...
...
@@ -14,6 +14,7 @@ import cn.breeze.elleai.domain.sparring.service.ChatCompletionService;
import
cn.breeze.elleai.util.UserPrincipal
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mybatisflex.core.paginate.Page
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -86,6 +87,8 @@ public class AppChatCompletionService {
public
void
saveQaAssistant
(
QaAssistantSaveDto
dto
)
{
QaAssistantSaveModel
model
=
BeanUtil
.
copyProperties
(
dto
,
QaAssistantSaveModel
.
class
);
model
.
setCategoryIds
(
JSONObject
.
toJSONString
(
dto
.
getCategoryIdList
()));
model
.
setVisibleRoleIds
(
JSONObject
.
toJSONString
(
dto
.
getVisibleRoleList
()));
chatCompletionService
.
saveQaAssistant
(
model
);
}
...
...
@@ -106,6 +109,13 @@ public class AppChatCompletionService {
if
(
CollectionUtil
.
isNotEmpty
(
page
.
getRecords
()))
{
List
<
QaAssistantDto
>
dtoList
=
page
.
getRecords
().
stream
().
map
(
v
->
{
QaAssistantDto
dto
=
BeanUtil
.
copyProperties
(
v
,
QaAssistantDto
.
class
);
if
(
StrUtil
.
isNotEmpty
(
v
.
getCategoryIds
()))
{
dto
.
setCategoryIdList
(
JSONObject
.
parseArray
(
v
.
getCategoryIds
(),
String
.
class
));
}
if
(
StrUtil
.
isNotEmpty
(
v
.
getVisibleRoleIds
()))
{
dto
.
setVisibleRoleList
(
JSONObject
.
parseArray
(
v
.
getVisibleRoleIds
(),
String
.
class
));
}
return
dto
;
}).
collect
(
Collectors
.
toList
());
...
...
@@ -131,6 +141,13 @@ public class AppChatCompletionService {
if
(
CollectionUtil
.
isNotEmpty
(
modelList
))
{
resultList
=
modelList
.
stream
().
map
(
v
->
{
QaAssistantDto
dto
=
BeanUtil
.
copyProperties
(
v
,
QaAssistantDto
.
class
);
if
(
StrUtil
.
isNotEmpty
(
v
.
getCategoryIds
()))
{
dto
.
setCategoryIdList
(
JSONObject
.
parseArray
(
v
.
getCategoryIds
(),
String
.
class
));
}
if
(
StrUtil
.
isNotEmpty
(
v
.
getVisibleRoleIds
()))
{
dto
.
setVisibleRoleList
(
JSONObject
.
parseArray
(
v
.
getVisibleRoleIds
(),
String
.
class
));
}
return
dto
;
}).
collect
(
Collectors
.
toList
());
}
...
...
src/main/java/cn/breeze/elleai/application/service/AppCommonService.java
View file @
66c3f577
...
...
@@ -3,6 +3,8 @@ package cn.breeze.elleai.application.service;
import
cn.breeze.elleai.application.dto.PageResult
;
import
cn.breeze.elleai.application.dto.request.ProperNounRequestDto
;
import
cn.breeze.elleai.application.dto.request.ProperNounSaveDto
;
import
cn.breeze.elleai.application.dto.response.AppRoleDto
;
import
cn.breeze.elleai.application.dto.response.KnowledgeDataBaseCategoryDto
;
import
cn.breeze.elleai.application.dto.response.ProperNounDto
;
import
cn.breeze.elleai.domain.sparring.model.request.ProperNounRequestModel
;
import
cn.breeze.elleai.domain.sparring.model.request.ProperNounSaveModel
;
...
...
@@ -10,10 +12,14 @@ import cn.breeze.elleai.domain.sparring.model.response.ProperNounResponseModel;
import
cn.breeze.elleai.domain.sparring.service.CommonService
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mybatisflex.core.paginate.Page
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -52,7 +58,11 @@ public class AppCommonService {
*/
public
ProperNounDto
properNounDetail
(
Integer
id
)
{
ProperNounResponseModel
model
=
commonService
.
properNounDetail
(
id
);
return
BeanUtil
.
copyProperties
(
model
,
ProperNounDto
.
class
);
ProperNounDto
result
=
BeanUtil
.
copyProperties
(
model
,
ProperNounDto
.
class
);
if
(
StrUtil
.
isNotEmpty
(
model
.
getSimilarWords
()))
{
result
.
setSimilarWordList
(
JSONObject
.
parseArray
(
model
.
getSimilarWords
(),
String
.
class
));
}
return
result
;
}
...
...
@@ -63,6 +73,7 @@ public class AppCommonService {
public
void
saveproperNoun
(
ProperNounSaveDto
dto
)
{
ProperNounSaveModel
model
=
BeanUtil
.
copyProperties
(
dto
,
ProperNounSaveModel
.
class
);
model
.
setSimilarWords
(
JSON
.
toJSONString
(
dto
.
getSimilarWordList
()));
commonService
.
saveProperNoun
(
model
);
}
...
...
@@ -83,6 +94,10 @@ public class AppCommonService {
if
(
CollectionUtil
.
isNotEmpty
(
page
.
getRecords
()))
{
List
<
ProperNounDto
>
dtoList
=
page
.
getRecords
().
stream
().
map
(
v
->
{
ProperNounDto
dto
=
BeanUtil
.
copyProperties
(
v
,
ProperNounDto
.
class
);
if
(
StrUtil
.
isNotEmpty
(
v
.
getSimilarWords
()))
{
dto
.
setSimilarWordList
(
JSONObject
.
parseArray
(
v
.
getSimilarWords
(),
String
.
class
));
}
return
dto
;
}).
collect
(
Collectors
.
toList
());
...
...
@@ -90,4 +105,35 @@ public class AppCommonService {
}
return
pageResult
;
}
/**
* 知识库分类列表
* @return
*/
public
List
<
KnowledgeDataBaseCategoryDto
>
KnowledgeDataBaseCategoryList
()
{
List
<
KnowledgeDataBaseCategoryDto
>
result
=
new
ArrayList
<>();
KnowledgeDataBaseCategoryDto
dto
=
new
KnowledgeDataBaseCategoryDto
();
dto
.
setId
(
1
);
dto
.
setName
(
"品项"
);
result
.
add
(
dto
);
return
result
;
}
/**
* APP角色列表
* @return
*/
public
List
<
AppRoleDto
>
appRoleList
()
{
List
<
AppRoleDto
>
result
=
new
ArrayList
<>();
AppRoleDto
dto
=
new
AppRoleDto
();
dto
.
setName
(
"顾问"
);
result
.
add
(
dto
);
AppRoleDto
dto2
=
new
AppRoleDto
();
dto2
.
setName
(
"美容师"
);
result
.
add
(
dto2
);
return
result
;
}
}
src/main/java/cn/breeze/elleai/application/service/AppExamineService.java
View file @
66c3f577
...
...
@@ -99,6 +99,7 @@ public class AppExamineService {
Assert
.
notNull
(
scene
,
"场景信息获取异常"
);
ExamineSceneCategorySaveModel
model
=
BeanUtil
.
copyProperties
(
dto
,
ExamineSceneCategorySaveModel
.
class
);
model
.
setVisibleRoleIds
(
JSONObject
.
toJSONString
(
dto
.
getVisibleRoleList
()));
examineService
.
saveSceneCategory
(
model
);
}
...
...
@@ -126,6 +127,11 @@ public class AppExamineService {
dto
.
setSceneName
(
sceneResponseModel
.
getName
());
}
}
if
(
StrUtil
.
isNotEmpty
(
v
.
getVisibleRoleIds
()))
{
dto
.
setVisibleRoleList
(
JSONObject
.
parseArray
(
v
.
getVisibleRoleIds
(),
String
.
class
));
}
return
dto
;
}).
collect
(
Collectors
.
toList
());
...
...
@@ -181,6 +187,10 @@ public class AppExamineService {
}
}
if
(
StrUtil
.
isNotEmpty
(
v
.
getVisibleRoleIds
()))
{
dto
.
setVisibleRoleList
(
JSONObject
.
parseArray
(
v
.
getVisibleRoleIds
(),
String
.
class
));
}
return
dto
;
}).
collect
(
Collectors
.
toList
());
}
...
...
@@ -473,6 +483,50 @@ public class AppExamineService {
return
result
;
}
/**
* 获取对练记录详情
* @param id
* @return
*/
public
ExamineRecordDto
examineRecordDetail
(
Integer
id
)
{
ExamineRecordDto
result
=
null
;
ExamineRecordResponseModel
model
=
examineService
.
examineRecordDetail
(
id
);
if
(
Objects
.
nonNull
(
model
))
{
result
=
BeanUtil
.
copyProperties
(
model
,
ExamineRecordDto
.
class
);
ExamineResponseModel
examine
=
examineService
.
examineDetail
(
result
.
getExamineId
());
if
(
Objects
.
nonNull
(
examine
))
{
result
.
setExamineName
(
examine
.
getName
());
result
.
setQaNum
(
examine
.
getQaNum
());
}
// 对练明细
ExamineDetailRecordRequestModel
req
=
new
ExamineDetailRecordRequestModel
();
req
.
setRecordId
(
id
);
List
<
ExamineDetailRecordResponseModel
>
detailRecordList
=
examineService
.
examineDetailRecordList
(
req
);
if
(
CollectionUtil
.
isNotEmpty
(
detailRecordList
))
{
// 题目信息
List
<
Integer
>
qaIdList
=
detailRecordList
.
stream
().
map
(
ExamineDetailRecordResponseModel:
:
getQaId
).
collect
(
Collectors
.
toList
());
List
<
ExamineQaResponseModel
>
examineQaList
=
examineService
.
examineQaList
(
qaIdList
);
Map
<
Integer
,
ExamineQaResponseModel
>
qaMap
=
examineQaList
.
stream
().
collect
(
toMap
(
ExamineQaResponseModel:
:
getId
,
Function
.
identity
()));
List
<
ExamineDetailRecordMobileDto
>
details
=
detailRecordList
.
stream
().
map
(
v
->
{
ExamineDetailRecordMobileDto
detail
=
BeanUtil
.
copyProperties
(
v
,
ExamineDetailRecordMobileDto
.
class
);
ExamineQaResponseModel
qaModel
=
qaMap
.
get
(
detail
.
getQaId
());
if
(
Objects
.
nonNull
(
qaModel
))
{
detail
.
setQuestion
(
qaModel
.
getQuestion
());
detail
.
setAnswer
(
qaModel
.
getAnswer
());
detail
.
setUserAnswer
(
v
.
getAnswer
());
}
return
detail
;
}).
collect
(
Collectors
.
toList
());
result
.
setDetails
(
details
);
}
}
return
result
;
}
/**
* 获取对练记录详情
* @param id
...
...
@@ -678,6 +732,7 @@ public class AppExamineService {
if
(
Objects
.
nonNull
(
examineDto
))
{
dto
.
setExamineName
(
examineDto
.
getName
());
dto
.
setExamineDescription
(
examineDto
.
getDescription
());
dto
.
setQaNum
(
examineDto
.
getQaNum
());
}
return
dto
;
...
...
src/main/java/cn/breeze/elleai/controller/admin/CommonController.java
View file @
66c3f577
...
...
@@ -3,7 +3,10 @@ package cn.breeze.elleai.controller.admin;
import
cn.breeze.elleai.application.dto.ApiResponse
;
import
cn.breeze.elleai.application.dto.PageResult
;
import
cn.breeze.elleai.application.dto.request.*
;
import
cn.breeze.elleai.application.dto.request.ProperNounRequestDto
;
import
cn.breeze.elleai.application.dto.request.ProperNounSaveDto
;
import
cn.breeze.elleai.application.dto.response.AppRoleDto
;
import
cn.breeze.elleai.application.dto.response.KnowledgeDataBaseCategoryDto
;
import
cn.breeze.elleai.application.dto.response.ProperNounDto
;
import
cn.breeze.elleai.application.service.AppCommonService
;
import
cn.breeze.elleai.config.QueryParam
;
...
...
@@ -13,6 +16,8 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
@RestController
@RequestMapping
(
value
=
"/admin/common"
)
@Tag
(
name
=
"管理端-公共服务"
,
description
=
"公共服务"
)
...
...
@@ -58,4 +63,18 @@ public class CommonController {
return
ApiResponse
.
ok
(
pageResult
);
}
@Operation
(
summary
=
"知识库分类列表"
)
@GetMapping
(
"/kdb_category/list"
)
public
ApiResponse
<
List
<
KnowledgeDataBaseCategoryDto
>>
kdbCategoryList
()
{
List
<
KnowledgeDataBaseCategoryDto
>
result
=
commonService
.
KnowledgeDataBaseCategoryList
();
return
ApiResponse
.
ok
(
result
);
}
@Operation
(
summary
=
"伊丽汇APP角色列表"
)
@GetMapping
(
"/app_role/list"
)
public
ApiResponse
<
List
<
AppRoleDto
>>
appRoleList
()
{
List
<
AppRoleDto
>
result
=
commonService
.
appRoleList
();
return
ApiResponse
.
ok
(
result
);
}
}
src/main/java/cn/breeze/elleai/controller/admin/ExamineController.java
View file @
66c3f577
...
...
@@ -65,8 +65,8 @@ public class ExamineController {
@Operation
(
summary
=
"对练记录详情"
,
tags
=
"对练记录"
)
@GetMapping
(
"/record/detail/{id}"
)
public
ApiResponse
<
ExamineRecord
Mobile
Dto
>
recordDetail
(
@Schema
(
description
=
"对练记录ID"
)
@PathVariable
(
"id"
)
Integer
id
)
{
ExamineRecord
MobileDto
detail
=
examineService
.
examineRecordMobile
Detail
(
id
);
public
ApiResponse
<
ExamineRecordDto
>
recordDetail
(
@Schema
(
description
=
"对练记录ID"
)
@PathVariable
(
"id"
)
Integer
id
)
{
ExamineRecord
Dto
detail
=
examineService
.
examineRecord
Detail
(
id
);
return
ApiResponse
.
ok
(
detail
);
}
...
...
src/main/java/cn/breeze/elleai/controller/front/ExamineMobileController.java
View file @
66c3f577
...
...
@@ -110,7 +110,7 @@ public class ExamineMobileController {
return
ApiResponse
.
ok
(
"SUCCESS"
);
}
@Operation
(
summary
=
"获取最终考试结果"
)
@Operation
(
summary
=
"
前端轮询,
获取最终考试结果"
)
@GetMapping
(
value
=
"/get_examine_final_result"
)
public
ApiResponse
<
ExamineFinalResultDto
>
getExamineFinalResult
(
@Parameter
(
hidden
=
true
)
UserPrincipal
userPrincipal
,
@Schema
(
description
=
"对练ID"
)
@RequestParam
(
"examine_id"
)
Integer
examineId
,
...
...
src/main/java/cn/breeze/elleai/domain/sparring/model/request/ProperNounSaveModel.java
View file @
66c3f577
package
cn
.
breeze
.
elleai
.
domain
.
sparring
.
model
.
request
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.mybatisflex.annotation.Id
;
import
com.mybatisflex.annotation.KeyType
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
@Data
public
class
ProperNounSaveModel
implements
Serializable
{
...
...
@@ -18,7 +21,7 @@ public class ProperNounSaveModel implements Serializable {
private
String
name
;
/**
* 相似词
,以逗号分隔
* 相似词
*/
private
String
similarWords
;
...
...
@@ -27,11 +30,6 @@ public class ProperNounSaveModel implements Serializable {
*/
private
Integer
status
;
/**
* 是否删除(0否 1是)
*/
private
Integer
deleted
;
/**
* 创建时间
*/
...
...
src/main/java/cn/breeze/elleai/domain/sparring/model/request/QaAssistantSaveModel.java
View file @
66c3f577
...
...
@@ -27,12 +27,12 @@ public class QaAssistantSaveModel implements Serializable {
private
String
iconUrl
;
/**
* 知识库分类ID
S,以逗号分隔
* 知识库分类ID
列表
*/
private
String
categoryIds
;
/**
* 可见角色
IDS,以逗号分隔
* 可见角色
列表
*/
private
String
visibleRoleIds
;
...
...
src/main/java/cn/breeze/elleai/domain/sparring/model/response/ProperNounResponseModel.java
View file @
66c3f577
...
...
@@ -17,7 +17,7 @@ public class ProperNounResponseModel implements Serializable {
private
String
name
;
/**
* 相似词
,以逗号分隔
* 相似词
列表
*/
private
String
similarWords
;
...
...
src/main/java/cn/breeze/elleai/domain/sparring/model/response/QaAssistantResponseModel.java
View file @
66c3f577
...
...
@@ -28,12 +28,12 @@ public class QaAssistantResponseModel implements Serializable {
private
String
iconUrl
;
/**
* 知识库分类ID
S,以逗号分隔
* 知识库分类ID
列表
*/
private
String
categoryIds
;
/**
* 可见角色
IDS,以逗号分隔
* 可见角色
列表
*/
private
String
visibleRoleIds
;
...
...
src/main/java/cn/breeze/elleai/domain/sparring/service/ChatCompletionServiceImpl.java
View file @
66c3f577
...
...
@@ -188,7 +188,7 @@ public class ChatCompletionServiceImpl implements ChatCompletionService{
QaAssistantEntity
entity
=
BeanUtil
.
toBean
(
dto
,
QaAssistantEntity
.
class
);
entity
.
setUpdateTime
(
new
Date
());
if
(
Objects
.
isNull
(
entity
.
getId
()))
{
entity
.
setStatus
(
1
);
entity
.
setStatus
(
0
);
entity
.
setDeleted
(
0
);
}
qaAssistantMapper
.
insertOrUpdateSelective
(
entity
);
...
...
src/main/java/cn/breeze/elleai/domain/sparring/service/CommonServiceImpl.java
View file @
66c3f577
...
...
@@ -86,7 +86,7 @@ public class CommonServiceImpl implements CommonService{
ProperNounEntity
entity
=
BeanUtil
.
toBean
(
dto
,
ProperNounEntity
.
class
);
entity
.
setUpdateTime
(
new
Date
());
if
(
Objects
.
isNull
(
entity
.
getId
()))
{
entity
.
setStatus
(
1
);
entity
.
setStatus
(
0
);
entity
.
setDeleted
(
0
);
}
properNounMapper
.
insertOrUpdateSelective
(
entity
);
...
...
src/main/java/cn/breeze/elleai/domain/sparring/service/ExamineServiceImpl.java
View file @
66c3f577
...
...
@@ -179,7 +179,7 @@ public class ExamineServiceImpl implements ExamineService {
ExamineSceneEntity
entity
=
BeanUtil
.
toBean
(
dto
,
ExamineSceneEntity
.
class
);
entity
.
setUpdateTime
(
new
Date
());
if
(
Objects
.
isNull
(
entity
.
getId
()))
{
entity
.
setStatus
(
1
);
entity
.
setStatus
(
0
);
entity
.
setDeleted
(
0
);
}
sceneMapper
.
insertOrUpdateSelective
(
entity
);
...
...
@@ -190,7 +190,7 @@ public class ExamineServiceImpl implements ExamineService {
ExamineSceneCategoryEntity
entity
=
BeanUtil
.
toBean
(
dto
,
ExamineSceneCategoryEntity
.
class
);
entity
.
setUpdateTime
(
new
Date
());
if
(
Objects
.
isNull
(
entity
.
getId
()))
{
entity
.
setStatus
(
1
);
entity
.
setStatus
(
0
);
entity
.
setDeleted
(
0
);
}
sceneCategoryMapper
.
insertOrUpdateSelective
(
entity
);
...
...
@@ -267,7 +267,7 @@ public class ExamineServiceImpl implements ExamineService {
ExamineQaEntity
entity
=
BeanUtil
.
toBean
(
dto
,
ExamineQaEntity
.
class
);
entity
.
setUpdateTime
(
new
Date
());
if
(
Objects
.
isNull
(
entity
.
getId
()))
{
entity
.
setStatus
(
1
);
entity
.
setStatus
(
0
);
entity
.
setDeleted
(
0
);
}
qaMapper
.
insertOrUpdateSelective
(
entity
);
...
...
@@ -336,7 +336,7 @@ public class ExamineServiceImpl implements ExamineService {
ExamineEntity
entity
=
BeanUtil
.
toBean
(
dto
,
ExamineEntity
.
class
);
entity
.
setUpdateTime
(
new
Date
());
if
(
Objects
.
isNull
(
entity
.
getId
()))
{
entity
.
setStatus
(
1
);
entity
.
setStatus
(
0
);
entity
.
setDeleted
(
0
);
}
examineMapper
.
insertOrUpdateSelective
(
entity
);
...
...
@@ -514,7 +514,7 @@ public class ExamineServiceImpl implements ExamineService {
WikiCategoryEntity
entity
=
BeanUtil
.
toBean
(
dto
,
WikiCategoryEntity
.
class
);
entity
.
setUpdateTime
(
new
Date
());
if
(
Objects
.
isNull
(
entity
.
getId
()))
{
entity
.
setStatus
(
1
);
entity
.
setStatus
(
0
);
entity
.
setDeleted
(
0
);
}
wikiCategoryMapper
.
insertOrUpdateSelective
(
entity
);
...
...
@@ -577,7 +577,7 @@ public class ExamineServiceImpl implements ExamineService {
WikiEntity
entity
=
BeanUtil
.
toBean
(
dto
,
WikiEntity
.
class
);
entity
.
setUpdateTime
(
new
Date
());
if
(
Objects
.
isNull
(
entity
.
getId
()))
{
entity
.
setStatus
(
1
);
entity
.
setStatus
(
0
);
entity
.
setDeleted
(
0
);
}
wikiMapper
.
insertOrUpdateSelective
(
entity
);
...
...
src/main/java/cn/breeze/elleai/infra/entity/ProperNounEntity.java
View file @
66c3f577
...
...
@@ -38,7 +38,7 @@ public class ProperNounEntity implements Serializable {
private
String
name
;
/**
* 相似词
,以逗号分隔
* 相似词
列表
*/
private
String
similarWords
;
...
...
src/main/java/cn/breeze/elleai/infra/entity/QaAssistantEntity.java
View file @
66c3f577
...
...
@@ -48,12 +48,12 @@ public class QaAssistantEntity implements Serializable {
private
String
iconUrl
;
/**
* 知识库分类ID
S,以逗号分隔
* 知识库分类ID
列表
*/
private
String
categoryIds
;
/**
* 可见角色
IDS,以逗号分隔
* 可见角色
列表
*/
private
String
visibleRoleIds
;
...
...
src/main/java/cn/breeze/elleai/infra/entity/table/ProperNounTableDef.java
View file @
66c3f577
...
...
@@ -50,7 +50,7 @@ public class ProperNounTableDef extends TableDef {
public
final
QueryColumn
UPDATE_TIME
=
new
QueryColumn
(
this
,
"update_time"
);
/**
* 相似词
,以逗号分隔
* 相似词
列表
*/
public
final
QueryColumn
SIMILAR_WORDS
=
new
QueryColumn
(
this
,
"similar_words"
);
...
...
src/main/java/cn/breeze/elleai/infra/entity/table/QaAssistantTableDef.java
View file @
66c3f577
...
...
@@ -55,7 +55,7 @@ public class QaAssistantTableDef extends TableDef {
public
final
QueryColumn
UPDATE_TIME
=
new
QueryColumn
(
this
,
"update_time"
);
/**
* 知识库分类ID
S,以逗号分隔
* 知识库分类ID
列表
*/
public
final
QueryColumn
CATEGORY_IDS
=
new
QueryColumn
(
this
,
"category_ids"
);
...
...
@@ -65,7 +65,7 @@ public class QaAssistantTableDef extends TableDef {
public
final
QueryColumn
DESCRIPTION
=
new
QueryColumn
(
this
,
"description"
);
/**
* 可见角色
IDS,以逗号分隔
* 可见角色
列表
*/
public
final
QueryColumn
VISIBLE_ROLE_IDS
=
new
QueryColumn
(
this
,
"visible_role_ids"
);
...
...
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