This commit is contained in:
陈向学 2024-04-10 11:35:31 +08:00
parent 92ca42a217
commit 8a54726a2e
1 changed files with 71 additions and 69 deletions

View File

@ -45,6 +45,7 @@ public class MyManage : MonoBehaviour
SGUConfig config = new SGUConfig(); SGUConfig config = new SGUConfig();
SGUSdk.GetInstance().InitSDK(config); SGUSdk.GetInstance().InitSDK(config);
startMode = SGUSdk.GetInstance().GetAppStartMode(); startMode = SGUSdk.GetInstance().GetAppStartMode();
Debug.Log("启动信息:" + JsonConvert.SerializeObject(startMode));
//获取用户信息 //获取用户信息
HttpAuthService getUserInfo = new HttpAuthService(); HttpAuthService getUserInfo = new HttpAuthService();
@ -60,33 +61,35 @@ public class MyManage : MonoBehaviour
{ {
//考试 //考试
playModeEnum = PlayModeEnum.; playModeEnum = PlayModeEnum.;
HttpExamService getPractiseInfo = new HttpExamService(); Debug.Log("考试模式:" + startMode.examId);
ResponObject responObject = getPractiseInfo.PrepareExam(startMode.examId, userData.id); //HttpExamService getPractiseInfo = new HttpExamService();
if(responObject.code=="0") //ResponObject responObject = getPractiseInfo.GetExamQuestionList(startMode.examId);
{ //if(responObject.code=="0")
string data = responObject.data.ToString(); //{
Debug.Log("考生获取考试题目" + data); // string data = responObject.data.ToString();
} // Debug.Log("考生获取考试题目" + data);
else //}
{ //else
Debug.LogError("获取考试失败:" + responObject.msg); //{
} // Debug.LogError("获取考试失败:" + responObject.msg);
//}
} }
else if (startMode.practiseId > 0) else if (startMode.practiseId > 0)
{ {
//练习 //练习
playModeEnum = PlayModeEnum.; playModeEnum = PlayModeEnum.;
HttpPractiseService getPractiseInfo = new HttpPractiseService(); Debug.Log("练习模式:" + startMode.practiseId);
ResponObject responObject = getPractiseInfo.GetPractiseInfo(startMode.practiseId); //HttpPractiseService getPractiseInfo = new HttpPractiseService();
if(responObject.code=="0") //ResponObject responObject = getPractiseInfo.GetPractiseInfo(startMode.practiseId);
{ //if(responObject.code=="0")
string data = responObject.data.ToString(); //{
Debug.Log("GetPractiseInfo:" + data); // string data = responObject.data.ToString();
} // Debug.Log("GetPractiseInfo:" + data);
else //}
{ //else
Debug.LogError("获取练习失败:" + responObject.msg); //{
} // Debug.LogError("获取练习失败:" + responObject.msg);
//}
} }
} }
else else
@ -136,19 +139,19 @@ public class MyManage : MonoBehaviour
public void GetStartPractise() public void GetStartPractise()
{ {
//try //try
{ //{
HttpPractiseService getPractiseInfo = new HttpPractiseService(); //HttpPractiseService getPractiseInfo = new HttpPractiseService();
ResponObject responObject = getPractiseInfo.StartPractise(startMode.practiseId, userData.id); //ResponObject responObject = getPractiseInfo.StartPractise(startMode.practiseId, userData.id);
if(responObject.code=="0") //if(responObject.code=="0")
{ //{
string data = responObject.data.ToString(); // string data = responObject.data.ToString();
Debug.Log("开始练习:" + data); // Debug.Log("开始练习:" + data);
} //}
else //else
{ //{
Debug.LogError(responObject.msg); // Debug.LogError(responObject.msg);
} //}
} //}
//catch (System.Exception e) //catch (System.Exception e)
//{ //{
// throw; // throw;
@ -189,17 +192,17 @@ public class MyManage : MonoBehaviour
/// <param name="endTime"></param> /// <param name="endTime"></param>
public void GetEndPractise() public void GetEndPractise()
{ {
HttpPractiseService getPractiseInfo = new HttpPractiseService(); //HttpPractiseService getPractiseInfo = new HttpPractiseService();
ResponObject responObject = getPractiseInfo.EndPractise(startMode.practiseId, userData.id); //ResponObject responObject = getPractiseInfo.EndPractise(startMode.practiseId, userData.id);
if (responObject.code == "0") //if (responObject.code == "0")
{ //{
string data = responObject.data.ToString(); // string data = responObject.data.ToString();
Debug.Log("结束练习:" + data); // Debug.Log("结束练习:" + data);
} //}
else //else
{ //{
Debug.LogError(responObject.msg); // Debug.LogError(responObject.msg);
} //}
} }
/// <summary> /// <summary>
@ -209,17 +212,17 @@ public class MyManage : MonoBehaviour
/// <param name="userId"></param> /// <param name="userId"></param>
public void GetStartExam() public void GetStartExam()
{ {
HttpExamService getPractiseInfo = new HttpExamService(); //HttpExamService getPractiseInfo = new HttpExamService();
ResponObject responObject = getPractiseInfo.StartExam(startMode.examId, userData.id); //ResponObject responObject = getPractiseInfo.StartExam(startMode.examId, userData.id);
if (responObject.code == "0") //if (responObject.code == "0")
{ //{
string data = responObject.data.ToString(); // string data = responObject.data.ToString();
Debug.Log("开始考试:" + data); // Debug.Log("开始考试:" + data);
} //}
else //else
{ //{
Debug.LogError(responObject.msg); // Debug.LogError(responObject.msg);
} //}
} }
@ -256,18 +259,17 @@ public class MyManage : MonoBehaviour
/// <param name="userId"></param> /// <param name="userId"></param>
public void GetEndExam() public void GetEndExam()
{ {
HttpExamService getPractiseInfo = new HttpExamService(); //HttpExamService getPractiseInfo = new HttpExamService();
ResponObject responObject = getPractiseInfo.EndExam(startMode.examId, userData.id); //ResponObject responObject = getPractiseInfo.EndExam(startMode.examId, userData.id);
if (responObject.code == "0") //if (responObject.code == "0")
{ //{
string data = responObject.data.ToString(); // string data = responObject.data.ToString();
Debug.Log("结束考试:" + data); // Debug.Log("结束考试:" + data);
} //}
else //else
{ //{
Debug.LogError(responObject.msg); // Debug.LogError(responObject.msg);
} //}
} }
} }