package com.controller;

import com.config.BaseController;
import com.config.ControllerInterface;
import com.jfinal.aop.Clear;
import com.model.Dict;
import com.service.DictService;

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

@ControllerInterface(path="/dict")
public class DictController extends BaseController {

    DictService service =DictService.me;

    public void list(){
        Integer type= getParaToInt("type");
        success(service.list(type));
    }

    public void findDict(){
        Map map = new HashMap();
        List<Dict> list0 = service.list(0);
        List<Dict> list1 = service.list(1);
        List<Dict> list2 = service.list(2);
        List<Dict> list3 = service.list(3);
        List<Dict> list4 = service.list(4);
        List<Dict> list5 = service.list(5);
        List<Dict> list6 = service.list(6);
        List<Dict> list7 = service.list(7);
        List<Dict> list8 = service.list(8);
        map.put("list0",list0);
        map.put("list1",list1);
        map.put("list2",list2);
        map.put("list3",list3);
        map.put("list4",list4);
        map.put("list5",list5);
        map.put("list6",list6);
        map.put("list7",list7);
        map.put("list8",list8);
        success(map);
    }
}
