Search in sources :

Example 1 with Example

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

the class UacMenuCommonController method checkUacMenuName.

/**
 * 检测菜单名称唯一性
 *
 * @param uacMenuCheckNameDto the uac menu check name dto
 *
 * @return the wrapper
 */
@PostMapping(value = "/checkMenuName")
@ApiOperation(httpMethod = "POST", value = "检测菜单名称唯一性")
public Wrapper<Boolean> checkUacMenuName(@ApiParam(name = "uacMenuCheckNameDto", value = "id与name") @RequestBody UacMenuCheckNameDto uacMenuCheckNameDto) {
    logger.info("校验菜单名称唯一性 uacMenuCheckNameDto={}", uacMenuCheckNameDto);
    Long id = uacMenuCheckNameDto.getMenuId();
    Long pid = uacMenuCheckNameDto.getPid();
    String menuName = uacMenuCheckNameDto.getMenuName();
    Example example = new Example(UacMenu.class);
    Example.Criteria criteria = example.createCriteria();
    if (id != null) {
        criteria.andNotEqualTo("id", id);
    }
    criteria.andEqualTo("menuName", menuName);
    criteria.andEqualTo("pid", pid);
    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)

Example 2 with Example

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

the class UacMenuCommonController method checkUacMenuActionCode.

/**
 * 检测菜单编码是否已存在
 *
 * @param uacMenuCheckCodeDto the uac menu check code dto
 *
 * @return the wrapper
 */
@PostMapping(value = "/checkMenuCode")
@ApiOperation(httpMethod = "POST", value = "检测菜单编码是否已存在")
public Wrapper<Boolean> checkUacMenuActionCode(@ApiParam(name = "uacMenuCheckCodeDto", value = "id与url") @RequestBody UacMenuCheckCodeDto uacMenuCheckCodeDto) {
    logger.info("校验菜单编码唯一性 uacMenuCheckCodeDto={}", uacMenuCheckCodeDto);
    Long id = uacMenuCheckCodeDto.getMenuId();
    String menuCode = uacMenuCheckCodeDto.getMenuCode();
    Example example = new Example(UacMenu.class);
    Example.Criteria criteria = example.createCriteria();
    if (id != null) {
        criteria.andNotEqualTo("id", id);
    }
    criteria.andEqualTo("menuCode", menuCode);
    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)

Example 3 with Example

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

the class UacUserCommonController method checkUserName.

/**
 * 校验真实姓名唯一性.
 *
 * @param checkUserNameDto the check user name dto
 *
 * @return the wrapper
 */
@PostMapping(value = "/checkUserName")
@ApiOperation(httpMethod = "POST", value = "校验真实姓名唯一性")
public Wrapper<Boolean> checkUserName(@ApiParam(name = "checkUserNameDto", value = "校验真实姓名唯一性Dto") @RequestBody CheckUserNameDto checkUserNameDto) {
    logger.info(" 校验真实姓名唯一性 checkUserNameDto={}", checkUserNameDto);
    Long id = checkUserNameDto.getUserId();
    String name = checkUserNameDto.getUserName();
    Example example = new Example(UacUser.class);
    Example.Criteria criteria = example.createCriteria();
    criteria.andEqualTo("userName", name);
    if (id != null) {
        criteria.andNotEqualTo("id", id);
    }
    int result = uacUserService.selectCountByExample(example);
    return WrapMapper.ok(result < 1);
}
Also used : Example(tk.mybatis.mapper.entity.Example) ApiOperation(io.swagger.annotations.ApiOperation)

Example 4 with Example

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

the class UacUserCommonController method checkLoginName.

/**
 * 校验登录名唯一性.
 *
 * @param checkLoginNameDto the check login name dto
 *
 * @return the wrapper
 */
@PostMapping(value = "/checkLoginName")
@ApiOperation(httpMethod = "POST", value = "校验登录名唯一性")
public Wrapper<Boolean> checkLoginName(@ApiParam(name = "loginName", value = "登录名") @RequestBody CheckLoginNameDto checkLoginNameDto) {
    logger.info("校验登录名唯一性 checkLoginNameDto={}", checkLoginNameDto);
    Long id = checkLoginNameDto.getUserId();
    String loginName = checkLoginNameDto.getLoginName();
    Example example = new Example(UacUser.class);
    Example.Criteria criteria = example.createCriteria();
    criteria.andEqualTo("loginName", loginName);
    if (id != null) {
        criteria.andNotEqualTo("id", id);
    }
    int result = uacUserService.selectCountByExample(example);
    return WrapMapper.ok(result < 1);
}
Also used : Example(tk.mybatis.mapper.entity.Example) ApiOperation(io.swagger.annotations.ApiOperation)

Example 5 with Example

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

the class UacUserCommonController method checkEmail.

/**
 * 校验登录名唯一性.
 *
 * @param checkEmailDto the check email dto
 *
 * @return the wrapper
 */
@PostMapping(value = "/checkEmail")
@ApiOperation(httpMethod = "POST", value = "校验登录名唯一性")
public Wrapper<Boolean> checkEmail(@RequestBody CheckEmailDto checkEmailDto) {
    logger.info("校验邮箱唯一性 checkEmailDto={}", checkEmailDto);
    Long id = checkEmailDto.getUserId();
    String email = checkEmailDto.getEmail();
    Example example = new Example(UacUser.class);
    Example.Criteria criteria = example.createCriteria();
    criteria.andEqualTo("email", email);
    if (id != null) {
        criteria.andNotEqualTo("id", id);
    }
    int result = uacUserService.selectCountByExample(example);
    return WrapMapper.ok(result < 1);
}
Also used : Example(tk.mybatis.mapper.entity.Example) 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