Skip to content

session_logs 交互日志表

字段名字段类型字段注释默认值可空备注
idbigint UNSIGNED主键 IDNO自动递增
app_fskeyvarchar(64)关联应用FresnsNO关联字段 apps->fskey
Fresns 代表是主程序的日志
typetinyint UNSIGNED日志类型1NO见下方描述
platform_idtinyint UNSIGNED平台编号NOplatforms
versionvarchar(16)版本号NO语义化版本号
app_idchar(8)App IDYESsession_keys->app_id
lang_tagchar(16)客户端语言YES产生日志的语言,未开启多语言则留空
action_namevarchar(128)记录目标名称NO功能模型名或者接口路径
例如模型名 App\Models\Post
例如接口路径:/api/fresns/v1/account/auth-token
action_descvarchar(128)记录目标行为YES行为描述,自定义输入内容
action_statetinyint UNSIGNED记录行为结果NO1.未知或执行中 / 2.成功 / 3.失败
action_idbigint UNSIGNED记录目标 IDYES例如发表行为,则代表发表内容的 ID
插件行为,凭此 ID 可查询对应插件那边记录的关联信息
account_idbigint UNSIGNED账号 IDYES关联字段 accounts->id
user_idbigint UNSIGNED用户 IDYES关联字段 users->id
device_infojson设备信息YES
device_tokenvarchar(128)设备 TokenYES例如 iOS Device Token 或 Android Device Token
可应用于推送消息
login_tokenvarchar(64)登录令牌YES
more_infojson备用字段YES例如存储操作行为快照
created_attimestamp创建时间useCurrentNO比如 MySQL 默认值为 CURRENT_TIMESTAMP
updated_attimestamp更新时间YES
deleted_attimestamp删除时间YES

日志类型 type

类型编号常量名描述
1TYPE_UNKNOWN未知
2TYPE_PLUGIN插件业务
3TYPE_LOGIN_PANEL登录控制面板
4TYPE_ACCOUNT_REGISTER账号-注册
5TYPE_ACCOUNT_LOGIN账号-登录 action_id = session_tokens->id
6TYPE_ACCOUNT_UPDATE_DATA账号-修改资料
7TYPE_ACCOUNT_UPDATE_PASSWORD账号-设置或重置密码
8TYPE_ACCOUNT_DELETE账号-注销(删除)
9TYPE_USER_ADD用户-新增
10TYPE_USER_LOGIN用户-登录 action_id = session_tokens->id
11TYPE_USER_UPDATE_PROFILE用户-修改资料
12TYPE_USER_UPDATE_SETTING用户-更新设置
13TYPE_USER_UPDATE_PIN用户-设置或重置密码
14TYPE_USER_DELETE用户-删除
15TYPE_WALLET_INCREASE钱包-交易收入
16TYPE_WALLET_DECREASE钱包-交易支出
17TYPE_WALLET_UPDATE_PASSWORD钱包-设置或重置密码
18TYPE_POST_CREATE_DRAFT帖子-创建草稿
19TYPE_POST_REVIEW帖子-提交审核
20TYPE_POST_PUBLISH帖子-发表
21TYPE_POST_DELETE帖子-删除
22TYPE_POST_LOG_DELETE帖子日志-删除
23TYPE_COMMENT_CREATE_DRAFT评论-创建草稿
24TYPE_COMMENT_REVIEW评论-提交审核
25TYPE_COMMENT_PUBLISH评论-发表
26TYPE_COMMENT_DELETE评论-删除
27TYPE_COMMENT_LOG_DELETE评论日志-删除
28TYPE_MARK_LIKE操作喜欢
29TYPE_MARK_DISLIKE操作不喜欢
30TYPE_MARK_FOLLOW操作关注
31TYPE_MARK_BLOCK操作屏蔽
32TYPE_UPLOAD_FILE上传文件
33TYPE_CONVERSATION_MESSAGE对话消息

设备信息 JSON

networkIpv4networkIpv6 必填一项,或者两项都填写。其余项可留空。

json
{
    "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
    "type": "Desktop", // Desktop, Mobile, Tablet, Bot
    "platformName": "Mac 10.15.7",
    "platformFamily": "Mac",
    "platformVersion": "10.15.7",
    "browserName": "Chrome 126",
    "browserFamily": "Chrome",
    "browserVersion": "126",
    "browserEngine": "Blink",
    "deviceFamily": "Apple",
    "deviceModel": "Mac",
    "deviceMac": "2c:89:dc:71:b6:12",
    "appImei": null, // 国际移动设备识别码
    "appAndroidId": null, // 安卓设备的唯一标识符
    "appOaid": null, // 开放匿名设备标识符
    "appIdfa": null, // 苹果设备广告标识符
    "simImsi": null, // 国际移动用户识别码
    "networkType": "wifi",
    "networkIpv4": "137.132.250.10",
    "networkIpv6": null,
    "networkPort": "8080",
    "networkTimezone": "Asia/Singapore",
    "networkOffset": 28800,
    "networkIsp": "National University of Singapore",
    "networkOrg": "National University of Singapore",
    "networkAs": "AS7472 NUS Information Technology",
    "networkAsName": "NUS-AS-AP",
    "networkReverse": null,
    "networkMobile": false,
    "networkProxy": false,
    "networkHosting": false,
    "mapId": 2, // 字典数据: 地图服务商编号
    "latitude": 1.29758,
    "longitude": 103.773,
    "continent": "Asia",
    "continentCode": "AS",
    "country": "Singapore",
    "countryCode": "SG",
    "region": "Central Singapore",
    "regionCode": "01",
    "city": "Singapore",
    "cityCode": "SG",
    "district": "Queenstown",
    "address": null,
    "zip": "119259"
}

Released under the Apache-2.0 License