类 PublishCategoryDirective

所有已实现的接口:
Directive, HttpDirective, freemarker.template.TemplateDirectiveModel, freemarker.template.TemplateModel

@Component public class PublishCategoryDirective extends AbstractTaskDirective
publishCategory 发布分类静态页面指令

参数列表

  • id:分类id
  • ids:多个分类id
  • pageIndex:当前页码,默认值1
  • totalPage:最大页码,为空时则只生成当前页

返回结果

  • mapmap类型,键值内容id,值为生成结果

使用示例

<@task.publishCategory id=1><#list map as k,v>${k}:${v}<#sep>,</#list></@task.publishCategory>

<script>
 fetch('${site.dynamicPath}api/directive/task/publishCategory?id=1',{"headers":{"appToken":"接口访问授权Token"}}).then(res => res.json()).then(data=>{
   console.log(data);
 });
 </script>
 
  • 字段详细资料

  • 构造器详细资料

    • PublishCategoryDirective

      public PublishCategoryDirective()
  • 方法详细资料

    • execute

      public void execute(RenderHandler handler) throws IOException, freemarker.template.TemplateException
      参数:
      handler -
      抛出:
      IOException
      freemarker.template.TemplateException