Changeset 11890 for extensions/PiwigoLib/PiwigoLib/Proxy
- Timestamp:
- Aug 2, 2011, 4:50:49 PM (13 years ago)
- Location:
- extensions/PiwigoLib/PiwigoLib/Proxy
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/PiwigoLib/PiwigoLib/Proxy/PwgImagesProxy.cs
r11872 r11890 15 15 16 16 /* 17 * pwg.images.add 18 * pwg.images.addChunk 17 * pwg.images.add pwg_images_add 18 * pwg.images.addChunk pwg_images_addChunk 19 19 * pwg.images.addComment 20 20 * pwg.images.addFile 21 * pwg.images.addSimple pwg_images_addSimple21 * pwg.images.addSimple pwg_images_addSimple 22 22 * pwg.images.checkFiles 23 23 * pwg.images.checkUpload 24 * pwg.images.delete pwg_images_delete24 * pwg.images.delete pwg_images_delete 25 25 * pwg.images.exist 26 * pwg.images.getInfo 26 * pwg.images.getInfo pwg_images_getInfos 27 27 * pwg.images.rate pwg_images_rate 28 28 * pwg.images.regenerateThumbnail … … 31 31 * pwg.images.setPrivacyLevel 32 32 * */ 33 34 static internal PwgBaseProxyReponse pwg_images_add(String fileGuid, String thunbGuid, String HighresGuid, 35 String imageGuid, String imageFilename, String imageName, String imageAuthor, DateTime creationDate, 36 String authorComment,List<String> lstCategories, List<String> lstTags, PwgConfidentLevelEnum? confidentLevel) 37 { 38 PwgBaseProxyReponse response = null; 39 try 40 { 41 StringBuilder data = new StringBuilder(); 42 data.Append("method=pwg.images.add"); 43 Boolean firstOcc = false; 44 PwgProxyReponseHelper.buildQueryFromValue<String>(fileGuid, "file_sum", ref firstOcc, data); 45 PwgProxyReponseHelper.buildQueryFromValue<String>(thunbGuid, "thumbnail_sum", ref firstOcc, data); 46 PwgProxyReponseHelper.buildQueryFromValue<String>(HighresGuid, "high_sum", ref firstOcc, data); 47 PwgProxyReponseHelper.buildQueryFromValue<String>(imageGuid, "original_sum", ref firstOcc, data); 48 PwgProxyReponseHelper.buildQueryFromValue<String>(imageFilename, "original_filename", ref firstOcc, data); 49 PwgProxyReponseHelper.buildQueryFromValue<String>(imageName, "name", ref firstOcc, data); 50 PwgProxyReponseHelper.buildQueryFromValue<String>(imageAuthor, "author", ref firstOcc, data); 51 PwgProxyReponseHelper.buildQueryFromValue<String>(authorComment, "comment", ref firstOcc, data); 52 PwgProxyReponseHelper.buildQueryFromArray<String>(lstCategories, "categories", ref firstOcc, data); 53 PwgProxyReponseHelper.buildQueryFromArray<String>(lstTags, "tag_ids", ref firstOcc, data); 54 PwgProxyReponseHelper.buildQueryFromValue<Int32>((int?)confidentLevel, "level", ref firstOcc, data); 55 PwgProxyReponseHelper.buildQueryFromValue<DateTime>(creationDate, "date_creation", ref firstOcc, data); 56 57 response = PwgGenericProxy<PwgBaseProxyReponse>.Post( 58 PwgConfigProxy.PwgServeurUri, 59 data.ToString()); 60 } 61 catch (Exception ex) 62 { 63 throw new PwgProxyException("pwg_images_rate", ex); 64 } 65 66 return response; 67 } 68 69 /// <summary> 70 /// pwg.images.addChunk 71 /// </summary> 72 /// <param name="strb64Data"></param> 73 /// <param name="uniqueId"></param> 74 /// <param name="fileType"></param> 75 /// <param name="?"></param> 76 /// <param name="chunckNumber"></param> 77 /// <returns></returns> 78 static internal PwgBaseProxyReponse pwg_images_addChunk(String strb64Data, String uniqueId, PwgFileTypeEnum fileType, Int32 chunckNumber ) 79 { 80 PwgBaseProxyReponse response = null; 81 try 82 { 83 84 StringBuilder data = new StringBuilder(); 85 data.Append("method=pwg.images.addChunk"); 86 Boolean firstOcc = false; 87 PwgProxyReponseHelper.buildQueryFromValue<String>(strb64Data, "data", ref firstOcc, data); 88 PwgProxyReponseHelper.buildQueryFromValue<String>(uniqueId, "original_sum", ref firstOcc, data); 89 PwgProxyReponseHelper.buildQueryFromValue<PwgFileTypeEnum>(fileType, "type", ref firstOcc, data); 90 PwgProxyReponseHelper.buildQueryFromValue<Int32>(chunckNumber, "position", ref firstOcc, data); 91 92 response = PwgGenericProxy<PwgBaseProxyReponse>.Post( 93 PwgConfigProxy.PwgServeurUri, 94 data.ToString()); 95 } 96 catch (Exception ex) 97 { 98 throw new PwgProxyException("pwg_images_rate", ex); 99 } 100 101 return response; 102 } 33 103 34 104 /// <summary> -
extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgImagesProxyResponse.cs
r11872 r11890 29 29 public String Stdev { get; set; } 30 30 } 31 31 32 32 33 [Serializable()] … … 62 63 [XmlArrayItem("category")] 63 64 public PwgCategoryProxyResponse[] Categories { get; set; } 64 65 65 } 66 66 … … 75 75 [Serializable()] 76 76 [XmlRoot(ElementName = "image")] 77 public class PwgImageInfoImageProxyResponse 77 public class PwgImageInfoImageProxyResponse : PwgImageProxyResponse 78 78 { 79 [XmlAttribute(AttributeName = "id")]80 public Int32 Id { get; set; }81 [XmlAttribute(AttributeName = "width")]82 public Int32 Width { get; set; }83 [XmlAttribute(AttributeName = "height")]84 public Int32 Height { get; set; }85 [XmlAttribute(AttributeName = "file")]86 public String File { get; set; }87 [XmlAttribute(AttributeName = "tn_url")]88 public String UrlThunb { get; set; }89 [XmlAttribute(AttributeName = "element_url")]90 public String UrlElement { get; set; }91 [XmlAttribute(AttributeName = "high_url")]92 public String UrlHighDef { get; set; }93 [XmlAttribute(AttributeName = "hit")]94 public Int64 Counter { get; set; }95 [XmlAttribute(AttributeName = "date_creation")]96 public String CreatingDate { get; set; }97 [XmlAttribute(AttributeName = "date_available")]98 public String AvailableDate { get; set; }99 [XmlAttribute(AttributeName = "tn_ext")]100 79 public String ExtThumbail { get; set; } 101 80 [XmlAttribute(AttributeName = "author")] … … 112 91 public Int32 ConfidentialLevel { get; set; } 113 92 [XmlAttribute(AttributeName = "md5sum")] 114 public String md Sum { get; set; }93 public String md5Sum { get; set; } 115 94 [XmlAttribute(AttributeName = "added_by")] 116 95 public Int32 UserIdAddedBy { get; set; } … … 118 97 [XmlElement("name")] 119 98 public String Name { get; set; } 120 121 [XmlArray("tags")]122 [XmlArrayItem("tag")]123 public PwgTagProxyResponse[] Tags { get; set; }124 125 [XmlArray("categories")]126 [XmlArrayItem("category")]127 public PwgCategoryProxyResponse[] Categories { get; set; }128 99 129 100 [XmlElement("rates")] … … 134 105 135 106 [XmlElement("comment_post")] 136 public PwgPostCommentSecurityInfo PostCommen SecurityData { get; set; }107 public PwgPostCommentSecurityInfo PostCommentSecurityData { get; set; } 137 108 } 138 109
Note: See TracChangeset
for help on using the changeset viewer.