[关闭]
@allan199409 2015-09-09T02:36:44.000000Z 字数 1491 阅读 420

Gal-Blackboard通讯文档


Message基本格式:

  1. {
  2. err: true|false,
  3. msg: '',
  4. result: {}
  5. }

当产生错误时【通常是运行/解析错误】,err=true,msg中包含错误信息,result=null
当一切正常时err=false,msg='' result包含所需传递数据

result基本格式

  1. {
  2. type: '*',
  3. data1: '',
  4. data2: 0,
  5. ...
  6. }

Gal to Blackboard消息

下一页

  1. {
  2. err: false,
  3. msg: '',
  4. result: {
  5. type: 'command',
  6. command: 'next'
  7. }
  8. }

上一页

  1. {
  2. err: false,
  3. msg: '',
  4. result: {
  5. type: 'command',
  6. command: 'prev'
  7. }
  8. }

查询当前进度

  1. {
  2. err: false,
  3. msg: '',
  4. result: {
  5. type: 'inquire',
  6. what: 'save',
  7. id: 123
  8. }
  9. }

文字动画查询结果

  1. {
  2. err: false,
  3. msg: '',
  4. result: {
  5. type: 'return',
  6. data: true|fasle,
  7. origin: 'isSaying',
  8. id: 123
  9. }
  10. }

加载存档

  1. {
  2. err: false,
  3. msg: '',
  4. result: {
  5. type: 'command',
  6. command: 'load',
  7. data: '' //当前课程进度数据
  8. }
  9. }

当前课程进度数据由Blackboard决定,GAL不做处理,只储存

Blackboard to Gal消息

查询文字动画是否完成

  1. {
  2. err: false,
  3. msg: '',
  4. result: {
  5. type: 'inquire',
  6. what: 'isSaying',
  7. id: 123
  8. }
  9. }

结束当前文字动画

  1. {
  2. err: false,
  3. msg: '',
  4. result: {
  5. type: 'command',
  6. command: 'completeSaying'
  7. }
  8. }

更换头像

  1. {
  2. err: false,
  3. msg: '',
  4. result: {
  5. type: 'command',
  6. command: 'setHead',
  7. url: 'http://xxxxx'
  8. }
  9. }

显示文字

  1. {
  2. err: false,
  3. msg: '',
  4. result: {
  5. type: 'command',
  6. command: 'say',
  7. method: 'add'|'cover', //文字显示模式,add为现有基础上再增加,cover为删除已有
  8. word: 'xxxx', //需要显示的文字
  9. name: 'xxx', //说话人名称,没有就为空
  10. needanimation: true|false //是否需要动画,当显示上一页时设为false
  11. }
  12. }

课程完成

  1. {
  2. err: false,
  3. msg: '',
  4. result: {
  5. type: 'finish',
  6. courseID: xxx
  7. }
  8. }

返回当前课程进度

  1. {
  2. err: false,
  3. msg: '',
  4. result: {
  5. type: 'return',
  6. origin: 'save',
  7. courseID: xxxx,
  8. data: ''//当前课程进度数据
  9. }
  10. }

获取课程列表(http request)

  1. {
  2. err: false,
  3. msg: '',
  4. result: [
  5. {
  6. ID: xxxx, //课程id
  7. name: 'xxx', //课程名称
  8. introduce: 'xxx', //课程描述
  9. disposition: xxx, //该课程所需好感度
  10. img: "xxx", //课程图片url
  11. url: "xxx" //课程url
  12. }
  13. ]
  14. }

一些姿势

Blackboard 接收到鼠标左键单击事件:

Created with Raphaël 2.1.2Start查询文字动画文字动画是否结束?Blackboard内部操作显示文字&&更换头像End结束当前文字动画*不要显示文字&&更换头像*yesno
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注