预览按钮发送请求 到内容管理服务
    内容管理服务调取系统管理服务的大小分类数据
    内容管理服务内部 把所有数据 组合到一个课程发布数据库中
    然后从课程发布数据库中 获取数据 生成数据模型map
    使用controller组装数据模型和模板 并响应到前端
    项目中使用Freemarker技术 动态生成预览资源 - 图1

    在@RestController注解下 需要先new ModelAndView() 参数为模板文件名和数据模型map 就可以直接把这个ModelAndView类型 直接返回
    此返回不会走json 而是响应的 数据模型和视图对象

    1. @Slf4j
    2. @RestController
    3. @RequestMapping("coursePub")
    4. public class CoursePubController implements CoursePubApi {
    5. @Autowired
    6. private CoursePubService coursePubService;
    7. @Override
    8. @GetMapping("course/preview/{courseBaseId}/{companyId}")
    9. public Object previewCourse(@PathVariable Long courseBaseId,@PathVariable Long companyId) {
    10. Map<String,Object> map=coursePubService.generateDataMap(courseBaseId,companyId);
    11. ModelAndView modelAndView = new ModelAndView("learing_article",map);
    12. return modelAndView;
    13. }
    14. }