//课程详情页面测试
@RequestMapping(
"
/course
"
)
public String course(Map<String,Object> map){
ResponseEntity<Map> forEntity
=
restTemplate.
getForEntity(
"
http://localhost:31200/course/courseview/4028e581617f945f01617f9dabc4
0000
"
, Map
.class);
Map body
= forEntity
.
getBody();
map
.
put(
"
model
"
,body);
return
"
course
"
;
}
//文件存储2
@Test
public void testStore2() throws FileNotFoundException {
File file
= new File(
"
C:\\Users\\admin\\Desktop\\course.ftl
"
);
FileInputStream inputStream = new FileInputStream(file);
//保存模版文件内容
GridFSFile gridFSFile
=
gridFsTemplate.store(inputStream,
"
课程详情模板文件
"
,
""
);
String fileId
=
gridFSFile.
getId()
.toString();
System.out.
println(fileId);
}
{
"
_class
"
:
"
com.xuecheng
.framework.domain.cms.CmsTemplate
"
,
"
siteId
"
:
"
5a751fab6abb5044e0d19ea1
"
,
"
templateName
"
:
"
课程详情页面正式模板
"
,
"
templateFileId
"
:
"
这里填写上边代码返回的模板文件id
"
}
{
"
_id
"
: ObjectId(
"
5b3469f794db44269cb2bff1
"
),
"
_class
"
:
"
com.xuecheng
.framework.domain.cms.CmsPage
"
,
"
siteId
"
:
"
5a751fab6abb5044e0d19ea1
"
,
"
pageName
"
:
"
4028e581617f945f01617f9dabc40000.html
"
,
"
pageAliase
"
:
"
课程详情页面测试01
"
,
"
pageWebPath
"
:
"
/course/detail/
"
,
"
pagePhysicalPath
"
:
"
/course/detail/
"
,
"
pageType
"
:
"
1
"
,
"
pageCreateTime
"
: ISODate(
"
2018
‐
02
‐
25T01:37:25.974+0000
"
),
"
templateId
"
:
"
5b345a6b94db44269cb2bfec
"
,
"
dataUrl
"
:
"
http://localhost:31200/course/courseview/4028e581617f945f01617f9dabc40000
"
}response.setHeader(
"
Content
‐
type
"
,
"
text/html;charset
=
utf
‐
8
"
);
| 欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |