| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- package com.goafanti.common.bo;
- import java.io.Serializable;
- import java.util.ArrayList;
- import java.util.List;
- import org.apache.shiro.SecurityUtils;
- public class Result {
- private Object data;
- private List<Error> error = new ArrayList<Error>();
- private Serializable token;
- public Result() {
- this.token = SecurityUtils.getSubject().getSession().getId();
- System.out.println("返回 token=============="+token);
- }
- public Result(Object data) {
- this.data = data;
- }
- /**
- * @return the data
- */
- public Object getData() {
- return data;
- }
- /**
- * @param data
- * the data to set
- */
- public void setData(Object data) {
- this.data = data;
- }
- /**
- * @return the error
- */
- public List<Error> getError() {
- return error;
- }
- /**
- * @param error
- * the error to set
- */
- public void setError(List<Error> error) {
- this.error = error;
- }
- public Result error(Error e) {
- if (e != null) {
- this.error.add(e);
- }
- return this;
- }
- public Result data(Object o) {
- this.data = o;
- return this;
- }
- public Serializable getToken() {
- return token;
- }
- public void setToken(Serializable token) {
- this.token = token;
- }
- }
|