/*
 * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
 */
package kr.co.zumo.app.lifeplus.bean.api;

import com.google.gson.annotations.SerializedName;

import kr.co.zumo.app.lifeplus.bean.JsonBeanBase;

/**
 * LifeplusAPIBean
 * <pre>
 * </pre>
 *
 * @author 민효동
 * @version 1.0
 * @history 민효동   [2018. 9. 19.]   [최초 작성]
 * @since 2018. 9. 19.
 */
public class LifeplusAPIBean extends JsonBeanBase {

  public static int RETURN_DEFAULT = -1000;
  public static int RETURN_SUCCESS = 0;
  public static int RETURN_PARAMETER_ERROR = -1;
  public static int RETURN_MOBILE_AUTH_ERROR_UNDER_14_YEARS = -2;
  public static int RETURN_MOBILE_AUTH_ERROR_NEED_FOR_30_DAYS = -900;
  public static int RETURN_MOBILE_AUTH_ERROR_ALREADY_MEMBER = -4;
  public static int RETURN_REGISTRATION_FAIL = -30;
  public static int RETURN_CONFIRM_FAIL = -40;

  @SerializedName("sp_rtn")
  private int code = RETURN_DEFAULT;
  @SerializedName("rtn_message")
  private String returnMessage;

  public LifeplusAPIBean() {
  }

  public LifeplusAPIBean(int code, String returnMessage) {
    this.code = code;
    this.returnMessage = returnMessage;
  }

  public String getReturnMessage() {
    return returnMessage;
  }

  public void setReturnMessage(String returnMessage) {
    this.returnMessage = returnMessage;
  }

  public int getCode() {
    return code;
  }

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

  /**
   * 성공을 판단
   *
   * @return
   */
  public boolean isSuccess() {
    return code == RETURN_SUCCESS;
  }
}
