易课寄在线购课系统开发笔记(十五)--完成购课系统门户的工程搭建

本文档详细记录了易课寄在线购课系统门户的工程搭建过程,参照了先前的后台管理系统工程搭建,并分析了购课系统门户首页的功能。首页的请求URL为/index,无额外参数,通过web.xml配置的欢迎页http://localhost:8082/index.html进行展示,返回逻辑视图。
摘要由CSDN通过智能技术生成

购课系统门户首页

工程搭建

可以参考

易课寄在线购课系统开发笔记(七)–后台管理系统工程搭建分析

ecourses-bms-web 工程的搭建过程。

功能分析

请求的 url:/index

web.xml 中的欢迎页配置

<welcome-file-list>
    <welcome-file>index.html</welcome-file>
</welcome-file-list>

http://localhost:8082/index.html

参数:没有

返回值:String 逻辑视图

package cn.ecourses.portal.controller;
//首页展示Controller
@Controller
public class IndexController {

	@Value("${CONTENT_BIGAD_ID}")
	private Long CONTENT_BIGAD_ID;
	@Value("${CONTENT_MINIAD_ID}")
	private Long CONTENT_MINIAD_ID;
	@Value("${CONTENT_BESTUP_ID}")
	private Long CONTENT_BESTUP_ID;
	@Value("${CONTENT_BESTDOWN_ID}")
	private Long CONTENT_BESTDOWN_ID;
	@Value("${CONTENT_CHEAPLEFT_ID}")
	private Long CONTENT_CHEAPLEFT_ID;
	@Value("${CONTENT_CHEAPLIST_ID}")
	private Long CONTENT_CHEAPLIST_ID;
	@Value("${CONTENT_MINITITLELIST_ID}")
	private Long CONTENT_MINITITLELIST_ID;
	@Value("${CONTENT_NEWS_ID}")
	private Long CONTENT_NEWS_ID;
	
	@Autowired
	private ContentService contentService;

	@RequestMapping("/index")
	public String showIndex(Model model) {
		//查询内容列表
		List<EcoursesContent> bigAdList = contentService.getContentListByCid(CONTENT_BIGAD_ID);
		List<EcoursesContent> smallAdList = contentService.getContentListByCid(CONTENT_MINIAD_ID);
		List<EcoursesContent> bestUpList = contentService.getContentListByCid(CONTENT_BESTUP_ID);
		List<EcoursesContent> bestDownList = contentService.getContentListByCid(CONTENT_BESTDOWN_ID);
		List<EcoursesContent> cheapLeftList = contentService.getContentListByCid(CONTENT_CHEAPLEFT_ID);
		List<EcoursesContent> cheapList = contentService.getContentListByCid(CONTENT_CHEAPLIST_ID);
		List<EcoursesContent> miniTitleList = contentService.getContentListByCid(CONTENT_MINITITLELIST_ID);
		List<EcoursesContent> newsList = contentService.getContentListByCid(CONTENT_NEWS_ID);
		// 把结果传递给页面
		model.addAttribute("bigAdList", bigAdList);
		model.addAttribute("smallAdList", smallAdList);
		model.addAttribute("bestUpList", bestUpList);
		model.addAttribute("bestDownList", bestDownList);
		model.addAttribute("cheapLeftList", cheapLeftList);
		model.addAttribute("cheapList", cheapList);
		model.addAttribute("miniTitleList", miniTitleList);
		model.addAttribute("newsList", newsList);
		return "index";
	}
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值