Search in sources :

Example 31 with PostMapping

use of org.springframework.web.bind.annotation.PostMapping 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 32 with PostMapping

use of org.springframework.web.bind.annotation.PostMapping in project paascloud-master by paascloud.

the class EmailController method checkRestEmailCode.

/**
 * 校验短信验证码.
 *
 * @param sendEmailMessage the send email message
 *
 * @return the wrapper
 */
@PostMapping(value = "/checkRestEmailCode")
@ApiOperation(httpMethod = "POST", value = "校验充值密码邮件验证码")
public Wrapper checkRestEmailCode(@ApiParam(value = "验证信息") @RequestBody SendEmailMessage sendEmailMessage) {
    logger.info("校验短信验证码, checkRestEmailCode={}", sendEmailMessage);
    LoginAuthDto loginAuthDto = this.getLoginAuthDto();
    emailService.checkEmailCode(sendEmailMessage, loginAuthDto.getLoginName());
    return WrapMapper.ok();
}
Also used : LoginAuthDto(com.paascloud.base.dto.LoginAuthDto) PostMapping(org.springframework.web.bind.annotation.PostMapping) ApiOperation(io.swagger.annotations.ApiOperation)

Example 33 with PostMapping

use of org.springframework.web.bind.annotation.PostMapping in project paascloud-master by paascloud.

the class UacActionCommonController method checkActionCode.

/**
 * 检测权限编码是否已存在
 *
 * @param uacActionCheckCodeDto the uac action check code dto
 *
 * @return the wrapper
 */
@PostMapping(value = "/checkActionCode")
@ApiOperation(httpMethod = "POST", value = "检测权限编码是否已存在")
public Wrapper<Boolean> checkActionCode(@ApiParam(name = "uacActionCheckCodeDto", value = "id与url") @RequestBody UacActionCheckCodeDto uacActionCheckCodeDto) {
    logger.info("校验权限编码唯一性 uacActionCheckCodeDto={}", uacActionCheckCodeDto);
    Long id = uacActionCheckCodeDto.getActionId();
    String actionCode = uacActionCheckCodeDto.getActionCode();
    Example example = new Example(UacAction.class);
    Example.Criteria criteria = example.createCriteria();
    if (id != null) {
        criteria.andNotEqualTo("id", id);
    }
    criteria.andEqualTo("actionCode", actionCode);
    int result = uacActionService.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 34 with PostMapping

use of org.springframework.web.bind.annotation.PostMapping in project paascloud-master by paascloud.

the class UacActionCommonController method checkActionUrl.

/**
 * 检测权限URL唯一性
 *
 * @param uacActionCheckUrlDto the uac action check url dto
 *
 * @return the wrapper
 */
@PostMapping(value = "/checkUrl")
@ApiOperation(httpMethod = "POST", value = "检测权限URL唯一性")
public Wrapper<Boolean> checkActionUrl(@ApiParam(name = "uacActionCheckUrlDto", value = "id与url") @RequestBody UacActionCheckUrlDto uacActionCheckUrlDto) {
    logger.info("检测权限URL唯一性 uacActionCheckUrlDto={}", uacActionCheckUrlDto);
    Long id = uacActionCheckUrlDto.getActionId();
    String url = uacActionCheckUrlDto.getUrl();
    Example example = new Example(UacAction.class);
    Example.Criteria criteria = example.createCriteria();
    if (id != null) {
        criteria.andNotEqualTo("id", id);
    }
    criteria.andEqualTo("url", url);
    int result = uacActionService.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 35 with PostMapping

use of org.springframework.web.bind.annotation.PostMapping in project paascloud-master by paascloud.

the class UacTokenMainController method queryUacActionListWithPage.

/**
 * 分页查询角色信息.
 *
 * @param token the token
 *
 * @return the wrapper
 */
@PostMapping(value = "/queryListWithPage")
@ApiOperation(httpMethod = "POST", value = "查询在线用户列表")
public Wrapper queryUacActionListWithPage(@ApiParam(name = "token") @RequestBody TokenMainQueryDto token) {
    logger.info("查询在线用户列表. token={}", token);
    PageInfo pageInfo = uacUserTokenService.listTokenWithPage(token);
    return WrapMapper.ok(pageInfo);
}
Also used : PageInfo(com.github.pagehelper.PageInfo) PostMapping(org.springframework.web.bind.annotation.PostMapping) ApiOperation(io.swagger.annotations.ApiOperation)

Aggregations

PostMapping (org.springframework.web.bind.annotation.PostMapping)83 ApiOperation (io.swagger.annotations.ApiOperation)21 Profile (com.erudika.scoold.core.Profile)20 Post (com.erudika.scoold.core.Post)9 Example (tk.mybatis.mapper.entity.Example)8 HashMap (java.util.HashMap)7 Service (org.apereo.cas.authentication.principal.Service)6 ResponseEntity (org.springframework.http.ResponseEntity)6 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)6 LoginAuthDto (com.paascloud.base.dto.LoginAuthDto)5 AuthenticationResult (org.apereo.cas.authentication.AuthenticationResult)5 RegisteredService (org.apereo.cas.services.RegisteredService)5 User (amu.zhcet.data.user.User)4 Report (com.erudika.scoold.core.Report)4 IOException (java.io.IOException)4 Map (java.util.Map)4 Credential (org.apereo.cas.authentication.Credential)4 Reply (com.erudika.scoold.core.Reply)3 Log (io.github.tesla.ops.common.Log)3 LinkedHashMap (java.util.LinkedHashMap)3