| package com.xzx.gc.role.controller; | 
|   | 
|   | 
| import com.xzx.gc.common.constant.Constants; | 
| import com.xzx.gc.entity.CoreDict; | 
| import com.xzx.gc.model.JsonResult; | 
| import com.xzx.gc.role.service.CoreDictService; | 
| import com.xzx.gc.role.service.CorePlatformService; | 
| import org.apache.commons.logging.Log; | 
| import org.apache.commons.logging.LogFactory; | 
| 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.List; | 
|   | 
| @Controller | 
| @SuppressWarnings("unchecked") | 
| public class CoreDictController { | 
|     private final Log log = LogFactory.getLog(this.getClass()); | 
|   | 
|     @Autowired | 
|     CorePlatformService platformService; | 
|   | 
|     @Autowired | 
|     CoreDictService dictService; | 
|   | 
|   | 
|   | 
|     /** | 
|      * 查看字典类型对应的列表 | 
|      * @param type | 
|      * @return | 
|      */ | 
|     @RequestMapping(Constants.ADMIN_VIEW_PREFIX + "/core/dict/view.json") | 
|     @ResponseBody | 
|     public JsonResult<List<CoreDict>> view(String type) { | 
|         List<CoreDict> list = dictService.findAllByType(type); | 
|         return  JsonResult.success(list); | 
|     } | 
|      | 
|     /** | 
|      * 查看字典值的子字典 | 
|      * @param value | 
|      * @return | 
|      */ | 
|    | 
|     @RequestMapping(Constants.ADMIN_VIEW_PREFIX + "/core/dict/viewChildren.json") | 
|     @ResponseBody | 
|     public JsonResult<List<CoreDict>> viewChild(String group,String value) { | 
|         CoreDict dict = dictService.findCoreDict(group,value); | 
|         List<CoreDict> list = dictService.findChildByParent(dict.getId()); | 
|         return  JsonResult.success(list); | 
|     } | 
|      | 
|      | 
|   | 
| } |