@SuppressWarnings("unchecked")
public void execute(Environment env, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body) throws TemplateException, IOException {
String goodsId = DirectiveUtil.getStringParameter(GOODS_ID_PARAMETER_NAME, params);
Integer count = DirectiveUtil.getIntegerParameter(COUNT_PARAMETER_NAME, params);
Goods goods = null;
if (StringUtils.isNotEmpty(goodsId)) {
goods = goodsService.load(goodsId);
}
List<Comment> commentList = commentService.getCommentList(goods, count);
if (body != null && commentList != null) {
if (loopVars.length > 0) {
loopVars[0] = ObjectWrapper.BEANS_WRAPPER.wrap(commentList);
}
body.render(env.getOut());
}
}
CommentListDirective.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:SelfSoftShop
作者:
评论列表
文章目录