using LitJson;

namespace Wizard;

public class FriendUserSearchTask : BaseTask
{
	public class FriendUserSearchTaskParam : BaseParam
	{
		public int search_viewer_id;
	}

	public FriendUserSearchTask()
	{
		base.type = ApiType.Type.FriendUserSearch;
	}

	public void SetParameter(int search_viewer_id)
	{
		FriendUserSearchTaskParam friendUserSearchTaskParam = new FriendUserSearchTaskParam();
		friendUserSearchTaskParam.search_viewer_id = search_viewer_id;
		base.Params = friendUserSearchTaskParam;
	}

	protected override int Parse()
	{
		int num = base.Parse();
		if (num != 1)
		{
			return num;
		}
		Data.SearchUserInfo.Initizalize();
		JsonData jsonData = base.ResponseData["data"]["user_info"];
		if (jsonData.Count > 0)
		{
			Data.SearchUserInfo.data.user = new UserFriend(jsonData);
		}
		return num;
	}
}
