Search in sources :

Example 16 with Result

use of com.github.lybgeek.common.model.Result in project springboot-learning by lyb-geek.

the class BookController method upadteBook.

@PostMapping(value = "/update")
public Result<BookDTO> upadteBook(BookDTO bookDTO) {
    Result<BookDTO> result = new Result<>();
    if (bookDTO.getId() == null) {
        result.setStatus(Result.fail);
        result.setMessage("id不能为空");
        return result;
    }
    BookDTO book = bookService.editBook(bookDTO);
    result.setData(book);
    return result;
}
Also used : BookDTO(com.github.lybgeek.httpclient.dto.BookDTO) Result(com.github.lybgeek.common.model.Result) PageResult(com.github.lybgeek.common.model.PageResult) BindingResult(org.springframework.validation.BindingResult) PostMapping(org.springframework.web.bind.annotation.PostMapping)

Aggregations

Result (com.github.lybgeek.common.model.Result)16 PostMapping (org.springframework.web.bind.annotation.PostMapping)13 PageResult (com.github.lybgeek.common.model.PageResult)11 BindingResult (org.springframework.validation.BindingResult)11 BookDTO (com.github.lybgeek.swagger.dto.BookDTO)3 ExcelImportResult (cn.afterturn.easypoi.excel.entity.result.ExcelImportResult)2 BizException (com.github.lybgeek.common.exception.BizException)2 BookDTO (com.github.lybgeek.dynamic.dto.BookDTO)2 BookDTO (com.github.lybgeek.httpclient.dto.BookDTO)2 BookDTO (com.github.lybgeek.redis.dto.BookDTO)2 BookDTO (com.github.lybgeek.spilt.dto.BookDTO)2 ExceptionHandler (org.springframework.web.bind.annotation.ExceptionHandler)2 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)2 CustomerserviceWagesDTO (com.github.lybgeek.modules.customerservice.dto.CustomerserviceWagesDTO)1 CustomerserviceWagesVO (com.github.lybgeek.modules.customerservice.vo.CustomerserviceWagesVO)1 ImageDTO (com.github.lybgeek.modules.image.dto.ImageDTO)1 ImageVO (com.github.lybgeek.modules.image.vo.ImageVO)1 ResponseStatus (org.springframework.web.bind.annotation.ResponseStatus)1