wiki:entity

Version 19 (modified by leijingtang, 14 years ago) (diff)

--

图集(Album):

name : NSString 名称

author : NSString 作者

type : NSString 分类

cover : NSString 封面url

total : NSString 图片数量

origin_url : NSString 对应的web链接

theme : NSString 主题

location : NSString 拍摄地点

create_time : NSString 拍摄时间

nature : NSString 拍摄性质

vote : NSString 获票数

abstruct : NSString 作品概况

clicks : NSString 点击数

is_picked : BOOL 是否精华

+ template : NSString 分享的模板

photos : NSArray 该图集的所有图片

图片列表(PhotoList?) : 浏览大图用到的,与图集是不同的概念

count : NSInteger 图片数量

currentIdx : NSInteger 当前浏览的索引

photos : NSArray 用于浏览的图片列表

+ slideShowTimeInterval : CGFloat 这个应该直接读取app设置

  • (Photo *)getPhotoByIndex:(NSInteger)idx;
  • (void)appendPhoto:(Photo *)photo;
  • (NSArray *)selectPhotos:(NSArray *)originPhotos;

图片(Photo):

photo_id : NSString 图片id

album_id : NSString 从属的图集id

album_name : NSString 从属的图集名称

name : NSString 图片名称

big_photo_url : NSString 图片url

small_photo_url : NSString 小图url

is_picked : BOOL 是否精华

save_time : NSString 被保存的时间

ISO : NSString iso

exposure : NSString 曝光

aperture : NSString 光圈

shutter : NSString 快门

ev : NSString 曝光补偿

camera : NSString 相机

  • (void)is_saved;

评论(Comment):

user_id : NSString 评论者的太平洋通行证id

name : NSString 评论者名称

content : NSString 评论内容

create_time : NSString 发表时间

下载任务(DownloadTask?):

enum {loading, waiting, stopped, finished}State

state : State

save_time: NSString 启动下载的时间

album : Album 图集对象

downloaded_count : NSInteger 下载成功的图片数

total_count : NSInteger 该图集的图片数

failed_count : NSInteger 下载失败的图片数

loading_idx : NSInteger 该索引指向的图片为下载中

conn : NSURLConnection 某图片的链接对象

  • (void)start;
  • (void)stop;
  • (void)continue;
  • (void)notify;
  • (void)save;
  • (BOOL)isLoading;
  • (void)addPhoto:(Photo *)photo;
  • (void)deletePhotoAtIndex:(NSInteger)idx;

下载队列(DownloadQueue?):

@private

+ tasks : NSArray 元素为下载任务,下载完成之后将该元素序列化。

+ (void)startTaskAtIndex:(NSInteger)idx;

+ (void)stopTaskAtIndex:(NSInteger)idx;

+ (void)deleteTaskAtIndex:(NSInteger)idx;

+ (void)receiveSuccesNotify:(NSNotification *)noti;

+ (BOOL)isFull;

+ (BOOL)isLoading;

+ (void)notifyWhenDone; 是所有任务都下载的时候通知,还是没有等待中任务也通知?

+ (void)enqueue:(DownloadTask? *)task;

+ (void)dequeue;

关注的摄影师(FocusedPhotographer?):

@private

+ user_ids : NSArray 已关注的摄影师

+ (void)getAllPhotographers;

+ (BOOL)haveFocusedPhotographer:(NSString *)user_id;

摄影师(Photographer):

user_id : NSString 摄影师id

nickname: NSString 摄影师昵称

location : NSString 地区

title : NSString 摄影师头衔

拼图(PhotosCombintor?):

name : NSString 拼图的名称,默认是“新建图片_idx”

selected_photos : NSArray 包含的图片数组,在数组中的顺序决定了该图片在模板中的位置

remain_count : NSInteger 剩余能选择的图片数量

template : NSArray 模板名称,每次删除或者添加了selected_photos的元素都应该刷新该属性

  • (void)refreshData;
  • (void)refreshView;
  • (void)saveImage;
  • (void)replacePhotoAtIndex:(NSInteger)idx withPhoto:(Photo *)photo;
  • (void)deletePhotoAtIndex:(NSInteger)idx;

模板信息(TemplateInfo?):

+ templates_types : NSArray 二维数组,元素是一系列同类型的模板。所谓同类型指的是能容纳同样数量图片的模板。

+ current_templates : NSArray 该数组的元素是一个字典,包含了一个template和一张缩略图。

+ (NSArray *)getTemplatesByImageCount:(NSInteger)count;

+ (NSArray *)getTemplateAtIndex:(NSInteger)idx;

+ (NSArray *)generateTemplatesWithConfig:(NSDictionary *)config;

已保存界面(save_6)和拼图(pintu_8)的本地存储结构:

- documents/
            - save/
                   - images/
                            - photo/
                            - album/
                   - classes/
                             - photo/
                             - album/

首页(homepage_1)的存储结构。jsons文件夹存储首页下载的所有json文件;albums文件夹存储了首页下载的所有图集封面图片,全部以album-id命名。每次更新完jsons都要删除掉过期的图片,也就是说删除掉jsons里没有提到的album封面。

- documents/
            - home/
                    - jsons/
                    - albums/
                             - picks/
                             - portrait/
                             ......