ZhuDongming
2019-10-18 a73c63037e6a5276ce6442873afc627e8cb2c9b0
src/main/java/com/moral/controller/RoleController.java
@@ -1,7 +1,5 @@
package com.moral.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
@@ -13,6 +11,7 @@
import com.moral.common.bean.PageBean;
import com.moral.common.bean.ResultBean;
import com.moral.entity.Role;
import com.moral.service.ChannelService;
import com.moral.service.RoleService;
@RestController
@@ -23,14 +22,24 @@
    @Autowired
    RoleService roleService;
    @Autowired
    ChannelService channelService;
    @GetMapping("count-by-example")
    public ResultBean<Integer> countByExample(PageBean pageBean){
        return  new ResultBean<Integer>(roleService.countByExample(pageBean));
    }
    @GetMapping("page-list")
    public PageBean pageList(PageBean pageBean) {
        return roleService.queryByPageBean(pageBean);
    @GetMapping("role-list")
    public PageBean getRoleList(PageBean pageBean) {
        return roleService.getRoleList(pageBean);
    }
    @GetMapping("channel-list")
    public ResultBean getChannelList(String channelName) {
        ResultBean resultBean = new ResultBean(ResultBean.SUCCESS);
        resultBean.setData(channelService.getChannelList(channelName));
        return resultBean;
    }
    @PostMapping("add-or-modify")
@@ -41,9 +50,10 @@
    }
    @PostMapping("delete-by-ids")
    public ResultBean deleteByIds(@RequestBody List<Integer> ids){
    public ResultBean deleteByIds(@RequestBody Integer [] ids){
        roleService.deleteByIds(ids);
        ResultBean resultBean = new ResultBean(ResultBean.SUCCESS);
        return resultBean;
    }
}