Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
K
know-base
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
张京坤
know-base
Commits
d249a134
提交
d249a134
authored
1月 16, 2024
作者:
ZhangJingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
在线编辑 zhangjingkun
上级
1f0e1d04
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
44 行增加
和
6 行删除
+44
-6
KbFileController.java
...n/java/com/zzsn/knowbase/controller/KbFileController.java
+22
-6
editor.html
src/main/resources/templates/editor.html
+22
-0
没有找到文件。
src/main/java/com/zzsn/knowbase/controller/KbFileController.java
浏览文件 @
d249a134
package
com
.
zzsn
.
knowbase
.
controller
;
package
com
.
zzsn
.
knowbase
.
controller
;
import
com.zzsn.knowbase.entity.Knowledge
;
import
com.zzsn.knowbase.service.IKnowledgeService
;
import
com.zzsn.knowbase.service.ILocalFileService
;
import
com.zzsn.knowbase.service.ILocalFileService
;
import
com.zzsn.knowbase.vo.Result
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -20,13 +24,13 @@ import java.io.IOException;
...
@@ -20,13 +24,13 @@ import java.io.IOException;
*/
*/
//@RestController
//@RestController
@Controller
@Controller
//
@RequestMapping("/api/file")
@RequestMapping
(
"/api/file"
)
public
class
KbFileController
{
public
class
KbFileController
{
@Autowired
@Autowired
private
ILocalFileService
localFileService
;
private
ILocalFileService
localFileService
;
@Autowired
private
IKnowledgeService
knowledgeService
;
/**
/**
* 下载文档接口
* 下载文档接口
...
@@ -37,9 +41,6 @@ public class KbFileController {
...
@@ -37,9 +41,6 @@ public class KbFileController {
@GetMapping
(
"/download"
)
@GetMapping
(
"/download"
)
public
void
download
(
String
fileName
,
String
filePath
,
HttpServletResponse
response
)
{
public
void
download
(
String
fileName
,
String
filePath
,
HttpServletResponse
response
)
{
// fileName = "abc.docx";
// filePath = "20240111/24011100000006.docx";
localFileService
.
download
(
fileName
,
filePath
,
response
);
localFileService
.
download
(
fileName
,
filePath
,
response
);
}
}
...
@@ -70,4 +71,19 @@ public class KbFileController {
...
@@ -70,4 +71,19 @@ public class KbFileController {
}
}
/**
* 临时保存,保存并审核通过, 保存并审核不通过
* @param request
* @param knowledge
* @return
*/
@PostMapping
(
value
=
"/editKnowledge"
)
public
Result
<?>
editKnowledge
(
HttpServletRequest
request
,
Knowledge
knowledge
)
{
//knowledgeService.addKnowledge();
return
null
;
}
}
}
src/main/resources/templates/editor.html
0 → 100644
浏览文件 @
d249a134
<!DOCTYPE html>
<html
xmlns:th=
"http://www.thymeleaf.org"
lang=
"zh-CN"
>
<head>
<title
th:text=
"${document.title}"
></title>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<link
rel=
"stylesheet"
type=
"text/css"
th:href=
"@{/css/viewer.css}"
>
</head>
<body>
<div
class=
"form"
>
<div
id=
"iframeEditor"
></div>
</div>
<script
type=
"text/javascript"
th:src=
"@{/js/jquery-1.8.2.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{${documentServerApiJs}}"
></script>
<script
type=
"text/javascript"
th:src=
"@{/js/editor.js}"
></script>
<!-- 先通过 th:inline=“javascript” 添加到标签,这样js代码即可访问model中的属性 -->
<script
th:inline=
"javascript"
>
// js 中可以通过“[[${xxx}]]” 格式获得实际的值
Editor
.
init
([[
$
{
document
}]],
[[
$
{
documentEditParam
}]]);
</script>
</body>
</html>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论