Java


import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ftsafe.itd.item.ItemsService;
import com.ftsafe.itd.pojo.Items;
import com.ftsafe.itd.service.DataInitService;

@Service("dataInitService")
public class DataInitImpl implements DataInitService {

    @Autowired
    private ItemsService itemsService;

    public boolean itemsDataInit() {
        List<Items> ItemsList= new ArrayList<Items>();
        Items items1 = new Items();
        items1.setName("电脑");
        items1.setCounts(100);
        ItemsList.add(items1);

        Items items2 = new Items();
        items2.setName("笔记本");
        items2.setCounts(100);
        ItemsList.add(items2);

        Items items3 = new Items();
        items3.setName("打印机");
        items3.setCounts(100);
        ItemsList.add(items3);
        itemsService.dataInit(ItemsList);

        return true;
    }

}

JSon - package.json

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "hexo": {
    "version": ""
  },
  "dependencies": {
    "hexo": "^3.8.0",
    "hexo-generator-archive": "^0.1.5",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-index": "^0.2.1",
    "hexo-generator-tag": "^0.2.0",
    "hexo-renderer-ejs": "^0.3.1",
    "hexo-renderer-stylus": "^0.3.3",
    "hexo-renderer-marked": "^0.3.2",
    "hexo-server": "^0.3.3"
  }
}