diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 3f560f3..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,927 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - DEFINITION_ORDER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - project - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1482659541785 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/AllTestCase/testcase1.txt b/AllTestCase/testcase1.txt index 768337a..01e87e6 100644 --- a/AllTestCase/testcase1.txt +++ b/AllTestCase/testcase1.txt @@ -8,9 +8,28 @@ 用户之间的评论私信会与用户对应,是否会出现信息混淆的现象。是否会不能评论或不能发私信。 5.报名信息 组团活动报名,失物招领领取是否会随着有人报名而及时更新,发布人是否也可以看到这些信息。 -6.评论发送 +6.评论以及动态发送 输入评论后是否按回车可以直接发送,输入空白的是否会发送? + 是否输入空白依然可以发送我的动态? 7.图片上传 正常的图片上传后是否会模糊 图片所能使用的格式 - 图片上传后是否会出现断裂、压缩、丢失,或无法显示。 \ No newline at end of file + 图片上传后是否会出现断裂、压缩、丢失,或无法显示。 +8.删除 + 所发表的内容、评论以及私信,在删除后是否会彻底消失,还是依然存在。 +9.文字显示 + 发表的内容文字过多时,是否会排版错误,显示错误。 +10.文本字符 + 字符判断,手机号只能输入数字。 +11.翻页 + 翻页时,没有加载数据为空,第二页数据没有请求 + 翻页时,一直重复请求第一页的数据 + 翻页时,没有图片的内容有时候会引用有图片的内容 +12.截止时间 + 组团活动超过截止时间之后,是否会显示停止报名。 +13.个人资料 + 用户修改个人资料后资料是否进行保存,头像是否有变化。 +14.导航功能 + 界面的各导航模块可以实现正确的导航,是否会出现导航错乱的现象。 +15.退出 + 用户点击退出之后,是否会退出当前帐号,并回到登陆界面重新进行登录。 \ No newline at end of file diff --git a/app/controllers/chat_controller.rb b/app/controllers/chat_controller.rb index e4286ad..f08f138 100644 --- a/app/controllers/chat_controller.rb +++ b/app/controllers/chat_controller.rb @@ -31,9 +31,9 @@ class ChatController < ApplicationController create_time: save_time, readed: false) if msg_db.save - render json: {username: username, userpic: userpic, content: msg, time: save_time} + render json: {username: username, userpic: userpic, content: msg, time: get_strftime(save_time)} else - render json: {username: username, userpic: userpic, content: "error", time: save_time} + render json: {username: username, userpic: userpic, content: "error", time: get_strftime(save_time)} end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 28a9a8a..7fed9aa 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,8 +1,8 @@ module ApplicationHelper - def utc_time_to_local utctime + def get_strftime intime # 将数据库中的UTC时间转换为本地时间 - return utctime.localtime.strftime(format='%F %T') + return intime.localtime.strftime(format='%F %T') end end diff --git a/app/helpers/chat_helper.rb b/app/helpers/chat_helper.rb index aea59f3..ee84c9b 100644 --- a/app/helpers/chat_helper.rb +++ b/app/helpers/chat_helper.rb @@ -43,12 +43,12 @@ module ChatHelper messages.each do |message| if message.send_user == user.id x = {issend: true, name: user.name, userpic: user.picurl, - content: message.content, time: utc_time_to_local(message.create_time)} + content: message.content, time: get_strftime(message.create_time)} else message.readed = true message.save x = {issend: false, name: chat_with.name, userpic: chat_with.picurl, - content: message.content, time: utc_time_to_local(message.create_time)} + content: message.content, time: get_strftime(message.create_time)} end results << x end diff --git a/app/helpers/main_helper.rb b/app/helpers/main_helper.rb index f1adda2..5d36b0d 100644 --- a/app/helpers/main_helper.rb +++ b/app/helpers/main_helper.rb @@ -21,7 +21,7 @@ module MainHelper else x["type"] = "新鲜事" end - x["time"] = utc_time_to_local(micro_post.post_time) + x["time"] = get_strftime(micro_post.post_time) x["pics"] = micro_post.pic.split(',') if micro_post.pic x["peo_num"] = micro_post.engage_people micro_posts_array << x @@ -50,7 +50,7 @@ module MainHelper else x["type"] = "新鲜事" end - x["time"] = utc_time_to_local(micro_post.post_time) + x["time"] = get_strftime(micro_post.post_time) x["pics"] = micro_post.pic.split(',') if micro_post.pic x["peo_num"] = micro_post.engage_people micro_posts_array << x diff --git a/app/helpers/micro_posts_helper.rb b/app/helpers/micro_posts_helper.rb index b76acc7..53ed12d 100644 --- a/app/helpers/micro_posts_helper.rb +++ b/app/helpers/micro_posts_helper.rb @@ -21,7 +21,7 @@ module MicroPostsHelper else x["type"] = "新鲜事" end - x["time"] = utc_time_to_local(micro_post.post_time) + x["time"] = get_strftime(micro_post.post_time) x["pics"] = micro_post.pic.split(',') if micro_post.pic x["peo_num"] = micro_post.engage_people micro_posts_array << x @@ -35,7 +35,8 @@ module MicroPostsHelper FileUtils.mkdir_p(@@micro_posts_dir) end ext = File.extname(pic.original_filename) - save_name = Digest::MD5::hexdigest(pic.original_filename) + ext + timestamp = Time.now.to_s + save_name = Digest::MD5::hexdigest(pic.original_filename + timestamp) + ext File.open(File.join(@@micro_posts_dir, save_name), 'wb') { |f| f.write(pic.read) } return save_name end diff --git a/config/application.rb b/config/application.rb index 086705c..94d17ee 100644 --- a/config/application.rb +++ b/config/application.rb @@ -11,5 +11,6 @@ module GuorenPro # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. + config.time_zone = 'Beijing' end end diff --git a/db/development.sqlite3 b/db/development.sqlite3 deleted file mode 100644 index 437f6dd..0000000 Binary files a/db/development.sqlite3 and /dev/null differ diff --git a/高级软件工程TODOList.md b/高级软件工程TODOList.md index 75ce3db..b323e6b 100644 --- a/高级软件工程TODOList.md +++ b/高级软件工程TODOList.md @@ -1,11 +1,10 @@ # 张裕 ------------------------ -分页功能 张裕 -简单的组团、失物招领动态 张裕 -网站整体时间修改 张裕 -动态排行榜(评论数、组团人数) 张裕 -用户个人动态的评论显示 尹 -用户个人动态的删除 尹 +分页功能 张裕 完成 +简单的组团、失物招领动态 张裕 完成 -- 失物招领自动联系人! +网站整体时间修改 张裕 --完成 javascript时间 网站本地时间 +用户个人动态的评论显示 +用户个人动态的删除 # 朱京乔 ------------------------