| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import org.slf4j.Logger; |
| | | |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | |
| | | * add by wuxw 2020/5/28 |
| | | **/ |
| | | public class ResultVo implements Serializable { |
| | | |
| | | |
| | | |
| | | public static final int CODE_ERROR = 404;// 未知异常 |
| | | |
| | |
| | | return JSONObject.toJSONString(this, SerializerFeature.DisableCircularReferenceDetect, SerializerFeature.WriteDateUseDateFormat); |
| | | } |
| | | |
| | | public static ResultVo ok(){ |
| | | return new ResultVo(ResultVo.CODE_OK,ResultVo.MSG_OK); |
| | | } |
| | | |
| | | /** |
| | | * 创建ResponseEntity对象 |
| | |
| | | * @return |
| | | */ |
| | | public static ResponseEntity<String> redirectPage(String url) { |
| | | |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.add(HttpHeaders.LOCATION, url); |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("", headers, HttpStatus.FOUND); |