public static void main(String[] args) {
    int max = Page.getNowMaxPage();

    int page = 1;

    do {
      Page p = Page.getByPage(page);

      List<Item> items = Item.get(p.get$items());

      for (Item item : items) {
        item.setContent("");
      }

      AjaxResponse<List<Item>> ar = new AjaxResponse<List<Item>>();

      ar.setIsok(true);
      ar.setData(items);

      String data = ar.toJson();

      InputStream in;
      try {
        in = new ByteArrayInputStream(data.getBytes("utf-8"));

        OssUtil.uploadToNigeerhuo(UrlRoute.OSS_STATIC.getUrl() + "pages/" + page + ".json", in);

      } catch (Exception e) {
        System.out.println(e.getMessage());
      }
    } while (++page <= max);
  }
Exemplo n.º 2
0
  private static void do1() {
    int maxPage = Page.getNowMaxPage();
    int limit = 20;

    int page = 1;
    List<Item> items = new ArrayList<Item>();

    do {
      items = Page.getPage(page);

      for (Item item : items) {

        item.generateType();
      }

    } while (++page <= 2);
  }
Exemplo n.º 3
0
  private static void do2() {
    Item item = new Item();

    item.load(1471);
    item.generateType();
  }