dataModel.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. //
  2. // dateModel.h
  3. // YiZanService
  4. //
  5. // Created by zzl on 15/3/19.
  6. // Copyright (c) 2015年 zywl. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. #import "GiftModel.h"
  11. @interface dataModel : NSObject
  12. @end
  13. @interface SAutoEx : NSObject
  14. - (id)initWithObj:(NSDictionary*)obj;
  15. - (void)fetchIt:(NSDictionary*)obj;
  16. @end
  17. //返回通用数据,,,
  18. @interface SResBase : SAutoEx
  19. +(SResBase*)shareClient;
  20. @property (nonatomic, assign) int msuccess;//是否成功了
  21. @property (nonatomic, assign) int mcode; //错误码
  22. @property (nonatomic, strong) NSString* mmsg; //客户端需要显示的提示信息,正确,失败,根据msuccess判断显示错误还是提示,
  23. @property (nonatomic, strong) NSString* mdebug;
  24. @property (nonatomic, strong) id mdata;
  25. @property (nonatomic, strong) void(^mg_pay_block)(SResBase*resb);
  26. +(SResBase*)infoWithOKString:(NSString*)msg;
  27. +(SResBase*)infoWithString:(NSString*)error;
  28. + (void)postReq:(NSString*)method ctl:(NSString*)ctl parm:(NSDictionary*)param block:(void(^)(SResBase* resb))block;
  29. + (NSDictionary*)postReqSync:(NSString*)method ctl:(NSString*)ctl parm:(NSDictionary*)param;
  30. @end
  31. @interface czModel: SAutoEx
  32. @property (nonatomic, assign) int mId;//"id": "3",
  33. @property (nonatomic, strong) NSString* mName;//": "钻石980",
  34. @property (nonatomic, assign) float mMoney;//": "98.00",
  35. @property (nonatomic, assign) float mDiamonds;//": "990"
  36. @property (nonatomic, assign) BOOL mBI;//输入的那种,,,
  37. @property (nonatomic, strong) NSString *mgift_coins_dec;
  38. + (void)getCZInfo:(void(^)(SResBase* resb,int yue,int rate,NSArray* czItems, NSArray* payItmes))block;
  39. @end
  40. @interface payMethodModel : SAutoEx
  41. @property (nonatomic, assign) int mId;
  42. @property (nonatomic, strong) NSString* mName;
  43. @property (nonatomic, strong) NSString* mLogo;
  44. @property (nonatomic, strong) NSString* mClass_name;
  45. - (void)payIt:(czModel*)mode block:(void(^)(SResBase* resb))block;
  46. @end
  47. @class musiceModel;
  48. @protocol musicDownloadDelegate <NSObject>
  49. @optional
  50. - (void)musicDownloading:(musiceModel*)obj context:(id)context needstop:(BOOL*)needstop;
  51. @end
  52. @interface musiceModel : SAutoEx
  53. @property (nonatomic, strong) NSString *id;
  54. @property (nonatomic, strong) NSString *url;///音乐下载地址
  55. //@property (nonatomic, strong) NSString *mLrc_content;//,//内容
  56. @property (nonatomic, strong) NSString *title;//歌曲名
  57. @property (nonatomic, strong) NSString *user_name;//,//演唱者
  58. @property (nonatomic, strong) NSString * music_time;
  59. //@property (nonatomic, strong) NSString *mFilePath;
  60. //@property (nonatomic, copy) NSString *has_next;//是否有下一页
  61. - (NSString *)getFullFilePath;
  62. //下面的不需要保存
  63. @property (nonatomic, assign) int mmFileStatus;//0 没有下载,1 已经下载,2下载中...
  64. @property (nonatomic, assign) int mmPecent;//下载进度 00--100
  65. @property (nonatomic, strong) NSString* mmDownloadInfo;
  66. @property (nonatomic, weak) id<musicDownloadDelegate> mmDelegate;
  67. @property (nonatomic, weak) UITableViewCell* mmUIRef;
  68. - (void)startDonwLoad:(id)context;
  69. - (NSString *)getTimeLongStr;
  70. @property (nonatomic, strong) NSIndexPath* mmRefUICellIndexPath;
  71. //从我的歌曲列表里面删除这个
  72. - (void)delThis:(void(^)(SResBase* resb))block;
  73. //清除本地歌曲缓存,不会删除列表,情理缓存的时候使用
  74. + (BOOL)clearLocalSave;
  75. //返回本地文件的总大小,,in byte
  76. + (int)getLocatDataSize;
  77. //获取搜索历史记录
  78. + (NSArray*)getSearchHistory;
  79. //删除历史记录
  80. + (void)deleteHistory:(NSInteger )indexPath;
  81. //搜索歌曲
  82. + (void)searchMuisc:(NSString*)keywords page:(int)page block:(void(^)(SResBase* resb, NSArray* all ))block;
  83. //获取我的音乐列表
  84. //+ (void)getMyMusicList:(int)page block:(void(^)(SResBase* resb, NSArray* all ))block;
  85. //获取本地音乐
  86. + (void)getLocalMusic:(int)page block:(void(^)(SResBase* resb, NSArray* all ))block;
  87. //添加歌曲到列表
  88. - (void)addThisToMyList:(void(^)(SResBase* resb))block;
  89. + (void)getMyMusicList:(int)page search:(NSString*)search block:(void(^)(SResBase* resb, NSArray* all ))block;
  90. @end