Java Code Examples for cn.hutool.core.util.StrUtil#hasBlank()

The following examples show how to use cn.hutool.core.util.StrUtil#hasBlank() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JobController.java    From spring-boot-demo with MIT License 5 votes vote down vote up
/**
 * 删除定时任务
 */
@DeleteMapping
public ResponseEntity<ApiResponse> deleteJob(JobForm form) throws SchedulerException {
    if (StrUtil.hasBlank(form.getJobGroupName(), form.getJobClassName())) {
        return new ResponseEntity<>(ApiResponse.msg("参数不能为空"), HttpStatus.BAD_REQUEST);
    }

    jobService.deleteJob(form);
    return new ResponseEntity<>(ApiResponse.msg("删除成功"), HttpStatus.OK);
}
 
Example 2
Source File: JobController.java    From spring-boot-demo with MIT License 5 votes vote down vote up
/**
 * 暂停定时任务
 */
@PutMapping(params = "pause")
public ResponseEntity<ApiResponse> pauseJob(JobForm form) throws SchedulerException {
    if (StrUtil.hasBlank(form.getJobGroupName(), form.getJobClassName())) {
        return new ResponseEntity<>(ApiResponse.msg("参数不能为空"), HttpStatus.BAD_REQUEST);
    }

    jobService.pauseJob(form);
    return new ResponseEntity<>(ApiResponse.msg("暂停成功"), HttpStatus.OK);
}
 
Example 3
Source File: JobController.java    From spring-boot-demo with MIT License 5 votes vote down vote up
/**
 * 恢复定时任务
 */
@PutMapping(params = "resume")
public ResponseEntity<ApiResponse> resumeJob(JobForm form) throws SchedulerException {
    if (StrUtil.hasBlank(form.getJobGroupName(), form.getJobClassName())) {
        return new ResponseEntity<>(ApiResponse.msg("参数不能为空"), HttpStatus.BAD_REQUEST);
    }

    jobService.resumeJob(form);
    return new ResponseEntity<>(ApiResponse.msg("恢复成功"), HttpStatus.OK);
}
 
Example 4
Source File: JobController.java    From spring-boot-demo with MIT License 5 votes vote down vote up
/**
 * 删除定时任务
 */
@DeleteMapping
public ResponseEntity<ApiResponse> deleteJob(JobForm form) throws SchedulerException {
    if (StrUtil.hasBlank(form.getJobGroupName(), form.getJobClassName())) {
        return new ResponseEntity<>(ApiResponse.msg("参数不能为空"), HttpStatus.BAD_REQUEST);
    }

    jobService.deleteJob(form);
    return new ResponseEntity<>(ApiResponse.msg("删除成功"), HttpStatus.OK);
}
 
Example 5
Source File: JobController.java    From spring-boot-demo with MIT License 5 votes vote down vote up
/**
 * 暂停定时任务
 */
@PutMapping(params = "pause")
public ResponseEntity<ApiResponse> pauseJob(JobForm form) throws SchedulerException {
    if (StrUtil.hasBlank(form.getJobGroupName(), form.getJobClassName())) {
        return new ResponseEntity<>(ApiResponse.msg("参数不能为空"), HttpStatus.BAD_REQUEST);
    }

    jobService.pauseJob(form);
    return new ResponseEntity<>(ApiResponse.msg("暂停成功"), HttpStatus.OK);
}
 
Example 6
Source File: JobController.java    From spring-boot-demo with MIT License 5 votes vote down vote up
/**
 * 恢复定时任务
 */
@PutMapping(params = "resume")
public ResponseEntity<ApiResponse> resumeJob(JobForm form) throws SchedulerException {
    if (StrUtil.hasBlank(form.getJobGroupName(), form.getJobClassName())) {
        return new ResponseEntity<>(ApiResponse.msg("参数不能为空"), HttpStatus.BAD_REQUEST);
    }

    jobService.resumeJob(form);
    return new ResponseEntity<>(ApiResponse.msg("恢复成功"), HttpStatus.OK);
}
 
Example 7
Source File: JobController.java    From spring-boot-demo with MIT License 5 votes vote down vote up
/**
 * 删除定时任务
 */
@DeleteMapping
public ResponseEntity<ApiResponse> deleteJob(JobForm form) throws SchedulerException {
    if (StrUtil.hasBlank(form.getJobGroupName(), form.getJobClassName())) {
        return new ResponseEntity<>(ApiResponse.msg("参数不能为空"), HttpStatus.BAD_REQUEST);
    }

    jobService.deleteJob(form);
    return new ResponseEntity<>(ApiResponse.msg("删除成功"), HttpStatus.OK);
}
 
Example 8
Source File: JobController.java    From spring-boot-demo with MIT License 5 votes vote down vote up
/**
 * 暂停定时任务
 */
@PutMapping(params = "pause")
public ResponseEntity<ApiResponse> pauseJob(JobForm form) throws SchedulerException {
    if (StrUtil.hasBlank(form.getJobGroupName(), form.getJobClassName())) {
        return new ResponseEntity<>(ApiResponse.msg("参数不能为空"), HttpStatus.BAD_REQUEST);
    }

    jobService.pauseJob(form);
    return new ResponseEntity<>(ApiResponse.msg("暂停成功"), HttpStatus.OK);
}
 
Example 9
Source File: JobController.java    From spring-boot-demo with MIT License 5 votes vote down vote up
/**
 * 恢复定时任务
 */
@PutMapping(params = "resume")
public ResponseEntity<ApiResponse> resumeJob(JobForm form) throws SchedulerException {
    if (StrUtil.hasBlank(form.getJobGroupName(), form.getJobClassName())) {
        return new ResponseEntity<>(ApiResponse.msg("参数不能为空"), HttpStatus.BAD_REQUEST);
    }

    jobService.resumeJob(form);
    return new ResponseEntity<>(ApiResponse.msg("恢复成功"), HttpStatus.OK);
}