MVP登录注册界面

使用的依赖和方法

compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.squareup.okhttp3:okhttp:3.6.0'
compile 'com.squareup.okio:okio:1.11.0'
compile 'com.google.code.gson:gson:2.8.2'

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

activity_my_login

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="com.bwie.test.mylogin_demo.MyLoginActivity">
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="50dp">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="登录"
            android:layout_centerInParent="true"/>
    </RelativeLayout>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="#000000"/>

    <EditText
        android:layout_marginTop="50dp"
        android:id="@+id/login_mobile"
        android:layout_width="300dp"
        android:layout_height="50dp"
        android:singleLine="true"
        android:hint="请输入账号"
        android:layout_gravity="center_horizontal"/>

    <EditText
        android:layout_marginTop="50dp"
        android:id="@+id/login_password"
        android:layout_width="300dp"
        android:layout_height="50dp"
        android:singleLine="true"
        android:hint="请输入密码"
        android:layout_gravity="center_horizontal"
        android:password="true"/>

    <LinearLayout
        android:layout_marginTop="50dp"
        android:layout_width="300dp"
        android:layout_height="50dp"
        android:layout_gravity="center_horizontal">

        <RelativeLayout
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="match_parent">
            <Button
                android:id="@+id/login"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="登录"
                android:layout_centerInParent="true"/>
        </RelativeLayout>

        <RelativeLayout
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="match_parent">
            <Button
                android:id="@+id/reg"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="注册"
                android:layout_centerInParent="true"/>

        </RelativeLayout>
    </LinearLayout>

</LinearLayout>

activity_my_reg

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="com.bwie.test.mylogin_demo.MyRegActivity">
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="50dp">

        <ImageView
            android:id="@+id/icon_back"
            android:layout_width="20dp"
            android:layout_height="20dp"
            android:src="@drawable/leftjiantou"
            android:layout_centerVertical="true"
            android:layout_marginLeft="10dp"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="注册"
            android:layout_centerInParent="true"/>

    </RelativeLayout>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="#000000"/>

    <EditText
        android:layout_marginTop="50dp"
        android:id="@+id/reg_mobile"
        android:layout_width="300dp"
        android:layout_height="50dp"
        android:singleLine="true"
        android:hint="请输入账号"
        android:layout_gravity="center_horizontal"/>

    <EditText
        android:layout_marginTop="50dp"
        android:id="@+id/reg_password"
        android:layout_width="300dp"
        android:layout_height="50dp"
        android:singleLine="true"
        android:hint="请输入密码"
        android:layout_gravity="center_horizontal"
        android:password="true"/>

    <Button
        android:id="@+id/reg"
        android:layout_marginTop="50dp"
        android:layout_width="300dp"
        android:layout_height="50dp"
        android:text="立即注册"
        android:gravity="center"
        android:layout_gravity="center_horizontal"/>

</LinearLayout>

MyLoginActivity

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.bwie.test.bean.MyLoginBean;
import com.bwie.test.presenter.MyLoginPresenter;
import com.bwie.test.presenter.inter_presenter.MyLoginPreCallBack;
import com.bwie.test.utils.ApiUtils;
import java.util.HashMap;
import java.util.Map;

public class MyLoginActivity extends AppCompatActivity implements MyLoginPreCallBack{
    private EditText mobileEdit;
    private EditText passwordEdit;
    private Button loginBtn;
    private Button regBtn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_login);
        //隐藏原有标题
        getSupportActionBar().hide();
        //从presenter层调用方法
        final MyLoginPresenter myLoginPresenter = new MyLoginPresenter(this);
        //查找控件
        mobileEdit = (EditText) findViewById(R.id.login_mobile);
        passwordEdit = (EditText) findViewById(R.id.login_password);
        loginBtn = (Button) findViewById(R.id.login);
        regBtn = (Button) findViewById(R.id.reg);
        //设置点击事件
        loginBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String mobile = mobileEdit.getText().toString();
                String password = passwordEdit.getText().toString();
                Map<String, String> params = new HashMap<>();
                params.put("mobile", mobile);
                params.put("password", password);
                myLoginPresenter.postLoginData(ApiUtils.LOGIN_URL, params);
            }
        });
        //设置点击事件
        regBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent integer = new Intent(MyLoginActivity.this, MyRegActivity.class);
                startActivity(integer);
            }
        });
    }

    @Override
    public void onLoginPreResponseSuccess(final MyLoginBean myLoginBean) {
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                Toast.makeText(MyLoginActivity.this, myLoginBean.getMsg(), Toast.LENGTH_SHORT).show();
                if ("0".equals(myLoginBean.getCode())){
                    Toast.makeText(MyLoginActivity.this, "登陆成功",Toast.LENGTH_SHORT).show();
                }
            }
        });
    }

    @Override
    public void onLoginPreResponseError() {

    }
}

MyRegActivity

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;

import com.bwie.test.bean.MyRegBean;
import com.bwie.test.presenter.MyRegPresenter;
import com.bwie.test.presenter.inter_presenter.MyRegPreCallBack;
import com.bwie.test.utils.ApiUtils;
import java.util.HashMap;
import java.util.Map;

public class MyRegActivity extends AppCompatActivity implements MyRegPreCallBack{
    private EditText mobileEdit;
    private EditText passwordEdit;
    private ImageView backImage;
    private Button regBtn;
    private MyRegPresenter myRegPresenter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_reg);
        //隐藏原有标题
        getSupportActionBar().hide();
        //从presenter层调用方法
        myRegPresenter = new MyRegPresenter(this);
        //查找控件
        backImage = (ImageView) findViewById(R.id.icon_back);
        mobileEdit = (EditText) findViewById(R.id.reg_mobile);
        passwordEdit = (EditText) findViewById(R.id.reg_password);
        regBtn = (Button) findViewById(R.id.reg);
        //点击返回
        backImage.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MyRegActivity.this, MyLoginActivity.class);
                startActivity(intent);
            }
        });

        regBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String mobile = mobileEdit.getText().toString();
                String password = passwordEdit.getText().toString();
                Map<String, String> params = new HashMap<>();
                params.put("mobile", mobile);
                params.put("password", password);
                myRegPresenter.postRegData(ApiUtils.REG_URL, params);
            }
        });
    }

    @Override
    public void onRegPreResponseSuccess(final MyRegBean myRegBean) {
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                Toast.makeText(MyRegActivity.this, myRegBean.getMsg(), Toast.LENGTH_SHORT).show();
                finish();
                if ("0".equals(myRegBean.getCode())){
                    finish();
                }
            }
        });
    }

    @Override
    public void onRegPreResponseError() {

    }
}

model文件夹下MyLoginModel

import com.bwie.test.bean.MyLoginBean;
import com.bwie.test.model.inter_model.LoginModelCallBack;
import com.bwie.test.utils.OkHttp3Util;
import com.google.gson.Gson;

import java.io.IOException;
import java.util.Map;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Response;

public class MyLoginModel {
    private LoginModelCallBack callBack;

    public MyLoginModel(LoginModelCallBack callBack) {
        this.callBack = callBack;
    }

    public void postLoginData(String url, Map<String, String> params){
        OkHttp3Util.doPost(url, params, new Callback() {
            @Override
            public void onFailure(Call call, IOException e) {
                callBack.onLoginModelResponseError();
            }

            @Override
            public void onResponse(Call call, Response response) throws IOException {
                Gson gson = new Gson();
                MyLoginBean myLoginBean = gson.fromJson(response.body().string(), MyLoginBean.class);
                callBack.onLoginModelResponseSuccess(myLoginBean);
            }
        });
    }
}

MyRegModel

import com.bwie.test.bean.MyRegBean;
import com.bwie.test.model.inter_model.RegModelCallBack;
import com.bwie.test.utils.OkHttp3Util;
import com.google.gson.Gson;

import java.io.IOException;
import java.util.Map;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;

public class MyRegModel {
    private RegModelCallBack callBack;

    public MyRegModel(RegModelCallBack callBack) {
        this.callBack = callBack;
    }

    public void postRegData(String url, Map<String, String> params){
        OkHttp3Util.doPost(url, params, new Callback() {
            @Override
            public void onFailure(Call call, IOException e) {
                callBack.onRegModelResponseError();
            }

            @Override
            public void onResponse(Call call, Response response) throws IOException {
                Gson gson = new Gson();
                MyRegBean myRegBean = gson.fromJson(response.body().string(), MyRegBean.class);
                callBack.onRegModelResponseSuccess(myRegBean);
            }
        });
    }
}

inter_model文件夹下LoginModelCallBack

import com.bwie.test.bean.MyLoginBean;

public interface LoginModelCallBack {
    void onLoginModelResponseSuccess(MyLoginBean myLoginBean);
    void onLoginModelResponseError();
}

RegModelCallBack

import com.bwie.test.bean.MyRegBean;

public interface RegModelCallBack {
    void onRegModelResponseSuccess(MyRegBean myRegBean);
    void onRegModelResponseError();
}

presenter文件夹下MyLoginPresenter

import com.bwie.test.bean.MyLoginBean;
import com.bwie.test.model.MyLoginModel;
import com.bwie.test.model.inter_model.LoginModelCallBack;
import com.bwie.test.presenter.inter_presenter.MyLoginPreCallBack;
import java.util.Map;

public class MyLoginPresenter implements LoginModelCallBack{
    private MyLoginPreCallBack loginPreCallBack;
    private MyLoginModel loginModel;

    public MyLoginPresenter(MyLoginPreCallBack loginPreCallBack) {
        this.loginPreCallBack = loginPreCallBack;
        this.loginModel = new MyLoginModel(this);
    }

    public void postLoginData(String url, Map<String, String> params){
        loginModel.postLoginData(url, params);
    }

    @Override
    public void onLoginModelResponseSuccess(MyLoginBean myLoginBean) {
        loginPreCallBack.onLoginPreResponseSuccess(myLoginBean);
    }

    @Override
    public void onLoginModelResponseError() {
        loginPreCallBack.onLoginPreResponseError();
    }
}

MyRegPresenter

import com.bwie.test.bean.MyRegBean;
import com.bwie.test.model.MyRegModel;
import com.bwie.test.model.inter_model.RegModelCallBack;
import com.bwie.test.presenter.inter_presenter.MyRegPreCallBack;
import java.util.Map;

public class MyRegPresenter implements RegModelCallBack{
    private MyRegPreCallBack regPreCallBack;
    private MyRegModel regModel;

    public MyRegPresenter(MyRegPreCallBack regPreCallBack) {
        this.regPreCallBack = regPreCallBack;
        this.regModel = new MyRegModel(this);
    }

    public void postRegData(String url, Map<String, String> params){
        regModel.postRegData(url, params);
    }

    @Override
    public void onRegModelResponseSuccess(MyRegBean myRegBean) {
        regPreCallBack.onRegPreResponseSuccess(myRegBean);
    }

    @Override
    public void onRegModelResponseError() {
        regPreCallBack.onRegPreResponseError();
    }
}

inter_presenter文件夹下MyLoginPreCallBack

import com.bwie.test.bean.MyLoginBean;

public interface MyLoginPreCallBack {
    void onLoginPreResponseSuccess(MyLoginBean myLoginBean);
    void onLoginPreResponseError();
}

MyRegPreCallBack

import com.bwie.test.bean.MyRegBean;

public interface MyRegPreCallBack {
    void onRegPreResponseSuccess(MyRegBean myRegBean);
    void onRegPreResponseError();
}

utils文件夹下ApiUtils

public class ApiUtils {
    public static final String LOGIN_URL = "http://120.27.23.105/user/login";
    public static final String REG_URL = "http://120.27.23.105/user/reg";
} 

OkHttp3Util

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Environment;
import android.util.Log;
import android.widget.Toast;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import okhttp3.Cache;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.MediaType;
import okhttp3.MultipartBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;

public class OkHttp3Util {
    private static OkHttpClient okHttpClient = null;

    private OkHttp3Util() {
    }

    public static OkHttpClient getInstance() {
        if (okHttpClient == null) {
            //加同步安全
            synchronized (OkHttp3Util.class) {
                if (okHttpClient == null) {
                    //okhttp可以缓存数据....指定缓存路径
                    File sdcache = new File(Environment.getExternalStorageDirectory(), "cache");
                    //指定缓存大小
                    int cacheSize = 10 * 1024 * 1024;

                    okHttpClient = new OkHttpClient.Builder()//构建器
                            .connectTimeout(15, TimeUnit.SECONDS)//连接超时
                            .writeTimeout(20, TimeUnit.SECONDS)//写入超时
                            .readTimeout(20, TimeUnit.SECONDS)//读取超时
                            .cache(new Cache(sdcache.getAbsoluteFile(), cacheSize))//设置缓存
                            .build();
                }
            }
        }
        return okHttpClient;
    }

    /**
     * get请求
     */
    public static void doGet(String oldUrl, Callback callback) {
        //要添加的公共参数...map
        Map<String,String> map = new HashMap<>();
        map.put("source","android");
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(oldUrl);

        if (oldUrl.contains("?")){
            if (oldUrl.indexOf("?") == oldUrl.length()-1){
            }else {
                stringBuilder.append("&");
            }
        }else {
            //不包含? 属于1类型,,,先拼接上?号
            stringBuilder.append("?");
        }

        for (Map.Entry<String,String> entry: map.entrySet()) {
            stringBuilder.append(entry.getKey())
                    .append("=")
                    .append(entry.getValue())
                    .append("&");
        }

        if (stringBuilder.indexOf("&") != -1){
            stringBuilder.deleteCharAt(stringBuilder.lastIndexOf("&"));
        }
        String newUrl = stringBuilder.toString();

        OkHttpClient okHttpClient = getInstance();
        Request request = new Request.Builder().url(newUrl).build();
      
        Call call = okHttpClient.newCall(request);
        call.enqueue(callback);
    }

    /**
     * post请求
     */
    public static void doPost(String url, Map<String, String> params, Callback callback) {
        Map<String,String> map = new HashMap<>();
        map.put("source","android");

        //创建OkHttpClient请求对象
        OkHttpClient okHttpClient = getInstance();

        FormBody.Builder builder = new FormBody.Builder();
        for (String key : params.keySet()) {
            builder.add(key, params.get(key));
        }

        for (String key : map.keySet()) {
            builder.add(key, map.get(key));
        }

        Request request = new Request.Builder().url(url).post(builder.build()).build();
        Call call = okHttpClient.newCall(request);
        call.enqueue(callback);
    }

    /**
     * post请求上传文件包括图片
     */
    public static void uploadFile(String url, File file, String fileName,Map<String,String> params,
                                                   Callback callback) {
        //创建OkHttpClient请求对象
        OkHttpClient okHttpClient = getInstance();

        MultipartBody.Builder builder = new MultipartBody.Builder();
        builder.setType(MultipartBody.FORM);

        //参数
        if (params != null){
            for (String key : params.keySet()){
                builder.addFormDataPart(key,params.get(key));
            }
        }
        builder.addFormDataPart("file",fileName,RequestBody.create(MediaType.parse(
                                             "application/octet-stream"),file));

        //构建
        MultipartBody multipartBody = builder.build();

        //创建Request
        Request request = new Request.Builder().url(url).post(multipartBody).build();

        //得到Call
        Call call = okHttpClient.newCall(request);
        call.enqueue(callback);
    }

    /**
     * Post请求发送JSON数据
     */
    public static void doPostJson(String url, String jsonParams, Callback callback) {
        RequestBody requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"),
                                                jsonParams);
        Request request = new Request.Builder().url(url).post(requestBody).build();
        Call call = getInstance().newCall(request);
        call.enqueue(callback);
    }

    /**
     * 下载文件
     */
    public static void download(final Activity context, final String url, final String saveDir) {
        Request request = new Request.Builder().url(url).build();
        Call call = getInstance().newCall(request);

        call.enqueue(new Callback() {
            @Override
            public void onFailure(Call call, IOException e) {
                //com.orhanobut.logger.Logger.e(e.getLocalizedMessage());
            }

            @Override
            public void onResponse(Call call, final Response response) throws IOException {
                InputStream is = null;
                byte[] buf = new byte[2048];
                int len = 0;
                FileOutputStream fos = null;
                try {
                    is = response.body().byteStream();
                    //apk保存路径
                    final String fileDir = isExistDir(saveDir);
                    //文件
                    File file = new File(fileDir, getNameFromUrl(url));
                    fos = new FileOutputStream(file);
                    while ((len = is.read(buf)) != -1) {
                        fos.write(buf, 0, len);
                    }

                    fos.flush();
                    context.runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                            Toast.makeText(context, "下载成功:" + fileDir + "," + getNameFromUrl(url), 
                                       Toast.LENGTH_SHORT).show();
                        }
                    });
                    Intent intent = new Intent(Intent.ACTION_VIEW);
                    intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");
                    context.startActivity(intent);
                } catch (IOException e) {
                    e.printStackTrace();
                } finally {
                    if (is != null) is.close();
                    if (fos != null) fos.close();
                }
            }
        });
    }

    /**
     * 判断下载目录是否存在
     */
    public static String isExistDir(String saveDir) throws IOException {
        // 下载位置
        if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
            File downloadFile = new File(Environment.getExternalStorageDirectory(), saveDir);
            if (!downloadFile.mkdirs()) {
                downloadFile.createNewFile();
            }
            String savePath = downloadFile.getAbsolutePath();
            Log.e("savePath", savePath);
            return savePath;
        }
        return null;
    }

    /**
     * @param url
     * @return 从下载连接中解析出文件名
     */
    private static String getNameFromUrl(String url) {
        return url.substring(url.lastIndexOf("/") + 1);
    }
}

bean文件夹下MyLoginBean

public class MyLoginBean {
    private String msg;
    private String code;
    private DataBean data;

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public DataBean getData() {
        return data;
    }

    public void setData(DataBean data) {
        this.data = data;
    }

    public static class DataBean {
        private Object age;
        private String appkey;
        private String appsecret;
        private String createtime;
        private Object email;
        private Object fans;
        private Object follow;
        private Object gender;
        private Object icon;
        private Object latitude;
        private Object longitude;
        private String mobile;
        private Object money;
        private Object nickname;
        private String password;
        private Object praiseNum;
        private String token;
        private int uid;
        private Object userId;
        private String username;

        public Object getAge() {
            return age;
        }

        public void setAge(Object age) {
            this.age = age;
        }

        public String getAppkey() {
            return appkey;
        }

        public void setAppkey(String appkey) {
            this.appkey = appkey;
        }

        public String getAppsecret() {
            return appsecret;
        }

        public void setAppsecret(String appsecret) {
            this.appsecret = appsecret;
        }

        public String getCreatetime() {
            return createtime;
        }

        public void setCreatetime(String createtime) {
            this.createtime = createtime;
        }

        public Object getEmail() {
            return email;
        }

        public void setEmail(Object email) {
            this.email = email;
        }

        public Object getFans() {
            return fans;
        }

        public void setFans(Object fans) {
            this.fans = fans;
        }

        public Object getFollow() {
            return follow;
        }

        public void setFollow(Object follow) {
            this.follow = follow;
        }

        public Object getGender() {
            return gender;
        }

        public void setGender(Object gender) {
            this.gender = gender;
        }

        public Object getIcon() {
            return icon;
        }

        public void setIcon(Object icon) {
            this.icon = icon;
        }

        public Object getLatitude() {
            return latitude;
        }

        public void setLatitude(Object latitude) {
            this.latitude = latitude;
        }

        public Object getLongitude() {
            return longitude;
        }

        public void setLongitude(Object longitude) {
            this.longitude = longitude;
        }

        public String getMobile() {
            return mobile;
        }

        public void setMobile(String mobile) {
            this.mobile = mobile;
        }

        public Object getMoney() {
            return money;
        }

        public void setMoney(Object money) {
            this.money = money;
        }

        public Object getNickname() {
            return nickname;
        }

        public void setNickname(Object nickname) {
            this.nickname = nickname;
        }

        public String getPassword() {
            return password;
        }

        public void setPassword(String password) {
            this.password = password;
        }

        public Object getPraiseNum() {
            return praiseNum;
        }

        public void setPraiseNum(Object praiseNum) {
            this.praiseNum = praiseNum;
        }

        public String getToken() {
            return token;
        }

        public void setToken(String token) {
            this.token = token;
        }

        public int getUid() {
            return uid;
        }

        public void setUid(int uid) {
            this.uid = uid;
        }

        public Object getUserId() {
            return userId;
        }

        public void setUserId(Object userId) {
            this.userId = userId;
        }

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }
    }
}

MyRegBean

public class MyRegBean {
    private String msg;
    private String code;
    private String data;

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }
}

猜你喜欢

转载自blog.csdn.net/gh323093/article/details/79980449