对比新文件 |
| | |
| | | package com.lf.server.controller.all; |
| | | |
| | | import com.lf.server.entity.all.HttpStatus; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | |
| | | /** |
| | | * Controller鍩虹被 |
| | | * @author WWW |
| | | */ |
| | | public class BaseController { |
| | | public Log log = LogFactory.getLog(getClass()); |
| | | |
| | | public <T> ResponseMsg<T> success(T result) { |
| | | return new ResponseMsg<T>(HttpStatus.OK, result); |
| | | } |
| | | |
| | | public <T> ResponseMsg<T> success(String msg, T result) { |
| | | return new ResponseMsg<T>(HttpStatus.OK, msg, result); |
| | | } |
| | | |
| | | public <T> ResponseMsg<T> success(long count, T result) { |
| | | return new ResponseMsg<T>(HttpStatus.OK, count, result); |
| | | } |
| | | |
| | | public <T> ResponseMsg<T> success(String msg, long count, T result) { |
| | | return new ResponseMsg<T>(HttpStatus.OK, msg, count, result); |
| | | } |
| | | |
| | | public <T> ResponseMsg<T> fail(T result) { |
| | | return new ResponseMsg<T>(HttpStatus.ERROR, result); |
| | | } |
| | | |
| | | public <T> ResponseMsg<T> fail(String msg, T result) { |
| | | return new ResponseMsg<T>(HttpStatus.ERROR, msg, result); |
| | | } |
| | | } |