| package com.matrix.system.hive.action; | 
|   | 
| import com.matrix.core.anotations.RemoveRequestToken; | 
| import com.matrix.core.anotations.SaveRequestToken; | 
| import com.matrix.core.pojo.AjaxResult; | 
| import com.matrix.core.pojo.PaginationVO; | 
| import com.matrix.core.tools.WebUtil; | 
| import com.matrix.system.hive.bean.MyBeatician; | 
| import com.matrix.system.hive.service.MyBeaticianService; | 
| import org.springframework.stereotype.Controller; | 
| import org.springframework.web.bind.annotation.RequestMapping; | 
| import org.springframework.web.bind.annotation.ResponseBody; | 
|   | 
| import javax.annotation.Resource; | 
|   | 
| /** | 
|  * | 
|  * @date 2016-12-07 12:02 | 
|  */ | 
| @Controller | 
| @RequestMapping(value = "admin/myBeatician") | 
| public class MyBeaticianController extends BaseController{ | 
|   | 
|     @Resource | 
|     private MyBeaticianService currentService; | 
|      | 
|   | 
|   | 
|      | 
|     public static final String fnCode = "myBeatician"; | 
|     public static final String search = fnCode + ":search"; | 
|     public static final String edit = fnCode + ":edit"; | 
|     public static final String del = fnCode + ":del"; | 
|     public static final String add = fnCode + ":add"; | 
|     /** | 
|      * 列表显示 | 
|      */ | 
|     @RequestMapping(value = "/showList") | 
|     public @ResponseBody AjaxResult showList(MyBeatician myBeatician, PaginationVO pageVo) { | 
|   | 
|         return showList(currentService, myBeatician, pageVo); | 
|     } | 
|         | 
|     /** | 
|      * 新增或者修改页面 | 
|      */    | 
|     @RemoveRequestToken     | 
|        @RequestMapping(value = "/addOrModify") | 
|     public @ResponseBody AjaxResult addOrModify(MyBeatician myBeatician) { | 
|         if (myBeatician.getId() != null) { | 
|   | 
|             return modify(currentService, myBeatician, "myBeatician"); | 
|         } else { | 
|   | 
|             return add(currentService, myBeatician, "myBeatician"); | 
|         } | 
|     } | 
|      | 
|        /** | 
|      * 进入修改界面 | 
|      */    | 
|     @SaveRequestToken | 
|        @RequestMapping(value = "/editForm") | 
|     public String editForm(Long id) { | 
|         MyBeatician myBeatician; | 
|         if (id != null) { | 
|             myBeatician = currentService.findById(id); | 
|             WebUtil.getRequest().setAttribute("obj", myBeatician); | 
|         } | 
|         return "admin/hive/myBeatician-form"; | 
|     } | 
|         | 
|         | 
|        /** | 
|      * 删除 | 
|      */   | 
|      @RequestMapping(value = "/del") | 
|     public @ResponseBody AjaxResult del(String keys) { | 
|   | 
|         return remove(currentService, keys); | 
|     } | 
|    | 
| } |