public class BaseController extends Object
| 构造器和说明 |
|---|
BaseController() |
| 限定符和类型 | 方法和说明 |
|---|---|
ResultWrapper<Object> |
fail()
失败
|
ResultWrapper<Object> |
fail(int code,
String message)
失败,自定义状态码和消息
|
ResultWrapper<Object> |
fail(RespBeanEnum respBeanEnum)
失败,自定义枚举
|
ResultWrapper<Object> |
fail(String message)
失败,自定义消息
|
void |
initBinder(org.springframework.web.bind.WebDataBinder binder)
将前台传递过来的日期格式的字符串,自动转化为Date类型
注意:只对表单参数(application/x-www-form-urlencoded)或查询参数生效,对于json格式的请求不生效
|
ResultWrapper<Object> |
ok()
成功
|
ResultWrapper<Object> |
toRes(boolean result)
根据布尔值返回成功或者失败
|
ResultWrapper<Object> |
toRes(int rows)
根据影响行数返回成功或者失败
|
@InitBinder public void initBinder(org.springframework.web.bind.WebDataBinder binder)
public ResultWrapper<Object> ok()
public ResultWrapper<Object> fail()
public ResultWrapper<Object> fail(String message)
message - public ResultWrapper<Object> fail(int code, String message)
code - message - public ResultWrapper<Object> fail(RespBeanEnum respBeanEnum)
respBeanEnum - public ResultWrapper<Object> toRes(int rows)
rows - public ResultWrapper<Object> toRes(boolean result)
result - Copyright © 2025. All rights reserved.