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
224b181a
Commit
224b181a
authored
Oct 17, 2024
by
杨翌文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature: 调整包结构; 管理和移动端分开,AI扩展分开
parent
5b55b410
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
100 additions
and
50 deletions
+100
-50
ChatCompletionController.java
...eze/elleai/controller/admin/ChatCompletionController.java
+3
-3
CommonController.java
...a/cn/breeze/elleai/controller/admin/CommonController.java
+3
-6
ExamineController.java
.../cn/breeze/elleai/controller/admin/ExamineController.java
+3
-3
ExamineQaController.java
...n/breeze/elleai/controller/admin/ExamineQaController.java
+3
-3
ExamineSceneCategoryController.java
...leai/controller/admin/ExamineSceneCategoryController.java
+3
-4
ExamineSceneController.java
...reeze/elleai/controller/admin/ExamineSceneController.java
+3
-4
WikiController.java
...ava/cn/breeze/elleai/controller/admin/WikiController.java
+3
-4
AiPlatformExtensionController.java
...i/controller/extension/AiPlatformExtensionController.java
+20
-0
ChatCompletionMobileController.java
...leai/controller/front/ChatCompletionMobileController.java
+1
-1
ExamineMobileController.java
...eeze/elleai/controller/front/ExamineMobileController.java
+26
-22
UserMobileController.java
.../breeze/elleai/controller/front/UserMobileController.java
+32
-0
No files found.
src/main/java/cn/breeze/elleai/controller/ChatCompletionController.java
→
src/main/java/cn/breeze/elleai/controller/
admin/
ChatCompletionController.java
View file @
224b181a
package
cn
.
breeze
.
elleai
.
controller
;
package
cn
.
breeze
.
elleai
.
controller
.
admin
;
import
cn.breeze.elleai.application.dto.ApiResponse
;
...
...
@@ -22,8 +22,8 @@ import java.util.List;
@RestController
@RequestMapping
(
value
=
"/chat"
)
@Tag
(
name
=
"AI问答相关"
,
description
=
"AI问答相关"
)
@RequestMapping
(
value
=
"/
admin/
chat"
)
@Tag
(
name
=
"
管理端-
AI问答相关"
,
description
=
"AI问答相关"
)
@RequiredArgsConstructor
public
class
ChatCompletionController
{
...
...
src/main/java/cn/breeze/elleai/controller/CommonController.java
→
src/main/java/cn/breeze/elleai/controller/
admin/
CommonController.java
View file @
224b181a
package
cn
.
breeze
.
elleai
.
controller
;
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.response.ProperNounDto
;
import
cn.breeze.elleai.application.dto.response.WikiCategoryDto
;
import
cn.breeze.elleai.application.dto.response.WikiDto
;
import
cn.breeze.elleai.application.service.AppCommonService
;
import
cn.breeze.elleai.application.service.AppExamineService
;
import
cn.breeze.elleai.config.QueryParam
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.media.Schema
;
...
...
@@ -17,8 +14,8 @@ import lombok.RequiredArgsConstructor;
import
org.springframework.web.bind.annotation.*
;
@RestController
@RequestMapping
(
value
=
"/common"
)
@Tag
(
name
=
"公共服务"
,
description
=
"公共服务"
)
@RequestMapping
(
value
=
"/
admin/
common"
)
@Tag
(
name
=
"
管理端-
公共服务"
,
description
=
"公共服务"
)
@RequiredArgsConstructor
public
class
CommonController
{
...
...
src/main/java/cn/breeze/elleai/controller/ExamineController.java
→
src/main/java/cn/breeze/elleai/controller/
admin/
ExamineController.java
View file @
224b181a
package
cn
.
breeze
.
elleai
.
controller
;
package
cn
.
breeze
.
elleai
.
controller
.
admin
;
import
cn.breeze.elleai.application.dto.ApiResponse
;
...
...
@@ -19,8 +19,8 @@ import lombok.RequiredArgsConstructor;
import
org.springframework.web.bind.annotation.*
;
@RestController
@RequestMapping
(
value
=
"/examine"
)
@Tag
(
name
=
"对练"
,
description
=
"对练"
)
@RequestMapping
(
value
=
"/
admin/
examine"
)
@Tag
(
name
=
"
管理端-
对练"
,
description
=
"对练"
)
@RequiredArgsConstructor
public
class
ExamineController
{
...
...
src/main/java/cn/breeze/elleai/controller/ExamineQaController.java
→
src/main/java/cn/breeze/elleai/controller/
admin/
ExamineQaController.java
View file @
224b181a
package
cn
.
breeze
.
elleai
.
controller
;
package
cn
.
breeze
.
elleai
.
controller
.
admin
;
import
cn.breeze.elleai.application.dto.ApiResponse
;
...
...
@@ -18,8 +18,8 @@ import org.springframework.web.bind.annotation.*;
* 对练QA
*/
@RestController
@RequestMapping
(
value
=
"/examine/qa"
)
@Tag
(
name
=
"对练题目"
,
description
=
"对练题目"
)
@RequestMapping
(
value
=
"/
admin/
examine/qa"
)
@Tag
(
name
=
"
管理端-
对练题目"
,
description
=
"对练题目"
)
@RequiredArgsConstructor
public
class
ExamineQaController
{
...
...
src/main/java/cn/breeze/elleai/controller/ExamineSceneCategoryController.java
→
src/main/java/cn/breeze/elleai/controller/
admin/
ExamineSceneCategoryController.java
View file @
224b181a
package
cn
.
breeze
.
elleai
.
controller
;
package
cn
.
breeze
.
elleai
.
controller
.
admin
;
import
cn.breeze.elleai.application.dto.ApiResponse
;
...
...
@@ -8,7 +8,6 @@ import cn.breeze.elleai.application.dto.request.ExamineSceneCategorySaveDto;
import
cn.breeze.elleai.application.dto.response.ExamineSceneCategoryDto
;
import
cn.breeze.elleai.application.service.AppExamineService
;
import
cn.breeze.elleai.config.QueryParam
;
import
cn.breeze.elleai.domain.sparring.model.request.ExamineSceneCategoryRequestModel
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
...
...
@@ -19,8 +18,8 @@ import org.springframework.web.bind.annotation.*;
* 场景分类
*/
@RestController
@RequestMapping
(
value
=
"/examine/scene_category"
)
@Tag
(
name
=
"对练场景分类"
,
description
=
"对练场景分类"
)
@RequestMapping
(
value
=
"/
admin/
examine/scene_category"
)
@Tag
(
name
=
"
管理端-
对练场景分类"
,
description
=
"对练场景分类"
)
@RequiredArgsConstructor
public
class
ExamineSceneCategoryController
{
...
...
src/main/java/cn/breeze/elleai/controller/ExamineSceneController.java
→
src/main/java/cn/breeze/elleai/controller/
admin/
ExamineSceneController.java
View file @
224b181a
package
cn
.
breeze
.
elleai
.
controller
;
package
cn
.
breeze
.
elleai
.
controller
.
admin
;
import
cn.breeze.elleai.application.dto.ApiResponse
;
...
...
@@ -8,7 +8,6 @@ import cn.breeze.elleai.application.dto.request.ExamineSceneSaveDto;
import
cn.breeze.elleai.application.dto.response.ExamineSceneDto
;
import
cn.breeze.elleai.application.service.AppExamineService
;
import
cn.breeze.elleai.config.QueryParam
;
import
cn.breeze.elleai.domain.sparring.model.request.ExamineSceneRequestModel
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
...
...
@@ -19,8 +18,8 @@ import org.springframework.web.bind.annotation.*;
* 场景
*/
@RestController
@RequestMapping
(
value
=
"/examine/scene"
)
@Tag
(
name
=
"对练场景"
,
description
=
"对练场景"
)
@RequestMapping
(
value
=
"/
admin/
examine/scene"
)
@Tag
(
name
=
"
管理端-
对练场景"
,
description
=
"对练场景"
)
@RequiredArgsConstructor
public
class
ExamineSceneController
{
...
...
src/main/java/cn/breeze/elleai/controller/WikiController.java
→
src/main/java/cn/breeze/elleai/controller/
admin/
WikiController.java
View file @
224b181a
package
cn
.
breeze
.
elleai
.
controller
;
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.response.ExamineDto
;
import
cn.breeze.elleai.application.dto.response.WikiCategoryDto
;
import
cn.breeze.elleai.application.dto.response.WikiDto
;
import
cn.breeze.elleai.application.service.AppExamineService
;
...
...
@@ -16,8 +15,8 @@ import lombok.RequiredArgsConstructor;
import
org.springframework.web.bind.annotation.*
;
@RestController
@RequestMapping
(
value
=
"/wiki"
)
@Tag
(
name
=
"资料库"
,
description
=
"资料库"
)
@RequestMapping
(
value
=
"/
admin/
wiki"
)
@Tag
(
name
=
"
管理端-
资料库"
,
description
=
"资料库"
)
@RequiredArgsConstructor
public
class
WikiController
{
...
...
src/main/java/cn/breeze/elleai/controller/extension/AiPlatformExtensionController.java
0 → 100644
View file @
224b181a
package
cn
.
breeze
.
elleai
.
controller
.
extension
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author yangyw
*/
@RestController
@RequestMapping
(
value
=
"/extension"
)
@Tag
(
name
=
"扩展接口-AI平台扩展"
)
@RequiredArgsConstructor
public
class
AiPlatformExtensionController
{
}
src/main/java/cn/breeze/elleai/controller/ChatCompletionMobileController.java
→
src/main/java/cn/breeze/elleai/controller/
front/
ChatCompletionMobileController.java
View file @
224b181a
package
cn
.
breeze
.
elleai
.
controller
;
package
cn
.
breeze
.
elleai
.
controller
.
front
;
import
cn.breeze.elleai.application.dto.ApiResponse
;
...
...
src/main/java/cn/breeze/elleai/controller/ExamineMobileController.java
→
src/main/java/cn/breeze/elleai/controller/
front/
ExamineMobileController.java
View file @
224b181a
package
cn
.
breeze
.
elleai
.
controller
;
package
cn
.
breeze
.
elleai
.
controller
.
front
;
import
cn.breeze.elleai.application.dto.ApiResponse
;
...
...
@@ -7,61 +7,65 @@ import cn.breeze.elleai.application.dto.request.*;
import
cn.breeze.elleai.application.dto.response.*
;
import
cn.breeze.elleai.application.service.AppExamineService
;
import
cn.breeze.elleai.config.QueryParam
;
import
cn.breeze.elleai.util.UserPrincipal
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.UUID
;
@RestController
@RequestMapping
(
value
=
"/front/examine"
)
@Tag
(
name
=
"
AI对练移动端
"
)
@Tag
(
name
=
"
移动端-AI对练
"
)
@RequiredArgsConstructor
public
class
ExamineMobileController
{
private
final
AppExamineService
examineService
;
@Operation
(
summary
=
"对练场景列表"
)
@Operation
(
summary
=
"
获取
对练场景列表"
)
@GetMapping
(
"/scene/list"
)
public
ApiResponse
<
PageResult
<
ExamineSceneDto
>>
list
(
@QueryParam
ExamineSceneRequestDto
request
)
{
PageResult
<
ExamineSceneDto
>
pageResult
=
examineService
.
examineMobileScenePaginQuery
(
request
);
return
ApiResponse
.
ok
(
pageResult
);
}
@Operation
(
summary
=
"
对练场景分类列表
"
)
@Operation
(
summary
=
"
获取对练场景分类列表(需要过滤角色)
"
)
@GetMapping
(
"/scene_category/list"
)
public
ApiResponse
<
PageResult
<
ExamineSceneCategoryDto
>>
list
(
@QueryParam
ExamineSceneCategoryRequestDto
request
)
{
public
ApiResponse
<
PageResult
<
ExamineSceneCategoryDto
>>
list
(
@Parameter
(
hidden
=
true
)
UserPrincipal
userPrincipal
,
@QueryParam
ExamineSceneCategoryRequestDto
request
)
{
PageResult
<
ExamineSceneCategoryDto
>
pageResult
=
examineService
.
examineSceneCategoryMobilePaginQuery
(
request
);
return
ApiResponse
.
ok
(
pageResult
);
}
@Operation
(
summary
=
"
对练列表
"
)
@Operation
(
summary
=
"
获取对练列表(分类+名称搜索)
"
)
@GetMapping
(
"/list"
)
public
ApiResponse
<
PageResult
<
ExamineMobileDto
>>
list
(
@QueryParam
ExamineRequestDto
request
)
{
public
ApiResponse
<
PageResult
<
ExamineMobileDto
>>
list
(
@Parameter
(
hidden
=
true
)
UserPrincipal
userPrincipal
,
@QueryParam
ExamineRequestDto
request
)
{
PageResult
<
ExamineMobileDto
>
pageResult
=
examineService
.
examineMobilePaginQuery
(
request
);
return
ApiResponse
.
ok
(
pageResult
);
}
@Operation
(
summary
=
"
对练详情
"
)
@Operation
(
summary
=
"
获取对练详情(根据对练ID)
"
)
@GetMapping
(
"/detail/{id}"
)
public
ApiResponse
<
ExamineMobileDto
>
detail
(
@Schema
(
description
=
"对练ID"
)
@PathVariable
(
"id"
)
Integer
id
)
{
ExamineMobileDto
detail
=
examineService
.
examineMobileDetail
(
id
);
return
ApiResponse
.
ok
(
detail
);
}
@Operation
(
summary
=
"用户对练记录列表"
)
@Operation
(
summary
=
"
获取
用户对练记录列表"
)
@GetMapping
(
"/record/list"
)
public
ApiResponse
<
PageResult
<
ExamineRecordMobileDto
>>
recordList
(
@RequestParam
(
"user_id"
)
String
userId
,
@QueryParam
ExamineRecordRequestDto
request
)
{
request
.
setUserId
(
user
Id
);
public
ApiResponse
<
PageResult
<
ExamineRecordMobileDto
>>
recordList
(
@Parameter
(
hidden
=
true
)
UserPrincipal
userPrincipal
,
@QueryParam
ExamineRecordRequestDto
request
)
{
request
.
setUserId
(
user
Principal
.
getUserId
()
);
PageResult
<
ExamineRecordMobileDto
>
pageResult
=
examineService
.
examineRecordMobilePaginQuery
(
request
);
return
ApiResponse
.
ok
(
pageResult
);
}
@Operation
(
summary
=
"用户对练记录详情"
)
@Operation
(
summary
=
"
获取
用户对练记录详情"
)
@GetMapping
(
"/record/detail/{id}"
)
public
ApiResponse
<
ExamineRecordMobileDto
>
recordDetail
(
@Schema
(
description
=
"对练记录ID"
)
@PathVariable
(
"id"
)
Integer
id
)
{
ExamineRecordMobileDto
detail
=
examineService
.
examineRecordMobileDetail
(
id
);
...
...
@@ -86,8 +90,8 @@ public class ExamineMobileController {
return
ApiResponse
.
ok
(
result
);
}
@Operation
(
summary
=
"开始考试
,获取出题
"
)
@
GetMapping
(
value
=
"/get_question
"
)
@Operation
(
summary
=
"开始考试"
)
@
PostMapping
(
value
=
"/start_examine
"
)
public
ApiResponse
<
ExamineQaDifyDto
>
getQuestion
(
@Schema
(
description
=
"对练ID"
)
@RequestParam
(
"examine_id"
)
Integer
examineId
,
@Schema
(
description
=
"对练模式(0练习 1对练)"
)
@RequestParam
(
"examine_mode"
)
Integer
examineMode
,
@Schema
(
description
=
"用户ID"
)
@RequestParam
(
"user_id"
)
String
userId
)
{
...
...
@@ -96,8 +100,8 @@ public class ExamineMobileController {
return
ApiResponse
.
ok
(
result
);
}
@Operation
(
summary
=
"
更新题目
"
)
@PostMapping
(
value
=
"
update_question
"
)
@Operation
(
summary
=
"
考试答题
"
)
@PostMapping
(
value
=
"
submit_answer
"
)
public
ApiResponse
<
String
>
updateQuestion
(
@Schema
(
description
=
"考试记录ID"
)
@RequestParam
(
"record_id"
)
Integer
recordId
,
@Schema
(
description
=
"题目ID"
)
@RequestParam
(
"question_id"
)
Long
questionId
,
@Schema
(
description
=
"用户答案"
)
@RequestParam
(
value
=
"answer"
,
required
=
false
)
String
answer
,
...
...
@@ -220,8 +224,8 @@ public class ExamineMobileController {
* @param request
* @return
*/
@Operation
(
summary
=
"
更新最终考试结果
"
)
@PostMapping
(
value
=
"/
update_exam_result
"
)
@Operation
(
summary
=
"
完成考试(触发最终结果更新)
"
)
@PostMapping
(
value
=
"/
complete_examine
"
)
public
ApiResponse
<
String
>
updateExamResult
(
@RequestBody
ExamineUpdateResultDto
request
)
{
return
ApiResponse
.
ok
(
"SUCCESS"
);
...
...
src/main/java/cn/breeze/elleai/controller/UserMobileController.java
→
src/main/java/cn/breeze/elleai/controller/
front/
UserMobileController.java
View file @
224b181a
package
cn
.
breeze
.
elleai
.
controller
;
package
cn
.
breeze
.
elleai
.
controller
.
front
;
import
cn.breeze.elleai.application.dto.ApiResponse
;
import
cn.breeze.elleai.
application.dto.response.ExamineSceneDto
;
import
cn.breeze.elleai.
util.UserPrincipal
;
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.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
value
=
"/front/user"
)
@Tag
(
name
=
"
用户移动端
"
)
@Tag
(
name
=
"
移动端-用户&授权
"
)
@RequiredArgsConstructor
public
class
UserMobileController
{
@Operation
(
summary
=
"获取token"
)
@GetMapping
(
"/get_token"
)
public
ApiResponse
<
String
>
getToken
()
{
return
ApiResponse
.
ok
(
"ok"
);
//todo 移除mock数据,通过cookie获取返回
return
ApiResponse
.
ok
(
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqb2JUaXRsZSI6IuengeS6uumhvumXriIsImlzcyI6Im9zcyIsInNob3BOYW1lIjoi5p2P5Z2b5a6P5rGH5Z-O5bqXIiwicG9zaXRpb24iOiLpob7pl64iLCJzaG9wSWQiOiIwMDAwMDAwMDZlODY2OTVlMDE2ZTg2ZDJiYTkyMDAwOCIsInVzZXJOYW1lIjoiTTAwODg3NyIsImV4cCI6MTgxMTY3NDQ5NCwidXNlcklkIjoiMDAwMDAwMDA2MmQ3NWRiNTAxNjJkNzc1YjYxOTAwMGEifQ.4XCYKRVuHTaP3TYob7O31bpPnhoBQ9XSq1inM93IqYE"
);
}
@Operation
(
summary
=
"获取用户信息"
)
@GetMapping
(
"/info"
)
public
ApiResponse
<
UserPrincipal
>
getUserInfo
(
UserPrincipal
userPrincipal
)
{
return
ApiResponse
.
ok
(
userPrincipal
);
}
}
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