global class UserData{
global String user_id;
global HobbyData hobby
}
global class HobbyData{
global String name;
global String level;
}
global class resultData{
global Integer success;
global UserData User;
global String request_time;
}
作成するときは以下のような感じで。
1234567891011121314151617181920
List<HobbyData> hobbies = new List<HobbyData>();
HobbyData hobby1 = new HobbyData();
hobby1.name = '映画';
hobby1.level = '3';
hobbies.add(hobby1);
HobbyData hobby2 = new HobbyData();
hobby2.name = 'サッカー';
hobby2.level = '1';
hobbies.add(hobby2);
UserData user = new UserData();
user.user_id = 'xxx';
user.hobby = hobbies;
resultData result = new resultData();
result.success = 1;
result.User = user;
result.request_time = '2015-3-27 12:33';
return result;