gavinkwoe / BeeFramework

[Experimental] A semi-hybrid framework that allows you to create mobile apps using Objective-C and XML/CSS
MIT License
3.33k stars 1.06k forks source link

在json新增fileList,支持通过api方式post文件,目前支持jpg,png和NSData #119

Closed cdoky closed 9 years ago

cdoky commented 9 years ago

在json新增fileList,只有在POST的接口里面才会解析,eg //登陆 "POST /Interface/UserLogin": { "request": { "uEmail":"1", "uPwd":"2", }, "fileList": { "pic1":"{jpg}", "pic2":"{png}", "pic3":"{file}" }, "response": { "status":"100", "message":"", } },

//生成的代码如下 self.HTTP_POST( requestURI ).PARAM( "json" [self.req objectToDictionary] ).FILE_JPG(@"pic1", self.fileList.pic1).FILE(@"pic3", self.fileList.pic3).FILE_PNG(@"pic2", self.fileList.pic2);

//使用方法如下 API_INTERFACE_USERLOGIN *api = [API_INTERFACE_USERLOGIN apiWithResponder:self]; api.fileList.pic1 = [[UIImage alloc] init]; api.fileList.pic2 = [[UIImage alloc] init]; api.fileList.pic3 = [[NSData alloc] init];