Search in sources :

Example 1 with AjaxData

use of com.ganster.cms.admin.dto.AjaxData in project Ganster-CMS by Gangster-trio.

the class PermissionController method findSite.

/**
 * 添加权限时,查找所有站点
 *
 * @return AjaxData 查找到的所有站点
 */
@GetMapping("/findsite")
public AjaxData findSite() {
    AjaxData ajaxData = new AjaxData();
    SiteExample siteExample = new SiteExample();
    List<Site> siteList = siteService.selectByExample(siteExample);
    ajaxData.setCode(siteList.size());
    ajaxData.setData((ArrayList) siteList);
    return ajaxData;
}
Also used : AjaxData(com.ganster.cms.admin.dto.AjaxData)

Example 2 with AjaxData

use of com.ganster.cms.admin.dto.AjaxData in project Ganster-CMS by Gangster-trio.

the class UserController method findAllGroup.

/**
 * 查找所有的用户组
 * @return AjaxData  查找到的信息
 */
@GetMapping("/findgroup")
@ResponseBody
public AjaxData findAllGroup() {
    int number = 0;
    AjaxData ajaxData = new AjaxData();
    GroupExample groupExample = new GroupExample();
    groupService.selectByExample(groupExample);
    List<Group> groupList = groupService.selectByExample(groupExample);
    if (groupList != null && !groupList.isEmpty()) {
        ajaxData.setData((ArrayList) groupList);
        for (Group i : groupList) {
            number++;
        }
        ajaxData.setCode(number);
        return ajaxData;
    }
    ajaxData.setMsg("查找失败");
    return ajaxData;
}
Also used : Group(com.ganster.cms.core.pojo.Group) GroupExample(com.ganster.cms.core.pojo.GroupExample) AjaxData(com.ganster.cms.admin.dto.AjaxData)

Example 3 with AjaxData

use of com.ganster.cms.admin.dto.AjaxData in project Ganster-CMS by Gangster-trio.

the class BaseController method buildAjaxData.

AjaxData buildAjaxData(int code, String msg, long count, List data) {
    AjaxData ajaxData = new AjaxData();
    ajaxData.setCode(code);
    ajaxData.setMsg(msg);
    ajaxData.setCount(count);
    ajaxData.setData(data);
    return ajaxData;
}
Also used : AjaxData(com.ganster.cms.admin.dto.AjaxData)

Example 4 with AjaxData

use of com.ganster.cms.admin.dto.AjaxData in project Ganster-CMS by Gangster-trio.

the class PermissionController method findModel.

/**
 * 添加权限时,查找所有模块
 * @return  AjaxData 查找到的所有模块
 */
@GetMapping("/findmodel")
public AjaxData findModel() {
    AjaxData ajaxData = new AjaxData();
    ModuleExample moduleExample = new ModuleExample();
    List<Module> moduleList = moduleService.selectByExample(moduleExample);
    ajaxData.setCode(moduleList.size());
    ajaxData.setData((ArrayList) moduleList);
    return ajaxData;
}
Also used : AjaxData(com.ganster.cms.admin.dto.AjaxData)

Example 5 with AjaxData

use of com.ganster.cms.admin.dto.AjaxData in project Ganster-CMS by Gangster-trio.

the class PermissionController method findCategory.

/**
 * 添加权限时,查找所有栏目
 *
 * @param siteId
 * @return  AjaxData 查找到的所有栏目
 */
@GetMapping("/findcategory/{SiteId}")
public AjaxData findCategory(@PathVariable("SiteId") Integer siteId) {
    AjaxData ajaxData = new AjaxData();
    Site site = siteService.selectByPrimaryKey(siteId);
    CategoryExample categoryExample = new CategoryExample();
    categoryExample.createCriteria().andCategorySiteIdEqualTo(site.getSiteId());
    List<Category> categoryList = categoryService.selectByExample(categoryExample);
    ajaxData.setCode(categoryList.size());
    ajaxData.setData((ArrayList) categoryList);
    return ajaxData;
}
Also used : AjaxData(com.ganster.cms.admin.dto.AjaxData)

Aggregations

AjaxData (com.ganster.cms.admin.dto.AjaxData)8 Group (com.ganster.cms.core.pojo.Group)3 GroupExample (com.ganster.cms.core.pojo.GroupExample)3 ArrayList (java.util.ArrayList)2 GroupWithPermission (com.ganster.cms.admin.dto.GroupWithPermission)1 Permission (com.ganster.cms.core.pojo.Permission)1 PageInfo (com.github.pagehelper.PageInfo)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1