/**
 * 2.8.固定电话获取认证短信
 * @param landline            电话号码
 * @param telephone_cc        国家区号,参考数组<CountryArray>
 * @param landline_ac        区号
 * @param device_id            设备唯一标识
 * @return                    请求唯一标识
 */
long RequestAuthorizationController::GetFixedPhone(string landline, int telephone_cc, string landline_ac,
                                                   string device_id) {
    HttpEntiy entiy;

    if (landline.length() > 0) {
        entiy.AddContent(AUTHORIZATION_LANDLINE, landline.c_str());
    }

    string strCountry = GetCountryCode(telephone_cc);
    if (!strCountry.empty()) {
        entiy.AddContent(AUTHORIZATION_LANDLINE_CC, strCountry.c_str());
    }

    if (landline_ac.length() > 0) {
        entiy.AddContent(AUTHORIZATION_LANDLINE_AC, landline_ac.c_str());
    }

    string url = GET_FIXED_PHONE_PATH;
    FileLog("httprequest", "RequestAuthorizationController::GetFixedPhone( "
                           "url : %s, "
                           "landline : %s, "
                           "telephone_cc : %d, "
                           "landline_ac : %s, "
                           ")",
            url.c_str(),
            landline.c_str(),
            telephone_cc,
            landline_ac.c_str());

    return StartRequest(url, entiy, this);
}
/**
 * 2.6.手机获取认证短信
 * @param telephone            电话号码
 * @param telephone_cc        国家区号,参考参考数组<CountryArray>
 * @param device_id            设备唯一标识
 * @return                    请求唯一标识
 */
long RequestAuthorizationController::GetSms(string telephone, int telephone_cc, string device_id) {
    HttpEntiy entiy;

    if (telephone.length() > 0) {
        entiy.AddContent(AUTHORIZATION_TELEPHONE, telephone.c_str());
    }

    string strCountry = GetCountryCode(telephone_cc);
    if (!strCountry.empty()) {
        entiy.AddContent(AUTHORIZATION_TELEPHONE_CC, strCountry.c_str());
    }

    if (device_id.length() > 0) {
        entiy.AddContent(AUTHORIZATION_DEVICE_ID, device_id.c_str());
    }

    string url = GET_SMS_PATH;
    FileLog("httprequest", "RequestAuthorizationController::GetSms( "
                           "url : %s, "
                           "telephone : %s, "
                           "telephone_cc : %d, "
                           "device_id : %s, "
                           ")",
            url.c_str(),
            telephone.c_str(),
            telephone_cc,
            device_id.c_str());

    return StartRequest(url, entiy, this);
}
Пример #3
0
QString MythLocale::GetNativeCountry(void) const
{
    return GetISO3166CountryName(GetCountryCode());
}
Пример #4
0
QString MythLocale::GetCountry() const
{
    return GetISO3166EnglishCountryName(GetCountryCode());
}
Пример #5
0
wxString AIS_Target_Data::GetRolloverString( void )
{
    wxString result;
    wxString t;
    if( b_nameValid ) {
        result.Append( _T("\"") );
        result.Append( GetFullName() );
        result.Append( _T("\" ") );
    }
    if( Class != AIS_GPSG_BUDDY ) {
        t.Printf( _T("%09d"), abs( MMSI ) );
        result.Append( t );
        result.Append( _T(" ") );
        result.Append( GetCountryCode(false) );
    }
    t = trimAISField( CallSign );
    if( t.Len() ) {
        result.Append( _T(" (") );
        result.Append( t );
        result.Append( _T(")") );
    }
    if( g_bAISRolloverShowClass || ( Class == AIS_SART ) ) {
        if( result.Len() ) result.Append( _T("\n") );
        result.Append( _T("[") );
        if( Class == AIS_ATON ) {
            result.Append( wxGetTranslation( Get_class_string( true ) ) );
            result.Append(_T(": "));
            result.Append( wxGetTranslation( Get_vessel_type_string( false ) ) );
        }
        else if(b_SarAircraftPosnReport)
            result.Append(_("SAR Aircraft"));
        else
            result.Append( wxGetTranslation( Get_class_string( false ) ) );
        
        result.Append( _T("] ") );
        if( ( Class != AIS_ATON ) && ( Class != AIS_BASE ) ) {
            if( Class == AIS_SART ) {
                int mmsi_start = MMSI / 1000000;
                switch( mmsi_start ){
                    case 970:
                        break;
                    case 972:
                        result += _T("MOB");
                        break;
                    case 974:
                        result += _T("EPIRB");
                        break;
                    default:
                        result += _("Unknown");
                        break;
                }
            }

            if( Class != AIS_SART ) {
                if( !b_SarAircraftPosnReport )
                    result.Append( wxGetTranslation( Get_vessel_type_string( false ) ) );
            }

            if( ( Class != AIS_CLASS_B ) && ( Class != AIS_SART ) && !b_SarAircraftPosnReport) {
                if( ( NavStatus <= 15 ) && ( NavStatus >= 0 ) ) {
                    result.Append( _T(" (") );
                    result.Append(wxGetTranslation(ais_get_status(NavStatus)));
                    result.Append( _T(")") );
                }
            } else if( Class == AIS_SART ) {
                result.Append( _T(" (") );
                if( NavStatus == RESERVED_14 ) result.Append( _("Active") );
                else if( NavStatus == UNDEFINED ) result.Append( _("Testing") );

                result.Append( _T(")") );
            }

        }
    }

    if( g_bAISRolloverShowCOG && (( SOG <= 102.2 ) || b_SarAircraftPosnReport) 
            && ( ( Class != AIS_ATON ) && ( Class != AIS_BASE ) ) ) {
        if( result.Len() ) result << _T("\n");
        
        double speed_show = toUsrSpeed( SOG );
        if( speed_show < 10.0 )
            result << wxString::Format( _T("SOG %.2f "), speed_show ) << getUsrSpeedUnit() << _T(" ");
        else if( speed_show < 100.0 )
            result << wxString::Format( _T("SOG %.1f "), speed_show ) << getUsrSpeedUnit() << _T(" ");
        else
            result << wxString::Format( _T("SOG %.0f "), speed_show ) << getUsrSpeedUnit() << _T(" ");
        
        int crs = wxRound( COG );
        if( b_positionOnceValid ) {
            if( crs < 360 ) {
                if( g_bShowMag )
                    result << wxString::Format( wxString("COG %03d°(M)  ", wxConvUTF8 ), (int)gFrame->GetTrueOrMag( crs ) );
                else
                    result << wxString::Format( wxString("COG %03d°  ", wxConvUTF8 ), (int)gFrame->GetTrueOrMag( crs ) );
            }
                
            else if( COG == 360.0 )
                result << _(" COG Unavailable");
            else if( crs == 360 )
                result << wxString( " COG 000°", wxConvUTF8 );
        } else
            result << _(" COG Unavailable");
    }

    if( g_bAISRolloverShowCPA && bCPA_Valid ) {
        if( result.Len() ) result << _T("\n");
        result << _("CPA") << _T(" ") << cc1->FormatDistanceAdaptive( CPA )
        << _T(" ") << _("in") << _T(" ")
        << wxString::Format( _T("%.0f"), TCPA ) << _T(" ") << _("min");
    }
    return result;
}
Пример #6
0
wxString AIS_Target_Data::BuildQueryResult( void )
{
    wxString html;
    wxDateTime now = wxDateTime::Now();

    wxString tableStart = _T("\n<table border=0 cellpadding=1 cellspacing=0>\n");
    wxString tableEnd = _T("</table>\n\n");
    wxString rowStart = _T("<tr><td><font size=-2>");
    wxString rowStartH = _T("<tr><td nowrap>");
    wxString rowSeparator = _T("</font></td><td></td><td><b>");
    wxString rowSeparatorH = _T("</td><td></td><td>");
    wxString colSeparator = _T("<td></td>");
    wxString rowEnd = _T("</b></td></tr>\n");
    wxString vertSpacer = _T("<tr><td></td></tr><tr><td></td></tr><tr><td></td></tr>\n\n");

    wxString IMOstr, MMSIstr, ClassStr;

    html << tableStart << _T("<tr><td nowrap colspan=2>");
    if( /*( Class != AIS_BASE ) &&*/ ( Class != AIS_SART ) ) {
        if( b_nameValid ) {
            html << _T("<font size=+2><i><b>") << GetFullName() ;
            html << _T("</b></i></font>&nbsp;&nbsp;<b>");
        }
    }

    if( ( Class != AIS_ATON ) && ( Class != AIS_BASE ) && ( Class != AIS_GPSG_BUDDY )
            && ( Class != AIS_SART ) ) {
        html << trimAISField( CallSign ) << _T("</b>") << rowEnd;

        if( Class != AIS_CLASS_B ) {
            if( IMO > 0 ) IMOstr = wxString::Format( _T("%08d"), abs( IMO ) );
        }
    }
    else html << _T("</b>") << rowEnd;

    html << vertSpacer;

    if( Class != AIS_GPSG_BUDDY ) {
        MMSIstr = wxString::Format( _T("%09d"), abs( MMSI ) );
    }
    ClassStr = wxGetTranslation( Get_class_string( false ) );
    
    if( Class == AIS_ATON ) {
        wxString cls(_T("AtoN: ") );
        cls += Get_vessel_type_string(false);
        ClassStr = wxGetTranslation( cls );
    }
    
    if(b_SarAircraftPosnReport)
        ClassStr = _("SAR Aircraft");

    if( IMOstr.Length() )
        html << _T("<tr><td colspan=2><table width=100% border=0 cellpadding=0 cellspacing=0>")
            << rowStart <<_("MMSI") << _T("</font></td><td>&nbsp;</td><td><font size=-2>")
            << _("Class") << _T("</font></td><td>&nbsp;</td><td align=right><font size=-2>")
            << _("IMO") << _T("</font></td></tr>")
            << rowStartH << _T("<b>") << MMSIstr << _T("</b></td><td>&nbsp;</td><td><b>")
            << ClassStr << _T("</b></td><td>&nbsp;</td><td align=right><b>")
            << IMOstr << rowEnd << _T("</table></td></tr>");

    else
       html << _T("<tr><td colspan=2><table width=100% border=0 cellpadding=0 cellspacing=0>")
            << rowStart <<_("MMSI") << _T("</font></td><td>&nbsp;</td><td align=right><font size=-2>")
            << _("Class") << _T("</font></td></tr>")
            << rowStartH << _T("<b>") << MMSIstr << _T("</b></td><td>&nbsp;</td><td align=right><b>")
            << ClassStr << rowEnd << _T("</table></td></tr>");

    if((Class != AIS_SART ) && ( Class != AIS_BASE ) && ( Class != AIS_DSC ) ) 
        html << _T("<tr><td colspan=2><table width=100% border=0 cellpadding=0 cellspacing=0>")
             << rowStart << _("Flag") << rowEnd << _T("</font></td></tr>")
             << rowStartH << _T("<b>")<< GetCountryCode(true) << rowEnd << _T("</table></td></tr>");
    
    html << vertSpacer;

    wxString navStatStr;
    if( ( Class != AIS_BASE ) && ( Class != AIS_CLASS_B ) && ( Class != AIS_SART ) ) {
        if( ( NavStatus <= 21  ) && ( NavStatus >= 0 ) )
            navStatStr = wxGetTranslation(ais_get_status(NavStatus));
    } else if( Class == AIS_SART ) {
        if( NavStatus == RESERVED_14 ) navStatStr = _("Active");
        else if( NavStatus == UNDEFINED ) navStatStr = _("Testing");
    }

    wxString sart_sub_type;
    if( Class == AIS_SART ) {
        int mmsi_start = MMSI / 1000000;
        switch( mmsi_start ){
            case 970:
//                sart_sub_type = _T("SART");
                break;
            case 972:
                sart_sub_type = _T("MOB");
                break;
            case 974:
                sart_sub_type = _T("EPIRB");
                break;
            default:
                sart_sub_type = _("Unknown");
                break;
        }
    }

    wxString AISTypeStr, UNTypeStr, sizeString;
    if( ( Class != AIS_BASE ) && ( Class != AIS_SART ) && ( Class != AIS_DSC ) ) {

        //      Ship type
        AISTypeStr = wxGetTranslation( Get_vessel_type_string() );

        if( b_isEuroInland && UN_shiptype ) {
            ERIShipTypeHash::iterator it = s_ERI_hash.find( UN_shiptype );
            wxString type;
            if( it == s_ERI_hash.end() ) type = _("Undefined");
            else
                type = it->second;

            UNTypeStr = wxGetTranslation( type );
        }

        if( b_SarAircraftPosnReport ){
            AISTypeStr.Clear();
            UNTypeStr.Clear();
            navStatStr.Clear();
        }
            
            
        if( Class == AIS_SART ) {
            if( MSG_14_text.Len() ) {
                html << rowStart << _("Safety Broadcast Message") << rowEnd
                    << rowStartH << _T("<b>") << MSG_14_text << rowEnd;
            }
        }

       //  Dimensions

        if( NavStatus != ATON_VIRTUAL && Class != AIS_ARPA && Class != AIS_APRS ) {
            if( ( Class == AIS_CLASS_B ) || ( Class == AIS_ATON ) ) {
                sizeString = wxString::Format( _T("%dm x %dm"), ( DimA + DimB ), ( DimC + DimD ) );
            } else if(!b_SarAircraftPosnReport) {
                if( ( DimA + DimB + DimC + DimD ) == 0 ) {
                    if( b_isEuroInland ) {
                        if( Euro_Length == 0.0 ) {
                            if( Euro_Draft > 0.01 ) {
                                sizeString << wxString::Format( _T("---m x ---m x %4.1fm"), Euro_Draft );
                            } else {
                                sizeString << _T("---m x ---m x ---m");
                            }
                        } else {
                            if( Euro_Draft > 0.01 ) {
                                sizeString
                                        << wxString::Format( _T("%5.1fm x %4.1fm x %4.1fm"), Euro_Length,
                                                Euro_Beam, Euro_Draft );
                            } else {
                                sizeString
                                        << wxString::Format( _T("%5.1fm x %4.1fm x ---m\n\n"), Euro_Length,
                                                Euro_Beam );
                            }
                        }
                    } else {
                        if( Draft > 0.01 ) {
                            sizeString << wxString::Format( _T("---m x ---m x %4.1fm"), Draft );
                        } else {
                            sizeString << _T("---m x ---m x ---m");
                        }
                    }
                } else if( Draft < 0.01 ) {
                    sizeString
                            << wxString::Format( _T("%dm x %dm x ---m"), ( DimA + DimB ), ( DimC + DimD ) );
                } else {
                    sizeString
                            << wxString::Format( _T("%dm x %dm x %4.1fm"), ( DimA + DimB ), ( DimC + DimD ),
                                    Draft );
                }
            }
        }
    }

    if( Class == AIS_SART ) {
        html << _T("<tr><td colspan=2>") << _T("<b>") << AISTypeStr;
        if( sart_sub_type.Length() )
            html << _T(" (") << sart_sub_type << _T("), ");
        html << navStatStr;
        html << rowEnd << _T("<tr><td colspan=2>") << _T("<b>") << sizeString << rowEnd;
    }

    else if( Class == AIS_ATON )  {
        html << _T("<tr><td colspan=2>") << _T("<b>") << navStatStr;
        html << rowEnd << _T("<tr><td colspan=2>") << _T("<b>") << sizeString << rowEnd;
    }
    
    else if( ( Class != AIS_BASE ) && ( Class != AIS_DSC ) ) {
        html << _T("<tr><td colspan=2>") << _T("<b>") << AISTypeStr;
        if( navStatStr.Length() )
            html << _T(", ") << navStatStr;
        if( UNTypeStr.Length() )
            html << _T(" (UN Type ") << UNTypeStr << _T(")");
        html << rowEnd << _T("<tr><td colspan=2>") << _T("<b>") << sizeString << rowEnd;
    }

    if( b_positionOnceValid ) {
        wxString posTypeStr;
        if( b_positionDoubtful ) posTypeStr << _(" (Last Known)");

        now.MakeGMT();
        int target_age = now.GetTicks() - PositionReportTicks;

        html << vertSpacer
             << rowStart << _("Position") << posTypeStr << _T("</font></td><td align=right><font size=-2>")
             << _("Report Age") << _T("</font></td></tr>")

             << rowStartH << _T("<b>") << toSDMM( 1, Lat ) << _T("</b></td><td align=right><b>")
             << FormatTimeAdaptive( target_age ) << rowEnd
             << rowStartH << _T("<b>") << toSDMM( 2, Lon ) << rowEnd;
    }

    wxString courseStr, sogStr, hdgStr, rotStr, rngStr, brgStr, destStr, etaStr;

    if( Class == AIS_GPSG_BUDDY ) {
        long month, year, day;
        m_date_string.Mid(0,2).ToLong(&day);
        m_date_string.Mid(2,2).ToLong(&month);
        m_date_string.Mid(4,2).ToLong(&year);
        wxDateTime date;
        date.SetDay(day);
        date.SetMonth((wxDateTime::Month)(month-1));
        date.SetYear(year + 2000);
        
        wxString f_date = date.FormatISODate();
        
        html << vertSpacer << rowStart << _("Report as of") << rowEnd
             << rowStartH << _T("<b>")
             << f_date + _T("</b> at <b>")
             << wxString::Format( _T("%d:%d UTC "), m_utc_hour, m_utc_min )
             << rowEnd;
    } else {
        if( Class == AIS_CLASS_A && !b_SarAircraftPosnReport ) {
            html << vertSpacer << rowStart << _("Destination")
                 << _T("</font></td><td align=right><font size=-2>")
                 << _("ETA (UTC)") << _T("</font></td></tr>\n")
                 << rowStartH << _T("<b>");
                 wxString dest =  trimAISField( Destination );
                 if(dest.Length() )
                     html << dest;
                 else
                     html << _("---");
                 html << _T("</b></td><td nowrap align=right><b>");

            if( ( ETA_Mo ) && ( ETA_Hr < 24 ) ) {
                int yearOffset = 0;
                if( now.GetMonth() > ( ETA_Mo - 1 ) ) yearOffset = 1;
                wxDateTime eta( ETA_Day, wxDateTime::Month( ETA_Mo - 1 ),
                        now.GetYear() + yearOffset, ETA_Hr, ETA_Min );
                html << eta.Format( _T("%b %d %H:%M") );
            }
            else html << _("---");
            html << rowEnd;
        }

        if( Class == AIS_CLASS_A || Class == AIS_CLASS_B || Class == AIS_ARPA || Class == AIS_APRS ) {
            int crs = wxRound( COG );
            if( crs < 360 ) {
                if( g_bShowMag )
                    courseStr << wxString::Format( wxString("%03d°(M)  ", wxConvUTF8 ), (int)gFrame->GetTrueOrMag( crs ) );
                else
                    courseStr << wxString::Format( wxString("%03d°  ", wxConvUTF8 ), (int)gFrame->GetTrueOrMag( crs ) );
            }   
            else if( COG == 360.0 )
                courseStr = _T("---");
            else if( crs == 360 )
                courseStr = _T("0&deg;");

            double speed_show = toUsrSpeed( SOG );
            
            if( ( SOG <= 102.2 ) || b_SarAircraftPosnReport ){
                if( speed_show < 10.0 )
                    sogStr = wxString::Format( _T("%.2f "), speed_show ) + getUsrSpeedUnit();
                else if( speed_show < 100.0 )
                    sogStr = wxString::Format( _T("%.1f "), speed_show ) + getUsrSpeedUnit();
                else
                    sogStr = wxString::Format( _T("%.0f "), speed_show ) + getUsrSpeedUnit();
            }
//                sogStr = wxString::Format( _T("%5.2f ") + getUsrSpeedUnit(), toUsrSpeed( SOG ) );
            else
                sogStr = _("---");

            if( (int) HDG != 511 )
                hdgStr = wxString::Format( _T("%03d&deg;"), (int) HDG );
            else
                hdgStr = _T("---");


            if( ROTAIS != -128 ) {
                if( ROTAIS == 127 ) rotStr << _T("> 5&deg;/30s ") << _("Right");
                else if( ROTAIS == -127 ) rotStr << _T("> 5&deg;/30s ") << _("Left");
                else {
                    if( ROTIND > 0 ) rotStr << wxString::Format( _T("%3d&deg;/Min "), ROTIND ) << _("Right");
                    else if( ROTIND < 0 ) rotStr << wxString::Format( _T("%3d&deg;/Min "), -ROTIND ) << _("Left");
                    else rotStr = _T("0");
                }
            }
            else if( !b_SarAircraftPosnReport )
                rotStr = _("---");
        }
    }

    if( b_positionOnceValid && bGPSValid && ( Range_NM >= 0. ) )
        rngStr = cc1->FormatDistanceAdaptive( Range_NM );
    else
        rngStr = _("---");

    int brg = (int) wxRound( Brg );
    if( Brg > 359.5 )
        brg = 0;
    if( b_positionOnceValid && bGPSValid && ( Brg >= 0. ) && ( Range_NM > 0. ) && ( fabs( Lat ) < 85. ) ){
        if( g_bShowMag )
            brgStr << wxString::Format( wxString("%03d°(M)  ", wxConvUTF8 ), (int)gFrame->GetTrueOrMag( Brg ) );
        else
            brgStr << wxString::Format( wxString("%03d°  ", wxConvUTF8 ), (int)gFrame->GetTrueOrMag( Brg ) );
    }   
    else
        brgStr = _("---");

    wxString turnRateHdr; // Blank if ATON or BASE or Special Position Report (9)
    if( ( Class != AIS_ATON ) && ( Class != AIS_BASE ) && ( Class != AIS_DSC ) ) {
        html << vertSpacer << _T("<tr><td colspan=2><table width=100% border=0 cellpadding=0 cellspacing=0>")
            << rowStart <<_("Speed") << _T("</font></td><td>&nbsp;</td><td><font size=-2>")
            << _("Course") << _T("</font></td><td>&nbsp;</td><td align=right><font size=-2>");
            if( !b_SarAircraftPosnReport )
                html << _("Heading") ;
            
            html << _T("</font></td></tr>")
            << rowStartH << _T("<b>") << sogStr << _T("</b></td><td>&nbsp;</td><td><b>")
            << courseStr << _T("</b></td><td>&nbsp;</td><td align=right><b>");
            if(!b_SarAircraftPosnReport)
                html << hdgStr;
            html  << rowEnd << _T("</table></td></tr>")
            << vertSpacer;
            
            if( !b_SarAircraftPosnReport )
            turnRateHdr = _("Turn Rate");
    }
    html << _T("<tr><td colspan=2><table width=100% border=0 cellpadding=0 cellspacing=0>")
        << rowStart <<_("Range") << _T("</font></td><td>&nbsp;</td><td><font size=-2>")
        << _("Bearing") << _T("</font></td><td>&nbsp;</td><td align=right><font size=-2>")
        << turnRateHdr << _T("</font></td></tr>")
        << rowStartH << _T("<b>") << rngStr << _T("</b></td><td>&nbsp;</td><td><b>")
        << brgStr << _T("</b></td><td>&nbsp;</td><td align=right><b>");
        if(!b_SarAircraftPosnReport)
            html << rotStr;
        html << rowEnd << _T("</table></td></tr>")
        << vertSpacer;

    if( bCPA_Valid ) {
        wxString tcpaStr;
        tcpaStr << _T("</b> ") << _("in ") << _T("</td><td align=right><b>") << FormatTimeAdaptive( (int)(TCPA*60.) );
                                                                  
        html<< /*vertSpacer << */rowStart << _T("<font size=-2>") <<_("CPA") << _T("</font>") << rowEnd
            << rowStartH << _T("<b>") << cc1->FormatDistanceAdaptive( CPA )
            << tcpaStr << rowEnd;
    }

    if( Class != AIS_BASE ) {
        if( blue_paddle == 1 ) {
            html << rowStart << _("Inland Blue Flag") << rowEnd
                 << rowStartH << _T("<b>") << _("Clear") << rowEnd;
        } else if( blue_paddle == 2 ) {
            html << rowStart << _("Inland Blue Flag") << rowEnd
                 << rowStartH << _T("<b>") << _("Set") << rowEnd;
        }
    }

    if(b_SarAircraftPosnReport) {
        wxString altStr;
        if(altitude != 4095) 
            altStr.Printf(_T("%4d m"), altitude );
        else
            altStr = _("Unknown");
            
        html    << rowStart <<_("Altitude") << _T("</font></td><td>&nbsp;</td><td><font size=-0>")
        << rowStartH << _T("<b>") << altStr << _T("</b></td><td>&nbsp;</td><td><b>")
        << rowEnd << _T("</table></td></tr>")
        << vertSpacer;
    }
    
    html << _T("</table>");
    return html;
}
Пример #7
0
void LadyDetail::Parse(Json::Value root) {
	if( root.isObject() ) {
		if( root[LADY_WOMAN_ID].isString() ) {
			womanid = root[LADY_WOMAN_ID].asString();
		}

		if( root[LADY_FIRST_NAME].isString() ) {
			firstname = root[LADY_FIRST_NAME].asString();
		}

		if( root[LADY_COUNTRY].isString() ) {
			country = root[LADY_COUNTRY].asString();
            countryIndex = GetCountryCode(country);
		}

		if( root[LADY_PROVINCE].isString() ) {
			province = root[LADY_PROVINCE].asString();
		}

		if( root[LADY_AGE].isInt() ) {
			age = root[LADY_AGE].asInt();
		}

		if( root[LADY_ZODIAC].isString() ) {
			zodiac = root[LADY_ZODIAC].asString();
		}

		if( root[LADY_WEIGHT].isString() ) {
			weight = root[LADY_WEIGHT].asString();
		}

		if( root[LADY_HEIGHT].isString() ) {
			height = root[LADY_HEIGHT].asString();
		}

		if( root[LADY_SMOKE].isString() ) {
			smoke = root[LADY_SMOKE].asString();
		}

		if( root[LADY_DRINK].isString() ) {
			drink = root[LADY_DRINK].asString();
		}

		if( root[LADY_ENGLISH].isString() ) {
			english = root[LADY_ENGLISH].asString();
		}

		if( root[LADY_RELIGION].isString() ) {
			religion = root[LADY_RELIGION].asString();
		}

		if( root[LADY_EDUCATION].isString() ) {
			education = root[LADY_EDUCATION].asString();
		}

		if( root[LADY_PROFESSION].isString() ) {
			profession = root[LADY_PROFESSION].asString();
		}

		if( root[LADY_CHILDREN].isString() ) {
			children = root[LADY_CHILDREN].asString();
		}

		if( root[LADY_MARRY].isString() ) {
			marry = root[LADY_MARRY].asString();
		}

		if( root[LADY_RESUME].isString() ) {
			resume = root[LADY_RESUME].asString();
		}

		if( root[LADY_AGE_RANGE_FROM].isInt() ) {
			age1 = root[LADY_AGE_RANGE_FROM].asInt();
		}

		if( root[LADY_AGE_RANGE_TO].isInt() ) {
			age2 = root[LADY_AGE_RANGE_TO].asInt();
		}

		if( root[LADY_ISONLINE].isInt() ) {
			isonline = (root[LADY_ISONLINE].asInt() == 0)?false:true;
		}

		if( root[LADY_ISFAVORITE].isInt() ) {
			isfavorite = (root[LADY_ISFAVORITE].asInt() == 0)?false:true;
		}

		if( root[LADY_LAST_UPDATE].isString() ) {
			last_update = root[LADY_LAST_UPDATE].asString();
		}

		if( root[LADY_SHOW_LOVECALL].isInt() ) {
			show_lovecall = root[LADY_SHOW_LOVECALL].asInt();
		}

		if( root[LADY_PHOTO_URL].isString() ) {
			photoURL = root[LADY_PHOTO_URL].asString();
		}

		if( root[LADY_MIN_PHOTO_URL].isString() ) {
			photoMinURL = root[LADY_MIN_PHOTO_URL].asString();
		}

		if( root[LADY_PHOTOURLLIST].isString() ) {
			string listString = root[LADY_PHOTOURLLIST].asString();
			photoList = StringHandle::split(listString, ",");
		}

		if( root[LADY_THUMBURLLIST].isString() ) {
			string listString = root[LADY_THUMBURLLIST].asString();
			thumbList = StringHandle::split(listString, ",");
		}

		if( root[LADY_VIDEOURLLIST].isArray() ) {
			for(int i = 0; i < root[LADY_VIDEOURLLIST].size(); i++ ) {
				VideoItem item;
				item.Parse(root[LADY_VIDEOURLLIST].get(i, Json::Value::null));
				videoList.push_back(item);
			}
		}

		if( root[LADY_PHOTOLOCKNUM].isInt() ) {
			photoLockNum = root[LADY_PHOTOLOCKNUM].asInt();
		}

		if( root[LADY_CAN_CAM].isInt() ) {
			int status = root[LADY_CAN_CAM].asInt();
			camStatus = (status == 1)?true:false;
		}
	}
}
/**
 * 2.2.注册帐号
 * @param email         电子邮箱
 * @param password      密码
 * @param male          性别, true:男性/false:女性
 * @param first_name    用户first name
 * @param last_name     用户last name
 * @param country       国家区号,参考数组<CountryArray>
 * @param birthday_y    生日的年
 * @param birthday_m    生日的月
 * @param birthday_d    生日的日
 * @param weeklymail    是否接收订阅
 * @param model         移动设备型号
 * @param deviceId      设备唯一标识
 * @param manufacturer  制造厂商
 * @param referrer      app推广参数(安装成功app第一次运行时GooglePlay返回)
 * @param afDeviceId    AppsFlyerSDK获取的设备Id
 * @param gaId          Google广告Id
 * @param activation    是否激活所有站点
 * @return              请求唯一标识
 */
long RequestAuthorizationController::Register(
    string email,
    string password,
    bool male,
    string first_name,
    string last_name,
    int country,
    string birthday_y,
    string birthday_m,
    string birthday_d,
    bool weeklymail,
    string model,
    string deviceId,
    string manufacturer,
    string referrer,
    string afDeviceId,
    string gaId,
    bool activation) {
    char temp[16];

    HttpEntiy entiy;
    entiy.SetSaveCookie(true);

    if (email.length() > 0) {
        entiy.AddContent(AUTHORIZATION_EMAIL, email.c_str());
    }

    if (password.length() > 0) {
        entiy.AddContent(AUTHORIZATION_PASSWORD, password.c_str());
    }

    if (male) {
        // 男人
        entiy.AddContent(AUTHORIZATION_GENDER, "M");
    } else {
        // 女人
        entiy.AddContent(AUTHORIZATION_GENDER, "F");
    }

    if (first_name.length() > 0) {
        entiy.AddContent(AUTHORIZATION_FIRST_NAME, first_name.c_str());
    }

    if (last_name.length() > 0) {
        entiy.AddContent(AUTHORIZATION_LAST_NAME, last_name.c_str());
    }

    string strCountry = GetCountryCode(country);
    if (!strCountry.empty()) {
        entiy.AddContent(AUTHORIZATION_COUNTRY, strCountry.c_str());
    }

    if (birthday_y.length() > 0) {
        entiy.AddContent(AUTHORIZATION_BIRTHDAY_Y, birthday_y.c_str());
    }

    if (birthday_m.length() > 0) {
        entiy.AddContent(AUTHORIZATION_BIRTHDAY_M, birthday_m.c_str());
    }

    if (birthday_d.length() > 0) {
        entiy.AddContent(AUTHORIZATION_BIRTHDAY_D, birthday_d.c_str());
    }

    sprintf(temp, "%s", weeklymail ? "true" : "false");
    entiy.AddContent(AUTHORIZATION_WEEKLY_MAIL, temp);

    if (model.length() > 0) {
        entiy.AddContent(AUTHORIZATION_MODEL, model.c_str());
    }

    if (deviceId.length() > 0) {
        entiy.AddContent(AUTHORIZATION_DEVICEID, deviceId.c_str());
    }

    if (manufacturer.length() > 0) {
        entiy.AddContent(AUTHORIZATION_MANUFACTURER, manufacturer.c_str());
    }

    if (referrer.length() > 0) {
        entiy.AddContent(AUTHORIZATION_UTMREFERRER, referrer.c_str());
    }

    if (afDeviceId.length() > 0) {
        entiy.AddContent(AUTHORIZATION_AF_DEVICEID, afDeviceId.c_str());
    }

    if (gaId.length() > 0) {
        entiy.AddContent(AUTHORIZATION_GAID, gaId.c_str());
    }

    // 是否激活所有站点
    sprintf(temp, "%d", activation ? 1 : 0);
    entiy.AddContent(AUTHORIZATION_ACTIVATION, temp);

    string url = REGISTER_PATH;
    FileLog("httprequest", "RequestAuthorizationController::Register( "
                           "url : %s, "
                           "email : %s, "
                           "password : %s, "
                           "first_name : %s, "
                           "last_name : %s, "
                           "country : %s, "
                           "birthday_y : %s, "
                           "birthday_m : %s, "
                           "birthday_d : %s, "
                           "weeklymail : %s, "
                           "model : %s, "
                           "deviceId : %s, "
                           "manufacturer : %s, "
                           "referrer : %s, "
                           "afDeviceId : %s, "
                           "gaId : %s, "
                           "activation : %d "
                           ")",
            url.c_str(),
            email.c_str(),
            password.c_str(),
            first_name.c_str(),
            last_name.c_str(),
            strCountry.c_str(),
            birthday_y.c_str(),
            birthday_m.c_str(),
            birthday_d.c_str(),
            weeklymail ? "true" : "false",
            model.c_str(),
            deviceId.c_str(),
            manufacturer.c_str(),
            referrer.c_str(),
            afDeviceId.c_str(),
            gaId.c_str());

    return StartRequest(url, entiy, this);
}