-
Notifications
You must be signed in to change notification settings - Fork 2
用户错误报告服务端实现
Kaid Wong edited this page Feb 17, 2014
·
16 revisions
API名称: 程序异常的提交
使用范围: 被移动客户端调用
请求:
url: /api/sbmit_exception
请求类型: POST
参数:
version: x.x.x # 当前客户端软件版本号
datetime: 1392621238074 # 时间戳信息
# 时间戳信息相当于ruby里的 Time.now.to_i
# java 里面获取时间戳的方式可以参考 http://yunnick.iteye.com/blog/1074495
user_id: xx # 服务端 users 表的 id
device_name: xx # 对应API Build.MODEL
sdk_version: xx # 对应API Build.VERSION.SDK
os_release_version: xx # 对应API Build.VERSION.RELEASE
other_device_info: json_str # 对应API Build 类的其他常量
exception_type: xx # 抛出异常的类的完整包名和类名
exception_stack: xx # 抛出异常的完整堆栈信息
后台处理:
记录传递过来的数据到 mongodb 的数据表
响应:
HTTP status:200
空字符串
API名称: 用户反馈的提交
使用范围: 被移动客户端调用
请求:
url: /api/sbmit_feedback
请求类型: POST
参数:
version: x.x.x # 当前客户端软件版本号
datetime: 1392621050 # Time.now.to_i
user_id: xx
device_name: xx # 对应API Build.MODEL
sdk_version: xx # 对应API Build.VERSION.SDK
os_release_version: xx # 对应API Build.VERSION.RELEASE
other_device_info: json_str # 对应API Build 类的其他常量
feedback: 用户反馈内容
后台处理:
记录传递过来的数据到 mongodb 的数据表
响应:
HTTP status:200
空字符串
移动端异常信息模型
class MobileException
include Mongoid::Document
include Mongoid::Timestamps
field :version, :type => String
field :datetime, :type => DateTime
field :user_id, :type => Integer
field :device_name, :type => String
field :sdk_version, :type => String
field :os_release_version, :type => String
field :other_device_info, :type => Hash
field :exception_type, :type => String
field :exception_stack, :type => String
end
移动端用户反馈模型
class MobileFeedBack
include Mongoid::Document
include Mongoid::Timestamps
field :version, :type => String
field :datetime, :type => DateTime
field :user_id, :type => Integer
field :device_name, :type => String
field :sdk_version, :type => String
field :os_release_version, :type => String
field :other_device_info, :type => Hash
field :feedback, :type => String
end