package com.zcloud.controller.depository;

import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.PageData;
import com.zcloud.service.depository.TermLibraryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/labelFactory")
public class TermLibraryController extends BaseController {

    @Autowired
    private TermLibraryService termLibraryService;

    @RequestMapping(value = "/termList")
    @ResponseBody
    public Object list() throws Exception {
        Map<String, Object> map = new HashMap<String, Object>();
        String errInfo = "success";
        PageData pd = new PageData();
        pd = this.getPageData();
        List<PageData> varList = termLibraryService.listAll(pd);    //列出LabelFacory列表
        map.put("varList", varList);
        map.put("result", errInfo);
        return map;
    }
}
