|
@@ -56,12 +56,35 @@ namespace GFGGame
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ //获取图片的临时上传地址协议
|
|
|
+ public static async ETTask<object[]> ReqTempPictureUrl()
|
|
|
+ {
|
|
|
+ ViewManager.Show<ModalStatusView>("上传中...");
|
|
|
+
|
|
|
+ S2C_GetTempPictureUrl response = null;
|
|
|
+ response = (S2C_GetTempPictureUrl)await MessageHelper.SendToServer(new C2S_GetTempPictureUrl() { PictureType = (int)PictureType.jpg });
|
|
|
+
|
|
|
+ if (response != null)
|
|
|
+ {
|
|
|
+ if (response.Error == ErrorCode.ERR_Success)
|
|
|
+ {
|
|
|
+ return new object[] { response.TempPictureUrl, response.PictureId };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ViewManager.Hide<ModalStatusView>();
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("获取上传地址失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ return null;
|
|
|
+ }
|
|
|
//保存成功后,添加图片至相册
|
|
|
- public static async ETTask<long> ReqAddTophoto(string pictureObjectPath, int sourceType)
|
|
|
+ public static async ETTask<long> ReqAddTophoto(long pictureId)
|
|
|
{
|
|
|
|
|
|
S2C_AddPicture response = null;
|
|
|
- response = (S2C_AddPicture)await MessageHelper.SendToServer(new C2S_AddPicture() { PictureObjectPath = pictureObjectPath, SourceType = sourceType });
|
|
|
+ response = (S2C_AddPicture)await MessageHelper.SendToServer(new C2S_AddPicture() { PictureId = pictureId });
|
|
|
|
|
|
ViewManager.Hide<ModalStatusView>();
|
|
|
|
|
@@ -75,7 +98,7 @@ namespace GFGGame
|
|
|
photoData.ToppingStatus = response.PictureInfo.ToppingStatus;
|
|
|
photoData.LockingStatus = response.PictureInfo.LockingStatus;
|
|
|
photoData.PictureTempUrl = response.PictureInfo.PictureTempUrl;
|
|
|
- PoemPhotoDataManager.Instance.Add(photoData, sourceType);
|
|
|
+ PoemPhotoDataManager.Instance.Add(photoData, (int)PictureSourceType.PersonalAlbum);
|
|
|
EventAgent.DispatchEvent(ConstMessage.POEM_PHOTO_INFOS_CHANGE);
|
|
|
PromptController.Instance.ShowFloatTextPrompt("已保存至相册");
|
|
|
|