Search in sources :

Example 16 with Example

use of tk.mybatis.mapper.entity.Example in project paascloud-master by paascloud.

the class UacMenuCommonController method checkUacMenuUrl.

/**
 * 检测菜单URL唯一性
 *
 * @param uacMenuCheckUrlDto the uac menu check url dto
 *
 * @return the wrapper
 */
@PostMapping(value = "/checkMenuUrl")
@ApiOperation(httpMethod = "POST", value = "检测菜单URL唯一性")
public Wrapper<Boolean> checkUacMenuUrl(@ApiParam(name = "uacMenuCheckUrlDto", value = "id与url") @RequestBody UacMenuCheckUrlDto uacMenuCheckUrlDto) {
    logger.info("检测菜单URL唯一性 uacMenuCheckUrlDto={}", uacMenuCheckUrlDto);
    Long id = uacMenuCheckUrlDto.getMenuId();
    String url = uacMenuCheckUrlDto.getUrl();
    Example example = new Example(UacMenu.class);
    Example.Criteria criteria = example.createCriteria();
    if (id != null) {
        criteria.andNotEqualTo("id", id);
    }
    criteria.andEqualTo("url", url);
    int result = uacMenuService.selectCountByExample(example);
    return WrapMapper.ok(result < 1);
}
Also used : Example(tk.mybatis.mapper.entity.Example) PostMapping(org.springframework.web.bind.annotation.PostMapping) ApiOperation(io.swagger.annotations.ApiOperation)

Aggregations

Example (tk.mybatis.mapper.entity.Example)16 ApiOperation (io.swagger.annotations.ApiOperation)15 PostMapping (org.springframework.web.bind.annotation.PostMapping)8 MqMessageData (com.paascloud.provider.model.domain.MqMessageData)1 UacBizException (com.paascloud.provider.model.exceptions.UacBizException)1 Date (java.util.Date)1