use of org.springframework.web.bind.annotation.PostMapping in project zhcet-web by zhcet-amu.
the class NotificationSendingController method handleSentNotification.
@PostMapping
public String handleSentNotification(@Valid Notification notification, BindingResult bindingResult, RedirectAttributes redirectAttribute) {
User user = userService.getLoggedInUser().orElseThrow(() -> new AccessDeniedException("403"));
if (bindingResult.hasErrors()) {
redirectAttribute.addFlashAttribute("notification", notification);
redirectAttribute.addFlashAttribute("org.springframework.validation.BindingResult.notification", bindingResult);
} else {
notification.setSender(user);
notificationSendingService.sendNotification(notification);
redirectAttribute.addFlashAttribute("notification_success", "Notification sending in background");
}
return "redirect:/management/notification/send";
}
use of org.springframework.web.bind.annotation.PostMapping in project paascloud-master by paascloud.
the class UacDictCommonController method checkDictCode.
/**
* 检测菜单编码是否已存在
*
* @param mdcDictCheckCodeDto the mdc dict check code dto
*
* @return the wrapper
*/
@PostMapping(value = "/checkDictCode")
@ApiOperation(httpMethod = "POST", value = "检测数据字典编码是否已存在")
public Wrapper<Boolean> checkDictCode(@ApiParam(name = "uacMenuCheckCodeDto", value = "id与url") @RequestBody MdcDictCheckCodeDto mdcDictCheckCodeDto) {
logger.info("检测数据字典编码是否已存在 mdcDictCheckCodeDto={}", mdcDictCheckCodeDto);
Long id = mdcDictCheckCodeDto.getDictId();
String dictCode = mdcDictCheckCodeDto.getDictCode();
Example example = new Example(MdcDict.class);
Example.Criteria criteria = example.createCriteria();
if (id != null) {
criteria.andNotEqualTo("id", id);
}
criteria.andEqualTo("dictCode", dictCode);
int result = mdcDictService.selectCountByExample(example);
return WrapMapper.ok(result < 1);
}
use of org.springframework.web.bind.annotation.PostMapping in project paascloud-master by paascloud.
the class UacDictCommonController method checkDictName.
/**
* 检测数据字典名称是否已存在.
*
* @param mdcDictCheckNameDto the mdc dict check name dto
*
* @return the wrapper
*/
@PostMapping(value = "/checkDictName")
@ApiOperation(httpMethod = "POST", value = "检测数据字典名称是否已存在")
public Wrapper<Boolean> checkDictName(@ApiParam(name = "uacMenuCheckCodeDto", value = "id与url") @RequestBody MdcDictCheckNameDto mdcDictCheckNameDto) {
logger.info("检测数据字典名称是否已存在 mdcDictCheckNameDto={}", mdcDictCheckNameDto);
Long id = mdcDictCheckNameDto.getDictId();
String dictName = mdcDictCheckNameDto.getDictName();
Example example = new Example(MdcDict.class);
Example.Criteria criteria = example.createCriteria();
if (id != null) {
criteria.andNotEqualTo("id", id);
}
criteria.andEqualTo("dictName", dictName);
int result = mdcDictService.selectCountByExample(example);
return WrapMapper.ok(result < 1);
}
use of org.springframework.web.bind.annotation.PostMapping in project paascloud-master by paascloud.
the class MdcExceptionMainController method queryLogListWithPage.
/**
* 异常日志列表.
*
* @param mdcExceptionQueryDto the mdc exception query dto
*
* @return the wrapper
*/
@PostMapping(value = "/queryListWithPage")
@ApiOperation(httpMethod = "POST", value = "查询日志列表")
public Wrapper queryLogListWithPage(@ApiParam(name = "mdcExceptionQueryDto", value = "异常查询条件") @RequestBody MdcExceptionQueryDto mdcExceptionQueryDto) {
logger.info("查询日志处理列表 mdcExceptionQueryDto={}", mdcExceptionQueryDto);
PageInfo pageInfo = mdcExceptionLogService.queryExceptionListWithPage(mdcExceptionQueryDto);
return WrapMapper.ok(pageInfo);
}
use of org.springframework.web.bind.annotation.PostMapping in project paascloud-master by paascloud.
the class EmailController method sendRestEmailCode.
/**
* 发送短信验证码.
*
* @param sendEmailMessage the send email message
*
* @return the wrapper
*/
@PostMapping(value = "/sendRestEmailCode")
@ApiOperation(httpMethod = "POST", value = "发送注册短信验证码")
public Wrapper<String> sendRestEmailCode(@RequestBody SendEmailMessage sendEmailMessage) {
LoginAuthDto loginAuthDto = this.getLoginAuthDto();
emailService.sendEmailCode(sendEmailMessage, loginAuthDto.getLoginName());
return WrapMapper.ok();
}
Aggregations