diff --git a/design/QA-APIDOC.md b/design/QA-APIDOC.md new file mode 100644 index 0000000..26bd4c6 --- /dev/null +++ b/design/QA-APIDOC.md @@ -0,0 +1,123 @@ +###### 获取qa list + +URL: /plot/qa/{plot_id}/ + +METHOD: GET + +URL Parameters|TYPE: JSON + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [ + { + "id": 5, + "question": "他是不是傻?", + "answer": "嗯嗯", + }, + { + "id": 6, + "question": "他是不是呆子?", + "answer": "嗯嗯", + }] +} +``` + +###### 更新通用QA + +URL: /generalQA/{projectId} + +METHOD: PUT + +URL Parameters|TYPE: JSON +``` +[{ + "question": "他是不是傻?", + "answer": "嗯嗯", +}, +{ + "question": "他是不是傻?", + "answer": "嗯嗯", +}] +``` + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": null +} +``` + +###### 获取qa list + +URL: /generalQA/{projectId} + +METHOD: GET + +URL Parameters|TYPE: JSON + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 99, + "question": "他是不是傻?", + "answer": "嗯嗯" + }, { + "id": 100, + "question": "是不是呆子?", + "answer": "嗯嗯" + }] +} +``` + +###### QA上传 + +URL: /qa/upload + +METHOD: POST + +URL Parameters + +| Parameter | Type | Description | SendWay | +| :----------- | :------: | ------------: | :------ | +| projectId | +| file | 文件流 | 上传QA文件(扩展名:xls, .xlsx)| RequestParam | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +| content-type | application/json;charset=utf-8 | +| Authorization | token | + +``` +{ + "code":1, + "msg":"导入问答数据成功!", + "data":null +} diff --git a/design/app-api.md b/design/app-api.md new file mode 100644 index 0000000..b0297b5 --- /dev/null +++ b/design/app-api.md @@ -0,0 +1,12 @@ +支付回调地址: +支付宝支付回调地址: +http://aliyun-hz1.chewrobot.com:18082/api/payment/alipay/notice/pay + +支付宝退款回调地址: +http://aliyun-hz1.chewrobot.com:18082/api/payment/alipay/notice/refund + +微信支付回调地址: +http://aliyun-hz1.chewrobot.com:18082/api/payment/wxpay/notice/pay + +微信退款回调地址: +http://aliyun-hz1.chewrobot.com:18082/api/payment/wxpay/notice/refund diff --git a/design/app.sql b/design/app.sql new file mode 100644 index 0000000..53ea403 --- /dev/null +++ b/design/app.sql @@ -0,0 +1,7 @@ +CREATE TABLE `` ( + `info_id` int(11) NOT NULL AUTO_INCREMENT, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/design/backend2generation.py b/design/backend2generation.py new file mode 100644 index 0000000..98e0310 --- /dev/null +++ b/design/backend2generation.py @@ -0,0 +1,84 @@ +map_test = { + "start": "-1", // 剧情初始id + "userName": "", // 新建bot的用户名 + "botAccount":"", + "botId": "", // bot id + "POS":"", + "speechcraft":{ + name:value, + + } + "map":{ + "locations": [ + { + "id": 1, + "name": "地点A", + "nickname":[], + "neighbours": [2], // 能够去的地方的地点id列表 + "description": "" // 介绍 + }, + ], + } + "plots": [ + { + "id": "", // 剧情编号 + "condition_name":"", // 传第一个condition名字 + "location":"", + "branch": [ + { + "curPremise": [ + { + "conditionName": + "cmpType": + "operator": + "keyword": + "isIndependent" + } + "conditionName::cmpType-operator=keyword", + "conditionName::cmpType-operator=keyword", + + ], + "hisPremise":[ + "qqq2::match-Keyword=bbb2" + ], + "updateKnowledge":{ + "attrName":"", // 物品_急救箱_急救箱1_液体名 + "unknownText":"", + }, + "reply":"【npc名称】npc回复的话语【npc名称】npc回复的话语", // 回答 + "nextPlotId": "1" + } + ] + }, + ] + "goods":[ + { + "name":"", + "attr":{ + "intro":"", + "class":"", + "location":"", + "owner":"" + } + } + ], + "npc": [ + { + "name": "", + "offline":true&&false + "attr": { // 自定义属性 + "attrName": "", + "intro": "", + "location": "" + } + } + ], + "globalVariable": [ + { + "category": "start", + "variables": { + "attrName":"attrValue" + } + } + ] +} diff --git a/design/backup_import.md b/design/backup_import.md new file mode 100644 index 0000000..5f1eece --- /dev/null +++ b/design/backup_import.md @@ -0,0 +1,44 @@ +数据结构一改就全部再备份 + +1. + + +INSERT INTO `game_editor_db1`.`npc_instance_tb` (`id`, `name`, `intro`, `unknown_text`, `nickname`, `is_base`, `head_img_url`, `voice_class`, `pitch`, `volume`, `speed`, `offline`, `npc_class_id`, `gmt_create`, `gmt_modified`) VALUES ('718', '天谴骑士', '天遣者,死亡之后被流放于失落大陆', '你在上一个地方还有事情没有做完吧,等完成了再过来找我吧\n我看你在上一个地方还没玩够,要不你再回去玩玩吧\n还有重要的事情没有做完,你还是回去继续玩吧\n上个地点还有要做的事情,回去做完再过来吧', '天谴者', '0', '/upload/img/npc/default.png', 'A01_offline', '0', '185', '0.89', '1', '531', '2019-02-25 10:59:40', '2019-02-25 15:44:59'); + + + +后期把图片资源也备份 + +GameProject + +GlobalAttr + +Place + +QA + +Speechcraft + +WordProperty + +ListeningAction + + +GoodsClass +GoodsClassAttr +GoodsInstance +GoodsInstanceAttr + +NpcClass +NpcClassAttr +NpcInstance +NpcInstanceAttr + +Plot +PlotBranch +PlotBranchMatchField +PlotBranchPremise +PlotBranchRelate +PlotBranchRelateAttr +PlotCategory +PlotText diff --git a/design/combine_bot_api.md b/design/combine_bot_api.md new file mode 100644 index 0000000..44857b6 --- /dev/null +++ b/design/combine_bot_api.md @@ -0,0 +1,50 @@ +###### 合并模块bot + +URL: BASEURL:18082/combineBot?projectId={作品ID} + +METHOD: POST + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +| content-type | application/json;charset=utf-8| +| Authorization | token | + +RequestBody: +``` +{ + "botAccounts":["281647119"] // 模块bot的账号列表 botAccount +} +``` + +ResponseBody: +``` +{ + "code":1, + "msg":"成功" +} +``` + +###### 查看当前bot之前保存的模块账号列表 + +URL: BASEURL:18082/combineBot/module?projectId={作品ID} + +METHOD: GET + +Headers: +Parameter | Type | Description +| :----------- | :------: | ------------: | +| content-type | application/json;charset=utf-8| +| Authorization | token | + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [ + "281647119" + ] +} +``` diff --git a/design/condition-APIDOC.md b/design/condition-APIDOC.md new file mode 100644 index 0000000..a08d4ee --- /dev/null +++ b/design/condition-APIDOC.md @@ -0,0 +1,34 @@ +###### 获取所有的condition +URL: /get_all_condition + +METHOD: GET + +URL Parameters|TYPE: + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +[ + { + "id": 2427, + "name": "game_over", + "nickname": "瑞哪在哪里?", + "head": ["测试"], + "keywords": ["测试2", "测试1"] + }, +] +``` + +player_guide +player_id +content + +CREATE TABLE `gameworld`.`player_guide` ( + `player_id` INT(11) NOT NULL , + `content` MEDIUMTEXT NOT NULL +) ENGINE = InnoDB; diff --git a/design/condition_add_model.md b/design/condition_add_model.md new file mode 100644 index 0000000..c4b902c --- /dev/null +++ b/design/condition_add_model.md @@ -0,0 +1,95 @@ +BASE_URL: http://didi-gz5.jiaoyou365.com + +###### 提交语义关系的选择记录 +URL: BASE_URL:19082/condition/choise/record + +METHOD: POST + +Parameter | Type | Description +| :----------- | :------: | ------------: | +| Authorization | token | 用户token | + +RequestBody: +``` +{ + "queryText":"张三喜欢打篮球", + "conditionName":"do_what_vv", + "semanticRelationName":"ruleb0dob0whatb0vv", + "tripleSos":[ + {"s":"喜欢", "o":"打"} + ] +} +``` + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": null +} +``` + + +###### 搜索语义关系(此接口只是返回数据的格式做了变更) +URL: BASE_URL:19082/condition/search?queryText=张三喜欢打篮球 + +METHOD: GET + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +| Authorization | token | 用户token | + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": { + "submitChoiceConditionRecord": true, // 新加字段,true表示在用户选择之后(:19082/condition/choise/record配合这个接口使用),将用户操作数据提交给后台 + "conditions": [ // 语义关系列表 + { + "id": 743, + "name": "do_what_vn", + "nickName": "陈述之动宾", + "semanticRelationName": "ruleb0dob0whatb0vn", + "head": "...", + "tail": "?", + "keywords": "...", + "score": 0.98119825, + "conditionParses": [ + { + "playerSay": "张三喜欢打篮球", + "determiner": "打", + "keyword": "篮球" + } + ] + }, + { + "id": 857, + "name": "do_what_nv", + "nickName": "陈述之主谓", + "semanticRelationName": "ruleb0dob0whatb0nv", + "head": "...", + "tail": "?", + "keywords": "...", + "score": 0.8653726, + "conditionParses": [ + { + "playerSay": "张三喜欢打篮球", + "determiner": "张三", + "keyword": "打" + }, + { + "playerSay": "张三喜欢打篮球", + "determiner": "张三", + "keyword": "喜欢" + } + ] + } + ] + } +} +``` \ No newline at end of file diff --git a/design/condition_struct.md b/design/condition_struct.md new file mode 100644 index 0000000..aa1aed5 --- /dev/null +++ b/design/condition_struct.md @@ -0,0 +1,47 @@ +Condition: +{ + Long id + String name + String nickname + String reply + List head + List keywords + List tail + List conditionParses +} + +ConditionParse: +{ + playerSay:"", + determiner:"", + keyword:"" +} + +ConditionCategory: +{ + String categoryname: + List conditions; +} + +// 获取语义关系 +[ + { + categoryname: 分类名 + conditions:[ + { + id: // condition ID + name: // condition name + nickname // 可以去掉 + reply // 可以去掉 + head:["",""] // 头部关键词组 + keywords:["", ""] + tail:["",""] + conditionParses:{ + playerSay:"", // 玩家有话说 + determiner:"", // 限定词 + keyword:"" // 关键词 + } + } + ] + } +] diff --git a/design/data.xml b/design/data.xml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/design/data.xml diff --git a/design/envJson.json b/design/envJson.json new file mode 100644 index 0000000..1d56a36 --- /dev/null +++ b/design/envJson.json @@ -0,0 +1,4 @@ +JIAOYOU_APP865900032129582@@@3723539386@@@@HyLavT6pUgJGFGCRLRV5, +JIAOYOU_APP865900032129582@@@3723539386@@@@HyLavT6pUgJGFGCRLRV5, +JIAOYOU_APP865900032129582@@@438155367@@@@zVFPSLofSVkLbLvZNOgD +JIAOYOU_APP865900032129582@@@438155367@@@@zVFPSLofSVkLbLvZNOgD, diff --git "a/design/env\347\273\223\346\236\204.json" "b/design/env\347\273\223\346\236\204.json" new file mode 100644 index 0000000..d4afd13 --- /dev/null +++ "b/design/env\347\273\223\346\236\204.json" @@ -0,0 +1,40 @@ +{ + "map":{ + "id":{ + "name":"", + "intro": "", + "canGo": [0,1] + } + }, + "npc":{ + "classname":{ + "class":{ + "attrname":"attr_init_value" + }, + "instance":{ + "id":{ + "placeId":0, + "name":"", + "intro":"", + "attrname":"attrvalue" + } + } + } + }, + "goods":{ + "classname":{ + "class":{ + "attrname":"attr_init_value" + }, + "instance":{ + "id":{ + "placeId":1, + "npcId":2, + "name":"", + "intro":"", + "attrname":"attrvalue" + } + } + } + } +} diff --git a/design/fileBackupAndRecovery.md b/design/fileBackupAndRecovery.md new file mode 100644 index 0000000..f382c1d --- /dev/null +++ b/design/fileBackupAndRecovery.md @@ -0,0 +1,91 @@ +###### 用户作品备份 + +URL: /gameProject/backup/{projectId} + +METHOD: GET + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +| content-type | application/json;charset=utf-8 | +| Authorization | token | + +``` +{ + "code": 1, + "msg": "作品备份成功!", + "data": null +} +``` + +###### 作品还原 + +URL: /gameProject/recovery/{备份历史的ID} + +METHOD: POST + +URL Parameters + +| Parameter | Type | Description | SendWay | +| :----------- | :------: | ------------: | :------ | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +| content-type | application/json;charset=utf-8 | +| Authorization | token | + +``` +{ + "code":1, + "msg":"作品导入成功!", + "data":null +} + +###### 获取作品备份列表 + +URL: /user/backup/history + +METHOD: GET + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +| content-type | application/json;charset=utf-8 | +| Authorization | token | + +URL Parameters + +| Parameter | Type | Description | SendWay | +| :----------- | :------: | ------------: | :------ | +| username | String | 作者用户名 | RequestParam | + +``` +{ + "code": 1, + "msg": "成功", + "data": [ + { + "id": 1, + "type": 0, // 0表示系统备份的 + "projectName": "穿越剧", + "gmtCreate": 1551417650000 + }, + { + "id": 2, + "type": 0, + "projectName": "穿越剧", + "gmtCreate": 1551417797000 + }, + { + "id": 3, + "type": 1, + "projectName": "穿越剧", + "gmtCreate": 1551418926000 + } + ] +} +``` diff --git a/design/fileUpload-api.md b/design/fileUpload-api.md new file mode 100644 index 0000000..ac6b0d2 --- /dev/null +++ b/design/fileUpload-api.md @@ -0,0 +1,68 @@ +###### 角色图片上传 + +URL: /upload/npc_head_img + +METHOD: POST + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +``` +{ + "code":1, + "msg":"成功", + "data":{ + "relativePath":"/upload/img/npc/2019/01/03153054823.png", + "absolutePath":"http://192.168.1.129/game_editor/upload/img/npc/2019/01/03144846534.png" + } +} +``` + +###### 作者头像上传 + +URL: /upload/author_head_img + +METHOD: POST + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +``` +{ + "code":1, + "msg":"成功", + "data":{ + "relativePath":"/upload/img/author/2019/01/03153054823.png", + "absolutePath":"http://192.168.1.129/game_editor/upload/img/author/2019/01/03144846534.png" + } +} +``` + +###### 其他图片上传 + +URL: /upload/img + +METHOD: POST + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +``` +{ + "code":1, + "msg":"成功", + "data":{ + "relativePath":"/upload/img/other/2019/01/03153054823.png", + "absolutePath":"http://192.168.1.129/game_editor/upload/img/other/2019/01/03144846534.png" + } +} +``` diff --git a/design/frontend_api.md b/design/frontend_api.md new file mode 100644 index 0000000..8b4d958 --- /dev/null +++ b/design/frontend_api.md @@ -0,0 +1,350 @@ +##### 获取作品信息 (app & h5) + +URL: http://aliyun-hz1.chewrobot.com:18082/api/works?include=worksName,authorName,npcHeadImgUrl + +METHOD: GET + +URL Parameters + +| Parameter | Type | Description | SendWay | +| :----------- | :------: | ------------: | :------ | +| aipioneerUsername | Number | 作品ID | RequestParam | + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/x-www-form-urlencoded;charset=utf-8 | + +responseBody: +``` +SUCCESS: +{ + "code":1, + "msg":"成功", + "data":{ + worksName: "作品名称", + worksBannerImgUrl:"", // 作品封面图 + intro:"", // 作品简介 + authorName: "作者的名称", + npcHeadImgUrl:{ + "角色名称":"角色头像的url" + } + } +} +FAILTURE: +(1). +{ + "code":50001, + "msg":"当前作品信息不存在!", + "data":null +} + +``` + +##### 用户分享出某个作品 (app) +URL: http://aliyun-hz1.chewrobot.com:18082/api/share?module=works&direction=to + +METHOD: POST + +URL Parameters + +| Parameter | Type | Description | SendWay | +| :----------- |:------| :------------ | :------| +| aipioneerUsername | Number | 作品ID | RequestParam | + +Headers: + +| key | value| +| :----------- | :------------ | +| Content-Type | application/x-www-form-urlencoded;charset=utf-8| +| Authorization | Bearer YOUR_ACCESS_TOKEN(选填) | + +responseBody: +``` +SUCCESS: +{ + "code":1, + "msg":"分享成功", + "data":null +} +FAILTURE: +(1). +{ + "code":10005, + "msg":"参数错误!", + "data":null +} +``` + + +##### 用户点击了分享链接进入(app) + +URL: http://aliyun-hz1.chewrobot.com:18082/api/share?module=works&direction=from + +METHOD: POST + +URL Parameters + +| Parameter | Type | Description| SendWay | +| :----------- | :------ | :------------ | :----------- | +| aipioneerUsername | Number | 作品ID| RequestParam | +| sendUserId | Number | 发送分享链接的用户id | RequestParam | + +Headers: + +| key |value| +| :----------- | :------------: | +| Content-Type | application/x-www-form-urlencoded;charset=utf-8 | +| Authorization | Bearer YOUR_ACCESS_TOKEN(选填) | + +responseBody: +``` +SUCCESS: +{ + "code":1, + "msg":"分享成功", + "data":null +} +FAILTURE: +(1). +{ + "code":10005, + "msg":"参数错误!", + "data":null +} +``` +##### 送花 (app) + +URL: http://aliyun-hz1.chewrobot.com:18082/api/flower?module=works + +METHOD: POST + +URL Parameters + +| Parameter | Type | Description | SendWay| +| :----------- | :------: | ------------: | :------------- | +| aipioneerUsername | String | 作品ID | RequestsParam | +| way | String | 支付方式[ alipay | wxpay ] | RequestParam | +| amount | Number | 送花数 | RequestParam | + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/x-www-form-urlencoded;charset=utf-8 | +| Authorization | Bearer YOUR_ACCESS_TOKEN | + +responseBody: +``` +SUCCESS: +{ + "code": 1, + "msg": "成功", + "data": { + "orderId": 19, + "paySign": "支付签名" + } +} +FAILTURE: +{ + "code":20002, + "msg":"用户认证失败!" + "data":null +} +{ + "code":10005, + "msg":"参数错误!", + "data":null +} +``` + +##### 查询订单的状态 (app) + +URL: http://aliyun-hz1.chewrobot.com:18082/api/payment/order/status + +METHOD: GET + +URL Parameters + +| Parameter | Type | Description | SendWay| +| :----------- | :------: | ------------: | :------------- | +| orderId | String | 订单id | RequestsParam | + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/x-www-form-urlencoded;charset=utf-8 | +| Authorization | Bearer YOUR_ACCESS_TOKEN | + +responseBody: +``` +SUCCESS: +{ + "code":1, + "msg":"成功", + "data":{ + "status":0 // + } +} +FAILTURE: +{ + "code":20002, + "msg":"用户认证失败!" + "data":null +} + +``` + + +##### 获取当前用户对某一个作品的送花数 (app) + +URL: http://aliyun-hz1.chewrobot.com:18082/api/flower/count?module=works + +METHOD: GET + +URL Parameters + +| Parameter | Type | Description | SendWay| +| :----------- | :------: | ------------: | :------------- | +| aipioneerUsername | String | 作品ID | RequestsParam | + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/x-www-form-urlencoded;charset=utf-8 | +| Authorization | Bearer YOUR_ACCESS_TOKEN | + +responseBody: +``` +SUCCESS: +{ + "code":1, + "msg":"成功", + "data":{ + "count":2 + } +} +FAILTURE: +{ + "code":20002, + "msg":"用户认证失败!" + "data":null +} +``` + +#### 发送消息和接收消息使用的接口(app) + +接口名: http://aliyun-hz1.chewrobot.com:8070/api/chat + +METHOD: POST + +Headers: + +| key | value| +| :----------- | :------------ | +| Content-Type | application/json;charset=utf-8| +| Authorization | Bearer YOUR_ACCESS_TOKEN| + + +URL Parameters: + +|参数名 | 数据类型 | 描述| SendWay | +| :----------- | :------: | :------------ | :------- | +| uid | string | 用户唯一标识符ID, 未登录时用设备id | JSON | +| msg | string | 用户发送的信息 | JSON | +| nickname | string | 用户昵称,现在nickname固定设为qiwu | JSON | + +responseBody: +``` +{ + "code": 状态码, 成功时为1, 失败为0 + "dialogList":[ + { + npcName: 角色名称 + text: 文本信息 + audio: 音频,格式base64,需解码 + } + ] + "botStatus": "[enter|exit|switch|chat]" + "aipioneerUsername": "bot的引擎账号" + "responseType": 前段操作码,具体见"responseType的具体操作" + + "data": "额外的json参数" + 1. 收藏列表的格式为 + [{ + worksName: ,// 作品名称 + aipioneerUsername: , // 作品用户名 + }] + 2. 推荐列表的格式为 + [{ + worksName: ,// 作品名称 + aipioneerUsername: , // 作品用户名 + }] + + +} +``` + +###### responseType的具体操作 + +``` + 10001: 将msg中的内容输出 + 10002: 展示送花界面 + 10003: 展示分享界面 + 10004: 从data中获取推荐列表并输出 + 10005 :从data中获取收藏列表并输出 +``` + +###### botStatus 的具体操作 + +``` + "enter":进入作品bot + "exit":从作品bot退出 + "switch":从作品bot切换到另一个作品bot + "chat" 正在对话,不切换bot +``` + +###### 消息意图(message):(按钮点击事件发送的话语) + +| 意图 | 话语 | +| :------: | :--------: | +| 推荐作品 | 推荐作品 | +| 打开收藏 | 打开收藏 | +| 读取存档 | 读取存档 | +| 分享 | 我要分享 | +| 送花 | 我要送花 | +| 收藏 | 我要收藏 | + +#### H5发送消息和接收消息使用的接口 + +接口名: http://aliyun-hz1.chewrobot.com:8070/api/chat3 + +Method:POST +Headers: + +| key | value| +| :----------- | :------------ | +| Content-Type | application/json;charset=utf-8| + +URL Parameters: + +|参数名 | 数据类型 | 描述| SendWay | +| :----------- | :------: | :------------ | :------- | +| chatKey | string | 第一个会话为空字符串,从第二轮开始用接口返回的chat_key代替 | JSON | +| msg | string | 用户发送的信息 | JSON | +| nickname | string | 用户昵称,现在nickname固定设为qiwu | JSON | +| aipioneerUsername | string | bot的引擎账号 | JSON | + + + +responseBody: +``` +{ + "code": int, //状态码, 成功时为1, 失败为0 + "msg": string, //返回文本 + "chatKey":string //会话id +} +``` diff --git a/design/gameProject-APIDOC.md b/design/gameProject-APIDOC.md new file mode 100644 index 0000000..7f7b8ed --- /dev/null +++ b/design/gameProject-APIDOC.md @@ -0,0 +1,611 @@ +### 工程 +###### 创建游戏 +URL: /project/ + +METHOD: POST + +URL Parameters:TYPE: JSON + +Parameter | Type | Description +| :----------- | :------: | ------------: | +``` +{ + "name":游戏的名陈, // String + "intro":游戏简介, // String + "startNum":开始的剧情id // String + "botId": // Long + "botAccount": // String + "userId": // Long + "username" // String + "nickname":"hai", +} +``` +name | String | 工程名称 +intro | String | 工程介绍 +userId | Long | 用户id + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":状态码, "msg":提示, "data":插入id} +``` +###### 删除游戏 +URL: /project/{id}/ + +METHOD: DELETE + +URL Parameters:(NULL) + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} +``` +###### 改变游戏信息 +URL: /project/{id}/ + +METHOD: PUT + +URL Parameters:TYPE: JSON + +Parameter | Type | Description +| :----------- | :------: | ------------: | +id | Long | 工程id +name | String | 工程名称 +intro | String | 工程介绍 +userId | Long | 用户id +startNum | String | 开始的剧情id +botId | Long | bot id +botAccount | String | bot account +nickname | String | 用户别名 +applyStatus | String | 审核状态码, +applySuggestion | String | 审核意见 + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} +``` + +###### 查询游戏信息 +URL: /project/{id}/ + +METHOD: GET + +URL Parameters:(NULL) + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code":1, + "msg":"成功", + "data":{ + "id":22, + "name":"nihao", + "intro":"wohenhao", + "botId": // Long + "botAccount": // String + "userId": // Long + "username" // String + "nickname":"hai", + "generateStatus":"1", + "gmtGenerate":"1543469935000" + "applyStatus":"1", + "applySuggestion":"写错联网" + } +} + +``` +###### 通过用户id获得所有的游戏信息 +URL: /project/ + +METHOD: GET + +URL Parameters:(param) + +Parameter | Type | Description +| :----------- | :------: | ------------: | +userId | Long| + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [ + { + "id": 22, + "name": "nihao", + "intro": "wohenhao", + "userId": 7 + "botId": // Long + "botAccount": // String + "userId": // Long + "username" // String + "nickname":"hai", + "generateStatus":"1", + "gmtGenerate":"1543469935000" + "applyStatus":"1", + "applySuggestion":"写错联网" + }, + { + "id": 23, + "name": "超级玛丽", + "intro": "别摸我的头,我的头是用来顶蘑菇的", + "userId": 7 + "botId": // Long + "botAccount": // String + "userId": // Long + "username" // String + "nickname":"hai", + "generateStatus":"1", + "gmtGenerate":"1543469935000" + "applyStatus":"1", + "applySuggestion":"写错联网" + }, + { + "id": 24, + "name": "超级玛丽", + "intro": "别摸我的头,我的头是用来顶蘑菇的", + "userId": 7 + "botId": // Long + "botAccount": // String + "userId": // Long + "username" // String + "nickname":"hai", + "generateStatus":"1", + "gmtGenerate":"1543469935000" + "applyStatus":"1", + "applySuggestion":"写错联网" + }] +} + +``` +###### 通过用户名获得所有的游戏信息 +URL: /project/by_username/ + +METHOD: GET + +URL Parameters:(param) + +Parameter | Type | Description +| :----------- | :------: | ------------: | +username | String| + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [ + { + "id": 22, + "name": "nihao", + "intro": "wohenhao", + "userId": 7 + "botId": // Long + "botAccount": // String + "userId": // Long + "username" // String + "nickname":"hai", + "generateStatus":"1", + "applyStatus":"1", + "applySuggestion":"写错联网" + }, + { + "id": 23, + "name": "超级玛丽", + "intro": "别摸我的头,我的头是用来顶蘑菇的", + "userId": 7 + "botId": // Long + "botAccount": // String + "userId": // Long + "username" // String + "nickname":"hai", + "generateStatus":"1", + "applyStatus":"1", + "applySuggestion":"写错联网" + }, + { + "id": 24, + "name": "超级玛丽", + "intro": "别摸我的头,我的头是用来顶蘑菇的", + "userId": 7 + "botId": // Long + "botAccount": // String + "userId": // Long + "username" // String + "nickname":"hai", + "generateStatus":"1", + "applyStatus":"1", + "applySuggestion":"写错联网" + }] +} + +``` +###### 获取开始剧情编号 +URL: /project/{id}/start_num + +METHOD: GET + +URL Parameters: + +Parameter | Type | Description +| :----------- | :------: | ------------: | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":{"stratNum":"1-1"}} +``` +###### 设置开始剧情编号 +URL: /project/{id}/start_num + +METHOD: POST + +URL Parameters:param + +startNum String + +Parameter | Type | Description +| :----------- | :------: | ------------: | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":{"stratNum":"1-2"}} +``` + +###### 获取开始剧情编号 +URL: /generate_json/{id}/ + +METHOD: GET + +URL Parameters: + +Parameter | Type | Description +| :----------- | :------: | ------------: | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} +``` + +###### 通过botId删除游戏 +URL: /project/ + +METHOD: DELETE + +URL Parameters:(param) + +botId Long + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":50001,"msg":"botid对应的游戏不存在","data":null} +{"code":1,"msg":"成功","data":null} +``` +###### 查询游戏信息 +URL: /project/ + +METHOD: GET + +URL Parameters:(params) + +botId Long + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code":1, + "msg":"成功", + "data":{ + "id":22, + "name":"内部测试", + "intro":"这是内部测试的", + "botId":2709, + "botId": // Long + "botAccount": // String + "userId": // Long + "username" // String + "nickname":"hai", + "generateStatus":"1", + "applyStatus":"1", + "applySuggestion":"写错联网" + } +} +{"code":50001,"msg":"bot id 错误!","data":null} +``` + +###### 管理员查询所有的游戏 +URL: /project/all/ + +METHOD: GET + +URL Parameters:(params) + +botId Long + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 11, + "name": "王者荣耀!", + "intro": "是兄弟就出来砍我两刀!", + "startNum": null, + "botId": null, + "botAccount": null, + "userId": 0, + "username": null, + "nickname": null, + "generateStatus": null, + "applyStatus": "0", + "applySuggestion": null + }, { + "id": 25, + "name": "游戏", + "intro": "游戏简介", + "startNum": null, + "botId": null, + "botAccount": null, + "userId": 0, + "username": null, + "nickname": null, + "generateStatus": null, + "applyStatus": "0", + "applySuggestion": null + }] +} +``` + +###### 更新访问次数 +URL: /project/{id}/watch/ + +METHOD: PUT + +URL Parameters: + +| name | type | description | sendWay | +| :----| :---- | :---- | :---- | +| id | Number | 作品的id | pathVariable | + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} + +``` + +``` +apply_status: + 0:未审核 + 1:审核通过 + -1:审核未通过 + 2: 审核中 +``` +###### 获取用户审核通过的作品 + +URL: /project/ + +URL Parameters: + +| name | type | description | sendWay | +| :----| :---- | :---- | :---- | +| username | String | 作者姓名 | requestParam | +| applyStatus | Number | 审核状态 | requestParam | + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 180, + "name": "李进峰测试", + "intro": "李进峰测试", + "botId": 2879, + "botAccount": "1779383837", + "userId": null, + "username": "jinfengli", + "nickname": "李进峰", + "generateStatus": 1, + "applyStatus": 1, + "applySuggestion": null, + "watch": 0 + }, { + "id": 216, + "name": "数据测试", + "intro": "数据测试", + "botId": 3002, + "botAccount": "7101929085", + "userId": null, + "username": "jinfengli", + "nickname": "李进峰", + "generateStatus": 0, + "applyStatus": 1, + "applySuggestion": "", + "watch": 0 + }, { + "id": 233, + "name": "我的一天", + "intro": "我的一天", + "botId": 3093, + "botAccount": "4096611751", + "userId": null, + "username": "jinfengli", + "nickname": "李进峰", + "generateStatus": 1, + "applyStatus": 1, + "applySuggestion": "", + "watch": 0 + }, { + "id": 235, + "name": "特殊", + "intro": "特殊", + "botId": 3105, + "botAccount": "6309871697", + "userId": null, + "username": "jinfengli", + "nickname": "李进峰", + "generateStatus": 0, + "applyStatus": 1, + "applySuggestion": "", + "watch": 0 + }] +} + +``` + +###### 获取所有审核通过的作品 + +URL: /project/ + +URL Parameters: + +| name | type | description | sendWay | +| :----| :---- | :---- | :---- | +| applyStatus | Number | 审核状态 | requestParam | +| orderBy = watch +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 180, + "name": "李进峰测试", + "intro": "李进峰测试", + "botId": 2879, + "botAccount": "1779383837", + "userId": null, + "username": "jinfengli", + "nickname": "李进峰", + "generateStatus": 1, + "applyStatus": 1, + "applySuggestion": null, + "watch": 0 + }, { + "id": 212, + "name": "三国演义", + "intro": "东汉末年,三国统治中展开精彩的演绎", + "botId": 2973, + "botAccount": "7520330582", + "userId": null, + "username": "Bella123", + "nickname": "Bella123", + "generateStatus": 0, + "applyStatus": 1, + "applySuggestion": "", + "watch": 0 + }, { + "id": 216, + "name": "数据测试", + "intro": "数据测试", + "botId": 3002, + "botAccount": "7101929085", + "userId": null, + "username": "jinfengli", + "nickname": "李进峰", + "generateStatus": 0, + "applyStatus": 1, + "applySuggestion": "", + "watch": 0 + }, { + "id": 233, + "name": "我的一天", + "intro": "我的一天", + "botId": 3093, + "botAccount": "4096611751", + "userId": null, + "username": "jinfengli", + "nickname": "李进峰", + "generateStatus": 1, + "applyStatus": 1, + "applySuggestion": "", + "watch": 0 + }, { + "id": 235, + "name": "特殊", + "intro": "特殊", + "botId": 3105, + "botAccount": "6309871697", + "userId": null, + "username": "jinfengli", + "nickname": "李进峰", + "generateStatus": 0, + "applyStatus": 1, + "applySuggestion": "", + "watch": 0 + }] +} + +``` diff --git a/design/game_editor_tool_db.sql b/design/game_editor_tool_db.sql new file mode 100644 index 0000000..51acc85 --- /dev/null +++ b/design/game_editor_tool_db.sql @@ -0,0 +1,269 @@ +-- CREATE DATABASE game_editor_db DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; +-- USE game_editor_db; + +DROP TABLE IF EXISTS `game_project_tb`; +CREATE TABLE `game_project_tb` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(45) NOT NULL, + `intro` varchar(200) DEFAULT NULL, + `user_id` int(11) NOT NULL, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `global_attr_category_tb`; +CREATE TABLE `global_attr_category_tb` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `num` varchar(45) DEFAULT NULL, + `name` varchar(45) NOT NULL, + `project_id` int(11) DEFAULT NULL, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `global_attr_tb`; +CREATE TABLE `global_attr_tb` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(45) NOT NULL, + `intro` varchar(200) DEFAULT NULL, + `value` varchar(45) DEFAULT NULL, + `category_id` int(11) NOT NULL, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `goods_category_tb`; +CREATE TABLE `goods_category_tb` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(45) NOT NULL, + `num` varchar(45) DEFAULT NULL, + `intro` varchar(200) DEFAULT NULL, + `project_id` int(11) NOT NULL, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `goods_tb`; +CREATE TABLE `goods_tb` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `num` varchar(200) NOT NULL, + `name` varchar(45) NOT NULL, + `intro` varchar(200) NOT NULL, + `category_id` int(11) NOT NULL, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `goods_attr_tb`; +CREATE TABLE `goods_attr_tb` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(45) NOT NULL, + `value` varchar(45) DEFAULT NULL, + `goods_id` int(11) DEFAULT NULL, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `place_category_tb`; +CREATE TABLE `place_category_tb` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(45) NOT NULL, + `num` varchar(45) DEFAULT NULL, + `project_id` int(11) NOT NULL, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `place_tb`; +CREATE TABLE `place_tb` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `num` varchar(45) NOT NULL, + `name` varchar(45) NOT NULL, + `able_go` varchar(200) DEFAULT comment'id0,id1,id2', + `intro` varchar(200) DEFAULT NULL, + `category_id` int(11) NOT NULL, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `npc_category_tb`; +CREATE TABLE `npc_category_tb` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `num` varchar(200) NOT NULL, + `name` varchar(45) DEFAULT NULL, + `intro` varchar(200) DEFAULT NULL, + `project_id` int(11) DEFAULT NULL, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `npc_tb`; +CREATE TABLE `npc_tb` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `num` varchar(200) NOT NULL, + `name` varchar(45) NOT NULL, + `intro` varchar(200) NOT NULL, + `category_id` int(11) NOT NULL, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `npc_attr_tb`; +CREATE TABLE `npc_attr_tb` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(45) NOT NULL, + `value` varchar(45) DEFAULT NULL, + `npc_id` int(11) NOT NULL, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `plot_category_tb`; +CREATE TABLE `plot_category_tb` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `num` varchar(45) NOT NULL, + `name` varchar(45) NOT NULL, + `intro` varchar(200) DEFAULT NULL, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `plot_tb`; +CREATE TABLE `plot_tb` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `num` varchar(45) NOT NULL, + `place_id` int(11) NOT NULL, + `place_name` varchar(45) NOT NULL, + `unknow_text` varchar(200) DEFAULT NULL, + `category_id` int(11) NOT NULL, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `plot_text_tb`; +CREATE TABLE `plot_text_tb` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `content` varchar(200) NOT NULL, + `npc_id` int(11) NOT NULL, + `npc_name` varchar(45) NOT NULL, + `plot_id` int(11) NOT NULL, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `plot_branch_tb`; +CREATE TABLE `plot_branch_tb` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `next_plot_num` varchar(200) DEFAULT NULL, + `plot_id` int(11) NOT NULL, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `plot_branch_premise_tb`; +CREATE TABLE `plot_branch_premise_tb` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `global_attr_id` int(11) NOT NULL, + `global_attr_name` varchar(45) NOT NULL, + `type` char(10) + comment 'match\n + num\n + time\n + any\n', + `operator` char(10) + comment 'Keyword\n + Bigger\n + BiggerOrEqual\n + Smaller\n + SmallerOrEqual\n + Early\n + Later\n', + `compared_value` varchar(5000) NOT NULL, + `plot_branch_id` int(11) NOT NULL, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `plot_branch_match_field_tb`; +CREATE TABLE `plot_branch_match_field_tb` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `type` char(10) + comment 'match\n + num\n + time\n + any\n', + `operator` char(10) + comment 'Keyword\n + Bigger\n + BiggerOrEqual\n + Smaller\n + SmallerOrEqual\n + Early\n + Later\n', + `compared_value` varchar(5000) DEFAULT NULL, + `condition_id` int(11) NOT NULL, + `condition_name` varchar(45) DEFAULT NULL, + `plot_branch_id` int(11) DEFAULT NULL, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `plot_branch_relate_tb`; +CREATE TABLE `plot_branch_relate_tb` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `module` int(11) NOT NULL comment "goods:0, npc:1, global_attr:2", + `module_id` int(11) NOT NULL, + `attr_id` int(11) NOT NUll, + `attr_name` varchar(45) NOT NUll, + `attr_value` varchar(45) NOT NULL, + `plot_branch_id` int(11) DEFAULT NULL, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `generate_json_tb`; +CREATE TABLE `generate_json_tb` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `json_text` mediumtext NOT NULL, + `project_id` int(11) NOT NULL, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/design/globalAttr-APIDOC.md b/design/globalAttr-APIDOC.md new file mode 100644 index 0000000..b69dbaf --- /dev/null +++ b/design/globalAttr-APIDOC.md @@ -0,0 +1,170 @@ +### 全局属性 + +###### 添加全局属性 +URL: /global_attr/ + +METHOD: POST + +URL Parameters|TYPE: JSON +``` +{ + "name":"删除全局变量分类", + "intro":"删除全局变量分类", + "value":"删除全局变量分类", + "projectId":212 +} +``` + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":{"id":879}} +``` +###### 删除请全局属性 +URL: /global_attr/{id}/ + +METHOD: DELETE + +URL Parameters|TYPE: + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} +``` +###### 更新全局属性 +URL: /global_attr/{id}/ + +METHOD: PUT + +URL Parameters|TYPE:JOSN +``` +{ + "id":880, + "name":"删除全局变量分类删除全局变量分类", + "intro":"删除全局变量分类", + "value":"删除全局变量分类", + "projectId":212 +} +``` + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} +``` +###### 获取全局属性 +URL: /global_attr/{id}/ + +METHOD: GET + +URL Parameters|TYPE: + +Parameter | Type | Description +| :----------- | :------: | ------------: | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": { + "id": 880, + "name": "删除全局变量分类删除全局变量分类", + "intro": "删除全局变量分类", + "value": "删除全局变量分类", + "projectId": 212 + } +} +``` +###### 获取projectid下的所有全局属性 +URL: /global_attr/ + +METHOD: GET + +URL Parameters|TYPE:Param +categoryId Long + +Parameter | Type | Description +| :----------- | :------: | ------------: | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 880, + "name": "删除全局变量分类删除全局变量分类", + "intro": "删除全局变量分类", + "value": "删除全局变量分类", + "projectId": 212 + }, { + "id": 881, + "name": "删除全局变量分类", + "intro": "删除全局变量分类", + "value": "删除全局变量分类", + "projectId": 212 + }] +} +``` + +###### 搜索全局属性 +URL: /global_attr/search/ + +METHOD: POST + +URL Parameters|TYPE:Form + +Parameter | Type | Description +| :----------- | :------: | ------------: | +|projectId|Long|分类id| +|searchText|String|搜索的文本| + +content-type | application/x-www-form-urlencoded +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 880, + "name": "删除全局变量分类删除全局变量分类", + "intro": "删除全局变量分类", + "value": "删除全局变量分类", + "projectId": 212 + }, { + "id": 881, + "name": "删除全局变量分类", + "intro": "删除全局变量分类", + "value": "删除全局变量分类", + "projectId": 212 + }] +} +``` diff --git a/design/goods-APIDOC.md b/design/goods-APIDOC.md new file mode 100644 index 0000000..283481c --- /dev/null +++ b/design/goods-APIDOC.md @@ -0,0 +1,590 @@ +### 物品 +###### 添加物品模板 +URL: /goods/class/ + +METHOD: POST + +URL Parameters|TYPE: JSON +``` +{ + "name":"瑞哪", + "intro":"队长的报表", + "npcClassId":13, + "placeId":12, + "placeName":"中国", + "npcInstanceAttrVos":[ + { + "npcClassAttrId":1, + "name":"杀伤力", + "value":"1000", + }, + { + "npcClassAttrId":2, + "name":"年龄", + "value":"18" + } + ] +} +data +``` + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":{"id":12}} +``` + +###### 删除物品模板 +URL: /goods/class/{id}/ + +METHOD: DELETE + +URL Parameters | TYPE: + +Parameter | Type | Description +| :----------- | :------: | ------------: | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} +``` + +###### 更新物品模板信息 +URL: /goods/class/{id}/ + +METHOD: PUT + +URL Parameters|TYPE: JSON +``` +{ + "id": 12, + "name": "急救包", + "intro": "用来补充血量的物品", + "goodsClassAttrVos": [{ + "id": 39, + "name": "使用度", + "value": "50" + }, { + "id": 40, + "name": "加血量", + "value": "20" + }], + "projectId": 11 +} +``` + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} +``` + +###### 查询物品模板信息 +URL: /goods/class/{id}/ + +METHOD: GET + +URL Parameters|TYPE: + +Parameter | Type | Description +| :----------- | :------: | ------------: | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": { + "id": 12, + "name": "急救包", + "intro": "用来补充血量", + "goodsClassAttrVos": [{ + "id": 35, + "name": "重量", + "value": "100" + }, { + "id": 36, + "name": "药量", + "value": "20" + }, { + "id": 39, + "name": "使用度", + "value": "50" + }, { + "id": 40, + "name": "加血量", + "value": "20" + }], + "projectId": 11 + } +} + +``` + +###### 查询当前工程下所有物品类信息 +URL: /goods/class/ + +METHOD: GET + +URL Parameters|TYPE:Param + +Parameter | Type | Description +| :----------- | :------: | ------------: | +projectId | Long | 工程的id +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 11, + "name": "武器", + "intro": "角色的主要攻击手段", + "goodsClassAttrVos": [{ + "id": 32, + "name": "", + "value": "" + }, { + "id": 33, + "name": "疗效", + "value": "很快" + }, { + "id": 34, + "name": "苦", + "value": "一般" + }], + "projectId": 11 + }, { + "id": 15, + "name": "急救包", + "intro": "用来补充血量", + "goodsClassAttrVos": [{ + "id": 15, + "name": "332234234", + "value": "33" + }, { + "id": 45, + "name": "使用度", + "value": "50" + }, { + "id": 46, + "name": "加血量", + "value": "20" + }], + "projectId": 11 + }] +} +``` + +###### 添加物品实例信息 +URL: /goods/instance/ + +METHOD: POST + +URL Parameters|TYPE: JSON + +``` +{ + "name":"急救包", + "intro":"用来补充血量", + "placeId":13, + "placeName":"中国", + "npcId":11, + "npcName":"瑞哪", + "goodsClassId":"11", + "goodsInstanceAttrVos":[ + { + "goodsClassAttrId":1, + "name":"使用度", + "value":"50" + }, + { + "goodsClassAttrId":2, + "name":"加血量", + "value":"20" + } + ] +} +``` +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":{"id":20}} +``` +###### 删除物品实例信息 +URL: /goods/{id}/ + +METHOD: DELETE + +URL Parameters | TYPE: + +Parameter | Type | Description +| :----------- | :------: | ------------: | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} +``` + +###### 改变物品实例信息 +URL: /goods/id/ + +METHOD: PUT + +URL Parameters|TYPE: JSON +``` +{ + "id": 20, + "name": "急救包", + "intro": "用来补充血量的", + "placeId": 13, + "placeName": "中国", + "npcId": 11, + "npcName": "瑞哪", + "goodsClassId": 11, + "goodsInstanceAttrVos": [{ + "id": 3, + "name": "使用度", + "value": "20", + "goodsClassAttrId": 1, + "goodsInstanceId": 20 + }, { + "id": 4, + "name": "加血量", + "value": "10", + "goodsClassAttrId": 2, + "goodsInstanceId": 20 + },{ + "name": "加血量1", + "value": "100", + "goodsClassAttrId": 2, + "goodsInstanceId": 20 + }] +} +``` +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":{"id":3}} +``` +###### 获得物品实例信息 +URL: /goods/instance/{id}/ + +METHOD: GET + +URL Parameters|TYPE: + +Parameter | Type | Description +| :----------- | :------: | ------------: | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": { + "id": 20, + "name": "急救包", + "intro": "用来补充血量", + "placeId": 13, + "placeName": "中国", + "npcId": 11, + "npcName": "瑞哪", + "goodsClassId": 11, + "goodsInstanceAttrVos": [{ + "id": 3, + "name": "使用度", + "value": "50", + "goodsClassAttrId": 1, + "goodsInstanceId": 20 + }, { + "id": 4, + "name": "加血量", + "value": "20", + "goodsClassAttrId": 2, + "goodsInstanceId": 20 + }] + } +} +``` +###### 通过类获得所有物品实例信息 +URL: /goods/instance/ + +METHOD: GET + +URL Parameters|TYPE:Param + +Parameter | Type | Description +| :----------- | :------: | ------------: | +goodsClassId | Long | 物品分类的id +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 17, + "name": "急救包", + "intro": "用来补充血量", + "placeId": 13, + "placeName": "中国", + "npcId": 11, + "npcName": "瑞哪", + "goodsClassId": 11, + "goodsInstanceAttrVos": [] + }, { + "id": 18, + "name": "急救包", + "intro": "用来补充血量", + "placeId": 13, + "placeName": "中国", + "npcId": 11, + "npcName": "瑞哪", + "goodsClassId": 11, + "goodsInstanceAttrVos": [] + }, { + "id": 19, + "name": "急救包", + "intro": "用来补充血量", + "placeId": 13, + "placeName": "中国", + "npcId": 11, + "npcName": "瑞哪", + "goodsClassId": 11, + "goodsInstanceAttrVos": [{ + "id": 1, + "name": "使用度", + "value": "50", + "goodsClassAttrId": 1 + }, { + "id": 2, + "name": "加血量", + "value": "20", + "goodsClassAttrId": 2 + }] + }] + }] +} + +``` + +###### 搜索goods类 +URL: /goods/class/search/ + +METHOD: POST + +URL Parameters|TYPE:Form + +Parameter | Type | Description +| :----------- | :------: | ------------: | +|projectId|Long|游戏工程id| +|searchText|String|搜索的文本| + +content-type | application/x-www-form-urlencoded + +Result +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 13, + "name": "急救包", + "intro": "用来补充血量", + "goodsClassAttrVos": [{ + "id": 41, + "name": "使用度", + "value": "50" + }, { + "id": 42, + "name": "加血量", + "value": "20" + }], + "projectId": 11 + }, { + "id": 14, + "name": "急救包", + "intro": "用来补充血量", + "goodsClassAttrVos": [{ + "id": 43, + "name": "使用度", + "value": "50" + }, { + "id": 44, + "name": "加血量", + "value": "20" + }], + "projectId": 11 + }] +} +``` + +###### 搜索goods实例 +URL: /goods/instance/search/ + +METHOD: POST + +URL Parameters|TYPE:Form + +Parameter | Type | Description +| :----------- | :------: | ------------: | +|goodsClassId|Long|物品类的id| +|searchText|String|搜索的文本| + +content-type | application/x-www-form-urlencoded + +Result +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 28, + "name": "初级匕首", + "intro": "初级匕首", + "placeId": 13, + "placeName": "", + "npcId": 20, + "npcName": "", + "goodsClassId": 16, + "goodsInstanceAttrVos": [{ + "id": 19, + "name": "攻击速度", + "value": "110", + "goodsClassAttrId": 49 + }, { + "id": 20, + "name": "攻击力", + "value": "1000", + "goodsClassAttrId": 50 + }] + }, { + "id": 31, + "name": "二货匕首", + "intro": "二货的专用匕首", + "placeId": 13, + "placeName": "匕首", + "npcId": 20, + "npcName": "匕首", + "goodsClassId": 16, + "goodsInstanceAttrVos": [{ + "id": 17, + "name": "攻击速度", + "value": "222", + "goodsClassAttrId": 49 + }, { + "id": 18, + "name": "攻击力", + "value": "222", + "goodsClassAttrId": 50 + }] + }] +} +``` + +###### 获得游戏下的所有物品实例 +URL: /goods/instance_by_project_id/{projectId}/ + +METHOD: GET + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 33, + "name": "蓝色药水", + "intro": "有100ml能量液", + "placeId": 44, + "placeName": "营地", + "npcId": null, + "npcName": "瑞娜", + "goodsClassId": 20, + "goodsInstanceAttrVos": [{ + "id": 25, + "name": "数量", + "value": "2", + "goodsClassAttrId": 55 + }] + }, { + "id": 34, + "name": "纱布", + "intro": "能够进行简单包扎", + "placeId": 44, + "placeName": "营地", + "npcId": null, + "npcName": "", + "goodsClassId": 20, + "goodsInstanceAttrVos": [{ + "id": 26, + "name": "数量", + "value": "1", + "goodsClassAttrId": 55 + }] + }] +} + +``` diff --git a/design/jiaoyoutianxia_20190313_new_requirement.md b/design/jiaoyoutianxia_20190313_new_requirement.md new file mode 100644 index 0000000..3daf156 --- /dev/null +++ b/design/jiaoyoutianxia_20190313_new_requirement.md @@ -0,0 +1,223 @@ +##### 获取平台作品的分类标签(只是系统自定义分类和标签,作者定义的不显示) + +URL: http://aliyun-hz1.chewrobot.com:18082/api/label/system + +METHOD: GET + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | + +responseBody: +``` +SUCCESS: +{ + "code":1, + "msg":"成功", + "data":[ + { + typename:"", // 分类名 + labels:[ // 标签列表 + "", + "" + ] + } + ] +} +``` +##### 获取作品信息 + +URL: http://aliyun-hz1.chewrobot.com:18082/api/workInfo + +METHOD: GET +URL Parameters: +| fieldName | type | sendWay | explain | +| :----------- | :------------ | :------------ | :------------ | +| aipioneerUsername | String | RequestParams | 作品ID | + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | + +responseBody: +``` +SUCCESS: +{ + "code":1, + "msg":"成功", + "data":{ + "workname": // String;作品名称 + "authorname": // String;作者姓名 + "intro": // String;作品简介 + "preface": // String;作者有话说 + "labels":[ // 标签 + "标签1", + "标签2" + ] + "totalComment": // Number;评论的总数 + } +} +FAILTURE: +(1). +{ + "code":50001, + "msg":"当前作品信息不存在!", + "data":null +} + +``` + +##### 获取评论列表 + +URL: http://aliyun-hz1.chewrobot.com:18082/api/comment + +METHOD: GET + +URL Parameters +| fieldName | type | sendWay | explain | +| :----------- | :------------ | :------------ | :------------ | +| aipioneerUsername | String | RequestParams | 作品ID | +| page | Number | RequestParams | 第几页(默认:1) | +| pageSize | Number | RequestParams | 单次访问页面记录数量(默认:20) | +| position | Number | RequestParams | 表示分页数据在某一个时间节点访问(默认从开始获取数据) | + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | + +responseBody: +``` +SUCCESS: +{ + "code":1, + "msg":"成功", + "data":{ + position: // Number | 表示分页数据在某一个时间节点访问 + page: // Number | 第几页 + pageSize: // Number | 一页有多少条数据 + comments:[ + { + nickname: // 用户别名 + gmtCreate: // 评论创建时间 // Long 时间戳 + content: // 评论内容 + } + ] + } +} +FAILTURE: +(1). +{ + "code":50001, + "msg":"当前作品信息不存在!", + "data":null +} + +``` + +##### 发表评论 +URL: http://aliyun-hz1.chewrobot.com:18082/api/comment + +METHOD: POST + +RequestBody: +``` +{ + "aipioneerUsername": // String | 必填 | 作品ID + "content":"" // String | 必填 | 评论的内容 +} + +``` + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | +| Authorization | Bearer YOUR_ACCESS_TOKEN | + +responseBody: +``` +SUCCESS: +{ + "code": 1, + "msg": "成功", + "data": null +} +FAILTURE: +{ + "code":20002, + "msg":"用户认证失败!" + "data":null +} +{ + "code":10005, + "msg":"参数错误!", + "data":null +} +{ + "code":50001, + "msg":"当前作品信息不存在!", + "data":null +} +``` + +##### 作品搜索 + +URL: http://aliyun-hz1.chewrobot.com:18082/api/work/search + +METHOD: POST + +URL Parameters +``` +{ + "searchText":""// String | 选填 | 搜索的文本 + "type": // Number | 选填 默认1, 1:热门 2:最新 + "labels":[ // 或关系通过标签列表筛选 + "标签1", + "标签2" + ], + "page": // Number | 选填 | 页数(默认:0) + "pageSize": // Number | 选填 | 每一页(默认:20) +} + +``` + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | + +responseBody: +``` +SUCCESS: +{ + "code": 1, + "msg": "成功", + "data": { + page: // Number | 页数 + pageSize: // Number | 偏移量 + works:[ + { + "image": // String | 作品链接 + "workname": // String | 作品名称 + "authorname": // String | 作者名称 + "aipioneerUsername": // String | 作品ID + "hot": // Number | 热度 + } + ] + } +} +FAILTURE: +{ + "code":10005, + "msg":"参数错误!", + "data":null +} +``` diff --git a/design/json.json b/design/json.json new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/design/json.json diff --git a/design/label_api.md b/design/label_api.md new file mode 100644 index 0000000..748f6c2 --- /dev/null +++ b/design/label_api.md @@ -0,0 +1,93 @@ +##### 获取管理员定义的标签 + +URL: /label/system + +METHOD: GET + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | +| Authorization | token | + +responseBody: +``` +SUCCESS: +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 1, + "name": "按题材", + "labels": [{ + "id": 1, + "name": "古风" + }] + }, { + "id": 2, + "name": "按类型", + "labels": [{ + "id": 2, + "name": "冒险" + }] + }] +} +FAILTURE: +(1). +{ + "code":20007 + "msg":"用户认证失败!", + "data":null +} + +``` + +##### 管理员更新标签 +URL: /label/system + +METHOD: GET + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | +| Authorization | token | + +ReqeustBody: +``` +[{ + "id": 1, + "name": "按题", + "labels": [{ + "id": 1, + "name": "古风" + },{ + "name": "都市" + }] +}, { + "id": 2, + "name": "按类型", + "labels": [{ + "id": 2, + "name": "冒险" + }] +}] +``` + +ResponseBody: +``` +SUCCESS: +{ + "code":1, + "msg":"成功", + "data":null +} +FAILTURE: +{ + "code":20007 + "msg":"用户认证失败!", + "data":null +} +``` diff --git a/design/later_api.txt b/design/later_api.txt new file mode 100644 index 0000000..6dd32e3 --- /dev/null +++ b/design/later_api.txt @@ -0,0 +1,427 @@ +// 模糊搜索剧情文本 + @PostMapping(value="/search/") + public Result searchPlotText(@RequestParam Map searchForm) { + String searchText = (String)searchForm.get("searchText"); + Long categoryId = new Long((String)searchForm.get("categoryId")); + List plots = plotDao.getAllPlotByCategoryId(categoryId); + List plotFirstVos = new ArrayList(); + for(int i=0; i plotBranchRelates = plotBranchRelateDao.getAllPlotBranchRelateByBranchId(id); + for(int z=0; z plotBranchs = plotBranchDao.getAllBranchByPlotId(plotId); + for(int j=0; j plotBranchRelates = plotBranchRelateDao.getAllUpdatePlace(placeId.toString()); + for(int i=0; i goodsInstances = goodsInstanceDao.getAllByClassId(id); + for(int i=0; i goodsInstanceAttrs = goodsInstanceAttrDao.getAllByClassAttrId(classAttrId); + for(int i=0;i goodsInstanceAttrs = goodsInstanceAttrDao.getAllByClassAttrId(goodsClassId); + for(int j=0; j goodsInstances = goodsInstanceDao.getAllByClassId(classId); + for(int j=0; j plotBranchRelates = plotBranchRelateDao.getAllByInstanceId(goodsInstanceId, new Integer(0)); + for(int i=0; i plotBranchRelates = plotBranchRelateDao.getAllByInstanceId(goodsInstanceId, new Integer(1)); + for(int i=0; i npcInstances = npcInstanceDao.getAllByNpcClassId(npcClassId); + for(int i=0; i npcInstanceAttrs = npcInstanceAttrDao.getAllByClassAttrId(classAttrId); + for(int i=0; i npcInstanceAttrs = npcInstanceAttrDao.getAllByClassAttrId(npcClassId); + for(int j=0; j npcInstances = npcInstanceDao.getAllByNpcClassId(classId); + for(int j=0; j npcClassAttrVos) { + // 获取npc class attr 数据 + List npcClassAttrs = npcClassAttrDao.getAllByNpcClassId(classId); + // 整理数据为collection数据 + List npcClassAttrIds = new ArrayList(); + for(int i=0; i npcClassAttrVoIds = new ArrayList(); + for(int i=0; i plotBranchRelates = plotBranchRelateDao.getAllByInstanceId(npcInstanceId, new Integer(1)); + for(int i=0; i plotBranchRelates = plotBranchRelateDao.getAllByInstanceId(npcInstanceId, new Integer(1)); + for(int i=0; i plotBranchRelates = plotBranchRelateDao.getAllPlotBranchRelateByBranchId(id); + for(int z=0; z goodsClasss = goodsClassDao.getAllByProjectId(id); + for(int i=0; i NpcClasss = npcClassDao.getAllByProjectId(id); + for(int i=0; i plotCategorys = plotCategoryDao.getAllByGameProjectId(id); + for(int i=0; i goodsClasss = goodsClassDao.getAllByProjectId(id); + for(int i=0; i NpcClasss = npcClassDao.getAllByProjectId(id); + for(int i=0; i plotCategorys = plotCategoryDao.getAllByGameProjectId(id); + for(int i=0; i名称 + 角色 + 地点 +将重复使用的数据抽取出来 + +生成的时候集中调用数据生成相应的idmap + placeMap + npcClass + npcInstance + goodsClass + goodsInstance + plotText + +后期处理数据: + "ableGoes": [], + "nicknames": [] diff --git a/design/npc-APIDOC.md b/design/npc-APIDOC.md new file mode 100644 index 0000000..770d452 --- /dev/null +++ b/design/npc-APIDOC.md @@ -0,0 +1,706 @@ +### NPC + +###### 添加NPC类 +URL: /npc/class/ + +METHOD: POST + +URL Parameters|TYPE: JSON +``` +{ + "name":"瑞哪", + "intro":"队长的报表", + "projectId":11, + "npcClassAttrVos":[ + { + "name":"杀伤力", + "value":"1000", + }, + { + "name":"年龄", + "value":"18" + } + ] +} +``` + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":{"id":12}} +``` + +###### 删除NPC分类 +URL: /npc/class/{id}/ + +METHOD: DELETE + +URL Parameters|TYPE: + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} +``` +###### 更新NPC分类 +URL: /npc/class/{id}/ + +METHOD: PUT + +URL Parameters|TYPE: JSON +``` +{ + "id": 12, + "name": "瑞哪", + "intro": "队长的报表", + "projectId": 11, + "npcClassAttrVos": [{ + "id": 1, + "name": "杀伤力", + "value": "2000" + }, { + "id": 2, + "name": "年龄", + "value": "17" + },{ + "name":"身高", + "value":"180" + }] +} +``` + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} +``` +###### 查询NPC类 +URL: /npc/class/{id}/ + +METHOD: GET + +URL Parameters|TYPE: + +Parameter | Type | Description +| :----------- | :------: | ------------: | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": { + "id": 12, + "name": "瑞哪", + "intro": "队长的报表", + "projectId": 11, + "npcClassAttrVos": [{ + "id": 1, + "name": "杀伤力", + "value": "1000" + }, { + "id": 2, + "name": "年龄", + "value": "18" + }] + } +} +``` + +###### 通过工程id查询所有NPC分类 +URL: /npc/class/ + +METHOD: GET + +URL Parameters|TYPE:Param + +projectId Long 游戏工程id + +Parameter | Type | Description +| :----------- | :------: | ------------: | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 7, + "name": "商贩", + "intro": "游走于大陆上的商人", + "projectId": 11, + "npcClassAttrVos": [] + }, { + "id": 10, + "name": "飞机", + "intro": "用来", + "projectId": 11, + "npcClassAttrVos": [] + }, { + "id": 13, + "name": "瑞哪", + "intro": "队长的报表", + "projectId": 11, + "npcClassAttrVos": [{ + "id": 4, + "name": "杀伤力", + "value": "1000" + }, { + "id": 5, + "name": "年龄", + "value": "18" + }] + }] +} +``` +###### 添加NPC instance +URL: /npc/instance/ + +METHOD: POST + +URL Parameters|TYPE: JSON +``` +{ + "name":"瑞哪", + "intro":"队长的报表", + "npcClassId":13, + "placeId":12, + "placeName":"中国", + "npcInstanceAttrVos":[ + { + "npcClassAttrId":1, + "name":"杀伤力", + "value":"1000", + }, + { + "npcClassAttrId":2, + "name":"年龄", + "value":"18" + } + ] +} +``` + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":{"id":13}} +``` + +###### 删除NPC +URL: /npc/instance/{id}/ + +METHOD: DELETE + +URL Parameters|TYPE: + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} +``` + +##### 改变NPC +URL: /npc/instance/{id}/ + +METHOD: PUT + +URL Parameters|TYPE: JSON +``` +{ + "id": 14, + "name": "瑞哪", + "intro": "队长的报表", + "placeId": 12, + "placeName": "深证", + "npcInstanceAttrVos": [{ + "id": 25, + "name": "杀伤力", + "value": "3000", + "npcClassAttrId": 1 + }, { + "id": 26, + "name": "年龄", + "value": "17", + "npcClassAttrId": 2 + },{ + + "name": "体重", + "value": "80", + "npcClassAttrId": 2 + }], + "npcClassId": 13 +} +``` + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} + +``` + +###### 查询NPC instance +URL: /npc/instance/{id}/ + +METHOD: GET + +URL Parameters|TYPE: + +Parameter | Type | Description +| :----------- | :------: | ------------: | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": { + "id": 14, + "name": "瑞哪", + "intro": "队长的报表", + "placeId": 12, + "placeName": "中国", + "npcInstanceAttrVos": [{ + "id": 25, + "name": "杀伤力", + "value": "1000", + "npcClassAttrId": 1 + }, { + "id": 26, + "name": "年龄", + "value": "18", + "npcClassAttrId": 2 + }], + "npcClassId": 13 + } +} +``` +###### 通过分类查询所有NPC信息 +URL: /npc/instance/ + +METHOD: GET + +URL Parameters|TYPE:Param + +npcClassId Long npc分类id + +Parameter | Type | Description +| :----------- | :------: | ------------: | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 9, + "name": "瑞哪", + "intro": "队长的报表", + "placeId": 12, + "placeName": "中国", + "npcInstanceAttrVos": [], + "npcClassId": 13 + }, { + "id": 10, + "name": "瑞哪", + "intro": "队长的报表", + "placeId": 12, + "placeName": "中国", + "npcInstanceAttrVos": [{ + "id": 17, + "name": "杀伤力", + "value": "1000", + "npcClassAttrId": 1 + }, { + "id": 18, + "name": "年龄", + "value": "18", + "npcClassAttrId": 2 + }], + "npcClassId": 13 + }, { + "id": 11, + "name": "瑞哪", + "intro": "队长的报表", + "placeId": 12, + "placeName": "中国", + "npcInstanceAttrVos": [{ + "id": 19, + "name": "杀伤力", + "value": "1000", + "npcClassAttrId": 1 + }, { + "id": 20, + "name": "年龄", + "value": "18", + "npcClassAttrId": 2 + }], + "npcClassId": 13 + }] +} + +``` +###### 搜索npc类 +URL: /npc/class/search/ + +METHOD: POST + +URL Parameters|TYPE:Form + +Parameter | Type | Description +| :----------- | :------: | ------------: | +|projectId|Long|游戏工程id| +|searchText|String|搜索的文本| + +content-type | application/x-www-form-urlencoded + +Result +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 18, + "name": "男性", + "intro": "", + "projectId": 35, + "npcClassAttrVos": [{ + "id": 10, + "name": "", + "value": "" + }] + }, { + "id": 19, + "name": "女性", + "intro": "", + "projectId": 35, + "npcClassAttrVos": [{ + "id": 11, + "name": "", + "value": "" + }] + }] +} +``` + +###### 搜索npc类 +URL: /npc/class/search/ + +METHOD: POST + +URL Parameters|TYPE:Form + +Parameter | Type | Description +| :----------- | :------: | ------------: | +|projectId|Long|游戏工程id| +|searchText|String|搜索的文本| + +content-type | application/x-www-form-urlencoded + +Result +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 18, + "name": "男性", + "intro": "", + "projectId": 35, + "npcClassAttrVos": [{ + "id": 10, + "name": "", + "value": "" + }] + }, { + "id": 19, + "name": "女性", + "intro": "", + "projectId": 35, + "npcClassAttrVos": [{ + "id": 11, + "name": "", + "value": "" + }] + }] +} +``` + +###### 搜索npc类 +URL: /npc/instance/search/ + +METHOD: POST + +URL Parameters|TYPE:Form + +Parameter | Type | Description +| :----------- | :------: | ------------: | +|npcClassId|Long|npc类的id| +|searchText|String|搜索的文本| + +content-type | application/x-www-form-urlencoded + +Result +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 28, + "name": "哈娜", + "intro": "", + "placeId": 45, + "placeName": "", + "npcInstanceAttrVos": [{ + "id": 48, + "name": "", + "value": "", + "npcClassAttrId": 16 + }], + "npcClassId": 21 + }, { + "id": 29, + "name": "瑞娜", + "intro": "", + "placeId": 45, + "placeName": "", + "npcInstanceAttrVos": [{ + "id": 49, + "name": "", + "value": "", + "npcClassAttrId": 16 + }], + "npcClassId": 21 + }] +} +``` + +###### 获得npc unknown text 数据 + +URL: /npc/instance/unknown_text/{projectId}/ + +METHOD: GET + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 32, + "unknownText": "测试unknow text", + "npcName": "瑞娜" + }, { + "id": 91, + "unknownText": "测试unknow text", + "npcName": "哈娜1" + }, { + "id": 33, + "unknownText": "测试unknow text", + "npcName": "上校" + }, { + "id": 92, + "unknownText": "测试unknow text", + "npcName": "玩家" + }] +} +``` + +##### 改变NPC +URL: /npc/instance/unknown_text/{projectId}/ + +METHOD: PUT + +URL Parameters|TYPE: JSON +``` +[{ + "id": 32, + "unknownText": "测试unknow text", + "npcName": "瑞娜" +}, { + "id": 91, + "unknownText": "测试unknow text", + "npcName": "哈娜1" +}, { + "id": 33, + "unknownText": "测试unknow text", + "npcName": "上校" +}, { + "id": 92, + "unknownText": "测试unknow text", + "npcName": "玩家" +}] +``` + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} + +``` + +###### 通过分类查询所有NPC信息 +URL: /instance_by_project_id/{projectId}/ + +METHOD: GET + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 32, + "name": "瑞娜", + "intro": "", + "placeId": 35, + "placeName": "山洞", + "npcInstanceAttrVos": [{ + "id": 53, + "name": "友好度", + "value": "100", + "npcClassAttrId": 18 + }, { + "id": 54, + "name": "专业度", + "value": "90", + "npcClassAttrId": 19 + }, { + "id": 116, + "name": "友好度1", + "value": "500", + "npcClassAttrId": 71 + }], + "npcClassId": 23 + }, { + "id": 91, + "name": "哈娜1", + "intro": "", + "placeId": 35, + "placeName": "山洞", + "npcInstanceAttrVos": [{ + "id": 130, + "name": "友好度", + "value": "100", + "npcClassAttrId": 18 + }, { + "id": 131, + "name": "专业度", + "value": "90", + "npcClassAttrId": 19 + }, { + "id": 132, + "name": "友好度1", + "value": "500", + "npcClassAttrId": 71 + }], + "npcClassId": 23 + }, { + "id": 33, + "name": "上校", + "intro": "", + "placeId": 44, + "placeName": "", + "npcInstanceAttrVos": [{ + "id": 55, + "name": "离间度", + "value": "90", + "npcClassAttrId": 20 + }], + "npcClassId": 24 + }, { + "id": 92, + "name": "玩家", + "intro": "游戏的主角", + "placeId": 35, + "placeName": "山洞", + "npcInstanceAttrVos": [{ + "id": 133, + "name": "地点", + "value": "海边", + "npcClassAttrId": 73 + }], + "npcClassId": 76 + }, { + "id": 282, + "name": "旁白", + "intro": "承担剧情、人物和地点的介绍!", + "placeId": 0, + "placeName": "地球", + "npcInstanceAttrVos": [], + "npcClassId": 259 + }] +} +``` diff --git a/design/objectMap.json b/design/objectMap.json new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/design/objectMap.json diff --git a/design/pagination.md b/design/pagination.md new file mode 100644 index 0000000..f585d16 --- /dev/null +++ b/design/pagination.md @@ -0,0 +1,2 @@ +1.获取请求的总数,前端计算分页数 +2.limit=0&offset=1 diff --git a/design/pay-api.md b/design/pay-api.md new file mode 100644 index 0000000..d08f5d3 --- /dev/null +++ b/design/pay-api.md @@ -0,0 +1,5 @@ +http://aliyun-hz1.chewrobot.com:18082/payment/alipay/notice/refund +http://aliyun-hz1.chewrobot.com:18082/payment/wxpay/notice/refund + +http://aliyun-hz1.chewrobot.com:18082/payment/alipay/notice/pay +http://aliyun-hz1.chewrobot.com:18082/payment/wxpay/notice/pay diff --git a/design/phrase.md b/design/phrase.md new file mode 100644 index 0000000..398c966 --- /dev/null +++ b/design/phrase.md @@ -0,0 +1,258 @@ +BASEURL: http://didi-gz5.jiaoyou365.com + +##### 获取或搜索系统词组和作品词组 + +URL: baseUrl:19082/phrase/search?projectId={作品ID}&searchText={搜索的文本} + +Method: GET + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | +| Authorization | token | +| groupId | 组ID | +| mul | true | +| projectId | 项目ID | + +ResponseBody: +``` +SUCCESS: +{ + "code": 1, + "msg": "成功", + "data": [ + { + "phraseName": "品牌", + "updatePhraseName": null, + "pos": "名词", + "labels": "", + "phraseRemarks": "", + "content": null, + "type": 1, + "highPerformance": null, + "projectId": null + }, + { + "phraseName": "数词", + "updatePhraseName": null, + "pos": "数词", + "labels": "", + "phraseRemarks": "", + "content": null, + "type": 1, + "highPerformance": null, + "projectId": null + } + ] +} +``` +#### 获取单个词组内容 +URL: baseUrl:19082/phrase?phraseName={词组名称}&type={类型}&projectId={作品ID} + +Method: GET + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | +| Authorization | token | +| groupId | 组ID | +| mul | true | +| projectId | 项目ID | + +``` +参数说明: + type: 0->系统词组, 1->用户词组 +``` + +ResponseBody: +``` +SUCCESS: +{ + "code": 1, + "msg": "成功", + "data": [ + "美国", + "意大利" + ] +} +``` + +#### 插入作品词组 +URL: baseUrl:19082/phrase/work + +Method: POST + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | +| Authorization | token | +| groupId | 组ID | +| mul | true | +| projectId | 项目ID | + +RequestBody: +``` + { + "phraseName": "进峰测试1", + "pos": "名词", + "labels": "哈哈", + "content": "a+b+c", + "type": 0, + "highPerformance": true, + "phraseRemarks":"进峰测试", + "projectId": 1693 +} +``` + +ResponseBody: +``` +SUCCESS: +{ + "code": 1, + "msg": "成功", + "data": null +} +``` + + +#### 更新作品词组 +URL: baseUrl:19082/phrase/work + +Method: PUT + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | +| Authorization | token | +| groupId | 组ID | +| mul | true | +| projectId | 项目ID | + +RequestBody: +``` + +``` + +ResponseBody: +``` +SUCCESS: +{ + +} +``` + +#### 获取作品词组 +URL: baseUrl:19082/phrase/work/{词组名称}?projectId={作品ID} + +Method: GET + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | +| Authorization | token | +| groupId | 组ID | +| mul | true | +| projectId | 项目ID | + +RequestBody: +``` + +``` + +ResponseBody: +``` +SUCCESS: +{ + "code": 1, + "msg": "成功", + "data": { + "phraseName": "进峰测试3", + "pos": "名词", + "labels": "哈哈", + "phraseRemarks": "进峰测试", + "content": "a+b+c+d", + "type": null, + "highPerformance": true, + "projectId": 1693 + } +} +``` + +#### 删除作品词组 + +URL: baseUrl:19082/phrase/work/{词组名称}?projectId={作品ID} + +Method: DELETE + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | +| Authorization | token | +| groupId | 组ID | +| mul | true | +| projectId | 项目ID | + +RequestBody: +``` + +``` + +ResponseBody: +``` +SUCCESS: +{ + "code": 1, + "msg": "成功", + "data": null +} +``` + +##### 获取或搜索作品词组 + +URL: baseUrl:19082/phrase/work/search?projectId={作品ID}&searchText={搜索的文本} + +Method: GET + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | +| Authorization | token | +| groupId | 组ID | +| mul | true | +| projectId | 项目ID | + +ResponseBody: +``` +SUCCESS: +{ + "code": 1, + "msg": "成功", + "data": [ + { + "phraseName": "进峰测试3", + "updatePhraseName": null, + "pos": "名词", + "labels": "哈哈", + "phraseRemarks": "进峰测试", + "content": null, + "type": null, + "highPerformance": true, + "projectId": null + } + ] +} +``` \ No newline at end of file diff --git a/design/place-APIDOC.md b/design/place-APIDOC.md new file mode 100644 index 0000000..53e2c0c --- /dev/null +++ b/design/place-APIDOC.md @@ -0,0 +1,199 @@ +### 地点 + +###### 创建地点 +URL: /place/ + +METHOD: POST + +URL Parameters|TYPE: JSON +``` +{ + "name":"地点测试", + "nickname":"地点测试", + "ableGo":[2,3], + "ableGoName":"地点测试,地点测试", + "goFlag":1, + "isBase":True, + "intro":"地点测试地点测试地点测试", + "projectId":212 +} +``` + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":472} +``` +###### 删除地点 +URL: /place/{id}/ + +METHOD: DELETE + +Parameter | Type | Description +| :----------- | :------: | ------------: | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} +``` +###### 更新地点 +URL: /place/id/ + +METHOD: PUT + +URL Parameters|TYPE: JSON +``` +{ + "id":473, + "name":"地点测试", + "nickname":"地点测试", + "ableGo":[2,3], + "ableGoName":"地点测试,地点测试", + "goFlag":1, + "isBase":True, + "intro":"地点测试地点测试地点测试", + "projectId":212 +} +``` + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} +``` + +###### 查询地点信息 +URL: /place/{id}/ + +METHOD: GET + +URL Parameters|TYPE: + +Parameter | Type | Description +| :----------- | :------: | ------------: | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": { + "id": 473, + "name": "地点测试地点测试", + "nickname": "地点测试地点测试", + "ableGo": [4, 5], + "goFlag": 1, + "isBase": true, + "ableGoName": "地点测试,地点测试,地点测试,地点测试", + "intro": "地点测试地点测试地点测试", + "projectId": 212 + } +} +``` +###### 通过project id查询所有地点 +URL: /place/ + +METHOD: GET + +URL Parameters|TYPE: Param + +Parameter | Type | Description +| :----------- | :------: | ------------: | +projectId | Long | 地点分类id + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 473, + "name": "地点测试地点测试", + "nickname": "地点测试地点测试", + "ableGo": [4, 5], + "goFlag": 1, + "isBase": true, + "ableGoName": "地点测试,地点测试,地点测试,地点测试", + "intro": "地点测试地点测试地点测试", + "projectId": 212 + }, { + "id": 474, + "name": "地点测试2", + "nickname": "地点测试", + "ableGo": [2, 3], + "goFlag": 1, + "isBase": true, + "ableGoName": "地点测试,地点测试", + "intro": "地点测试地点测试地点测试", + "projectId": 212 + }] +} +``` + +###### 搜索全局属性 +URL: /place/search/ + +METHOD: POST + +URL Parameters|TYPE:Form + +Parameter | Type | Description +| :----------- | :------: | ------------: | +|projectId|Long|分类id| +|searchText|String|搜索的文本| + +content-type | application/x-www-form-urlencoded +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 473, + "name": "地点测试地点测试", + "nickname": "地点测试地点测试", + "ableGo": [4, 5], + "goFlag": 1, + "isBase": true, + "ableGoName": "地点测试,地点测试,地点测试,地点测试", + "intro": "地点测试地点测试地点测试", + "projectId": 212 + }, { + "id": 474, + "name": "地点测试2", + "nickname": "地点测试", + "ableGo": [2, 3], + "goFlag": 1, + "isBase": true, + "ableGoName": "地点测试,地点测试", + "intro": "地点测试地点测试地点测试", + "projectId": 212 + }] +} +``` diff --git a/design/plot-APIDOC.md b/design/plot-APIDOC.md new file mode 100644 index 0000000..5e82e8b --- /dev/null +++ b/design/plot-APIDOC.md @@ -0,0 +1,926 @@ +###### 添加剧情分组 +URL: /plot/category/ + +METHOD: POST + +URL Parameters|TYPE: JSON +``` +{ + "name":剧情分类名称, // String + "num":剧情分类的编号, // String + "intro":剧情分类简介, // String + "projectId":游戏工程id // Long +} +``` + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":{"id":2}} +``` + +###### 删除剧情分组 +URL: /plot/category/{id}/ + +METHOD: DELETE + +URL Parameters|TYPE: + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} +``` + +###### 改变剧情分组 +URL: /plot/category/{id}/ + +METHOD: PUT + +URL Parameters|TYPE: JSON +``` +{ + "id":剧情id, // Long + "num":剧情分组的编号, // String + "name":剧情分类名称, // String + "intro":剧情分类简介, // String + "projectId":游戏工程id // Long +} +``` + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} +``` + +###### 查询剧情分组 +URL: /plot/category/{id}/ + +METHOD: GET + +URL Parameters|TYPE: + +Parameter | Type | Description +| :----------- | :------: | ------------: | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": + { + "id": 6, + "num":"2", + "name": "two", + "intro": "two is two is two!", + "projectId": 18 + } +} +``` + +###### 通过工程id查询所有的剧情分组 +URL: /plot/category/ + +METHOD: GET + +URL Parameters|TYPE:Param + +projectId Long 游戏工程id + +Parameter | Type | Description +| :----------- | :------: | ------------: | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [ + { + "id": 5, + "num":"2", + "name": "plot category", + "intro": "plot category is plot category is plot category!", + "projectId": 18 + }, + { + "id": 6, + "num":"3", + "name": "two", + "intro": "two is two is two!", + "projectId": 18 + }] +} +``` +###### 添加剧情文本 +URL: /plot/text/ + +METHOD: POST + +URL Parameters|TYPE: JSON +``` +"plotNum":"1-1", +"plotPlaceId":2, +"plotPlaceName":"shengzheng", +"plotPlaceCategoryId":3, +"categoryId":6, +"plotTextVos":[ + { + "npcId":2, + "npcName":"npc test", + "npcCategoryId":2, + "content":"队长要去哪?", + }, + { + "npcId":3, + "npcName":"npc test", + "npcCategoryId":2, + "content":"队长在哪?", + } +] +``` + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":{"id":3}} +``` +###### 删除剧情 +URL: /plot/{id}/ + +METHOD: DELETE + +URL Parameters|TYPE: + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} +``` +###### 改变剧情文本 +URL: /plot/id/ + +METHOD: PUT + +URL Parameters|TYPE: JSON +``` +"plotId":6, +"plotNum":"1-1", +"plotPlaceId":2, +"plotPlaceName":"xinjiang", +"plotPlaceCategoryId":3, +"categoryId":6, +"plotTextVos":[ + { + "id":1, + "npcId":2, + "npcName":"hafdsdfs", + "npcCategoryId":2, + "content":"队长要去哪?", + }, + { + "id":2, + "npcId":3, + "npcName":"wan", + "npcCategoryId":2, + "content":"队长在哪?", + }, + { + "npcId":3, + "npcName":"nihoa", + "npcCategoryId":2, + "content":"women zai nao ", + } +] +``` + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} +``` + +###### 查询剧情文本 +URL: /plot/text/{id}/ + +METHOD: GET + +URL Parameters|TYPE: + +Parameter | Type | Description +| :----------- | :------: | ------------: | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": + { + "plotId": 3, + "plotNum": "1-1", + "plotPlaceId": 2, + "plotPlaceName": "xinjiang", + "plotPlaceCategoryId":3, + "categoryId": 6, + "plotTextVos": [ + { + "id": 1, + "content": "队长要去哪?", + "npcId": 2, + "npcName": "hafdsdfs", + "npcCategoryId":2, + "plotId": 3 + }, + { + "id": 2, + "content": "队长在哪?", + "npcId": 3, + "npcName": "wan", + "npcCategoryId":2, + "plotId": 3 + }, + { + "id": 5, + "content": "women zai nao ", + "npcId": 3, + "npcName": "nihoa", + "npcCategoryId":2, + "plotId": 3 + }, + { + "id": 6, + "content": "women zai nao ", + "npcId": 3, + "npcName": "nihoa", + "npcCategoryId":2, + "plotId": 3 + }] + } +} +``` +###### 通过分类id查询所有剧情文本 +URL: /plot/text/ + +METHOD: GET + +URL Parameters|TYPE:Param + +categoryId Long 剧情分组id + +Parameter | Type | Description +| :----------- | :------: | ------------: | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [ + { + "plotId": 2, + "plotNum": "1-1", + "plotPlaceId": 2, + "plotPlaceName": "shengzheng", + "plotPlaceCategoryId":3, + "categoryId": 6, + "plotTextVos": [] + }, + { + "plotId": 3, + "plotNum": "1-1", + "plotPlaceId": 2, + "plotPlaceName": "xinjiang", + "plotPlaceCategoryId":3, + "categoryId": 6, + "plotTextVos": [ + { + "id": 1, + "content": "队长要去哪?", + "npcId": 2, + "npcName": "hafdsdfs", + "npcCategoryId":2, + "plotId": 3 + }, + { + "id": 2, + "content": "队长在哪?", + "npcId": 3, + "npcName": "wan", + "npcCategoryId":2, + "plotId": 3 + }, + { + "id": 5, + "content": "women zai nao ", + "npcId": 3, + "npcName": "nihoa", + "npcCategoryId":2, + "plotId": 3 + }, + { + "id": 6, + "content": "women zai nao ", + "npcId": 3, + "npcName": "nihoa", + "npcCategoryId":2, + "plotId": 3 + }] + }] +} +``` +###### 更新剧情跳转 + +URL: /plot/branch/{plotId}/ + +METHOD: PUT + +URL Parameters|TYPE: JSON +``` +// 如果字典中包含id选项表示更新,没有表示添加 +{ + "plotId":3, //剧情id + "plotUnknowText":"ni shuo shenme wo ting budong!", // unknow情况下的文本 + "isWait":"1", + "plotBranchVos":[ + { + "nextPlotNum":"1-2", //当前分支跳转的剧情编号 + "nextPlotId":3, + "plotBranchMatchFieldVos":[ // 当前对话 + { + "type":"num", // 匹配方式 + match + num + time + any + "operator":"Bigger", // 比较符 + Keyword + Bigger + BiggerOrEqual + Smaller + SmallerOrEqual + Early + Later + "comparedValue":"2000", // 值 + "conditionId":"23", //condition id + "conditionName":"xiangyangzuoshenme!", // condition 名称 + } + ], + "plotBranchPremiseVos":[ //前置条件 + { + "globalAttrId":3, // 全局变量 id + "globalAttrName":"zidan", // 全局变量的名字 + "type":"num", // 匹配类型 + match + num + time + any + "operator":"Bigger", // 比较符 + Keyword + Bigger + BiggerOrEqual + Smaller + SmallerOrEqual + Early + Later + "comparedValue":"0", // 值 + } + ], + "plotBranchRelateVos":[ // 更新答案 + { + "module":"1", // 模块goods:0, npc:1, global_attr:2 + "categoryId":2, // 分类的id + "categoryName":"haha", // 分类名称 + "instanceId":2, // 实例id + "instanceName":"wuping", // 实例的名称 + "plotBranchRelateAttrVo":[ // 属性列表 + { + "attrId":12, // 属性id + "attrName":"暴力值", // 属性名称 + "attrValue":"10000" // 属性值 + } + ] + } + ] + } + ] +} +``` +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} +``` +###### 查看剧情跳转 +URL: /plot/branch/{id}/ + +METHOD: GET + +URL Parameters|TYPE: + +Parameter | Type | Description +| :----------- | :------: | ------------: | + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": + { + "plotId": 3, + "plotUnknowText": "ni shuo shenme wo ting budong!", + "isWait":"1", + "plotBranchVos": [ + { + "id": 1, + "nextPlotId": 3, + "nextPlotNum": "1-2", + "plotBranchMatchFieldVos": [ + { + "id": 43, + "type": "num", + "operator": "Bigger", + "comparedValue": "2000", + "conditionId": 23, + "conditionName": "xiangyangzuoshenme!", + "plotBranchId": 1 + }], + "plotBranchPremiseVos": [ + { + "id": 32, + "globalAttrId": 3, + "globalAttrName": "zidan", + "type": "num", + "operator": "Bigger", + "comparedValue": "0", + "plotBranchId": 1 + }], + "plotBranchRelateVos": [ + { + "id": 43, + "module": 1, + "categoryId": 2, + "categoryName": "haha", + "instanceId": 2, + "instanceName": "wuping", + "plotBranchRelateAttrVo": [ + { + "id": 44, + "attrId": 12, + "attrName": "暴力值", + "attrValue": "10000", + "plotBranchRelateId": 43 + }], + "plotBranchId": 1 + }, + { + "id": 44, + "module": 1, + "categoryId": 2, + "categoryName": "haha", + "instanceId": 2, + "instanceName": "wuping", + "plotBranchRelateAttrVo": [ + { + "id": 45, + "attrId": 12, + "attrName": "暴力值", + "attrValue": "10000", + "plotBranchRelateId": 44 + }], + "plotBranchId": 1 + }] + }] + } +} +``` +###### 更新qa list +URL: /plot/qa/{plotId}/ + +METHOD: POST + +URL Parameters|TYPE: JSON +``` +[ + { + "id":1, // 保存之后的 + "question":"他是不是傻?", // 问题 + "answer":"嗯嗯", // 回答 + }, + { + "question":"他是不是呆子?", + "answer":"嗯嗯", + }, +] +``` +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} +``` + +###### overview 预览 +URL: /plot/overview/{projectid}/ + +METHOD: GET + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "num": "4-3", + "npcName": "瑞娜", + "npcDiaContent": "\"【瑞娜】 哎呀,没什么好看的,主驾驶死了,脖子上有代表组织身份的骷髅纹身,口袋里的字条上写着武器库找【专家】夺取真的武器设计图,一看就是骗局", + "branch": [] + }, { + "num": "4-2", + "npcName": "瑞娜", + "npcDiaContent": "\"【旁白】 我找了一个看大海的好位置,刚刚坐下,【瑞娜】就兴奋的把我拖向丛林的位置
【瑞娜】 看我找到了什么,这可是暗国的导弹穿梭舱,可一次搭载2个人,副驾驶有血迹,应该是逃进丛林了,哈哈,希望不要太弱,能让我享受一下", + "branch": [] + }, { + "num": "4-1", + "npcName": "瑞娜", + "npcDiaContent": "\"【旁白】 【瑞娜】在我前面跑向沙滩,只见她用手摸了一下沙滩,然后就光着脚肆意奔跑,几分钟后以大字躺在沙滩上
【瑞娜】 嗯,好久没躺在这么干燥的沙滩上了,喂,你在那等我,我要在这附近活动活动", + "branch": [] + }, { + "num": "3-3", + "npcName": "瑞娜", + "npcDiaContent": "\"【瑞娜把男人拖到洞口,扯下男人衬衫上的一条布,做了个简单的包扎止住流血了.然后站起来踢了他两脚】
【瑞娜】哎哎,小子,该醒醒了.队长,他醒了,动脑筋的事最烦人了,姓甚名谁跟来历,你来问吧\"", + "branch": [] + }, { + "num": "3-2", + "npcName": "瑞娜", + "npcDiaContent": "\"【瑞娜摩拳擦掌,大步流星踏进山洞.山洞像个废弃的防空洞,里面有点昏暗】
【瑞娜】队长,这有个晕倒的男人,看痕迹是被拖进来的.头上才留点血就晕倒了,没对手还遇到个病号,真没劲\"", + "branch": [] + }, { + "num": "3-1", + "npcName": "瑞娜", + "npcDiaContent": "\"【离开了湿热的海边,我们来到一个两米高的的山洞前.】
【瑞娜】队长,我们来到山洞了.让我先进去会会里面的妖魔鬼怪.\"", + "branch": [] + }, { + "num": "2-2", + "npcName": "瑞娜", + "npcDiaContent": "【瑞娜环视了一下周围,突然径直向营房深处走去,蹲在地上捡起了一个东西,然后表情严肃的向我走来】\n【瑞娜】真没意思,只发现了脚印,而且脚印不是龙国部队的军靴纹路,还有个肩章,真无聊", + "branch": [] + }, { + "num": "2-1", + "npcName": "瑞娜", + "npcDiaContent": "【我们来到废弃的营地,几排简易的木屋无声无息的坐落在林间,周围静的吓人,瑞娜谨慎的看着四周】\n【瑞娜】队长,营地大门的封条是新的,可以让我先进去吗", + "branch": [] + }, { + "num": "1-9", + "npcName": "瑞娜", + "npcDiaContent": "【瑞娜】队长,北面有一个废弃的营地,西面是一片安静的沙滩,东面有一个空旷的山洞,咱们去哪", + "branch": [] + }, { + "num": "1-8", + "npcName": "瑞娜", + "npcDiaContent": "【哈娜听完我的回答,转身冲向漆黑的大海,掏出枪疯狂的射击,就在哈娜要自杀的瞬间,瑞娜一脚踢飞了哈娜,然后把哈娜从海里拖到了岸上】", + "branch": [{ + "nextNum": "1-9", + "conditionKeyword": [{ + "conditionName": "yaobuyao", + "keyword": "不要" + }] + }] + }, { + "num": "1-7", + "npcName": "瑞娜", + "npcDiaContent": "【哈娜听完我的回答,转身面向大海的方向,做了一个舒展全身的动作,修长的身材映着月光,甚是好看】瑞娜】队长,差不多该行动了,我想趁着迷人的夜色,调查一下周围的环境,可以吗", + "branch": [{ + "nextNum": "1-9", + "conditionKeyword": [{ + "conditionName": "yaobuyao", + "keyword": "可以" + }] + }] + }, { + "num": "1-6", + "npcName": "瑞娜", + "npcDiaContent": "【瑞娜】组织的审核员真是严格呢,哈娜,你是个不错的对手哦,现在可以解释任务了吧\n【哈娜】你也很棒,下一步,在岛上找你们的接头人,接头暗语是,恶梦;你们的接头暗号是:梦总会醒\n【哈娜舔了一下紫红色的嘴唇,缓步走到我的面前,我可以闻到哈娜身上夹杂淡淡香气的汗味】\n【哈娜】队长,我想问你们一个问题,就像我救了你们,那我算好人吗,施救者一定是好人吗", + "branch": [{ + "nextNum": "1-7", + "conditionKeyword": [{ + "conditionName": "yaobuyao", + "keyword": "是" + }] + }, { + "nextNum": "1-8", + "conditionKeyword": [{ + "conditionName": "yaobuyao", + "keyword": "不是" + }] + }] + }, { + "num": "1-5", + "npcName": "哈娜", + "npcDiaContent": "【哈娜】喂,队长,你的乳牛很自信啊,我叫哈娜,岛上没有人敢叫我小姑娘,任何和我相处久的人都知道,我很不友善。\n【瑞娜】小姑娘,虽然你为救我们烧伤了手和头发,但我会给你留下回答我们问题的力气\n【火光中,两个狂徒在展开了疯狂的互殴,在一阵恐怖的碰撞声后,瑞娜一脚踢中哈娜的小腹,哈娜后退几步怒视着瑞娜,突然,哈娜掏出了手枪,两个人都看向我这边】\n【瑞娜】: 要不要干掉他", + "branch": [{ + "nextNum": "1-6", + "conditionKeyword": [{ + "conditionName": "yaobuyao", + "keyword": "相信+搜索+检查+搜寻+搜+寻找+一下+搜查+线索+关系+埋伏+情况+任务+门+证据+搜搜+脚印+四处+四下+周围+四周+想干啥+危险+炸药+控制器+导线+物品+爆炸装置+炸弹+武器+资料+优盘+文件+信+设计图+肩章+报告+东西+急救包+秘密报告+武器设计图+设计图纸+残骸+材料+火手+司令+灰土+希尔+人+士兵+组织+博士+国家+安全部+他+李雪+驾驶员+主驾驶员+副驾驶员+身+上校+内奸+保密官+间谍+内奸+小岛+沙滩+指挥部+海边+丛林+北面丛林+西面丛林+资料室+死岛的房间+观察站+岛+岛上+沙滩+指挥部+海边+海里+海+丛林+森林+北面丛林+西面丛林+东面丛林+南面丛林+北边丛林+西边丛林+东边丛林+南边丛林+北面沙滩+西面沙滩+南面沙滩+东面沙滩+资料室+死岛的房间+希尔的房间+火手房间+司令的房间+死岛房间+希尔房间+火手的房间+司令房间+上校房间+上校的房间+房间+观察站+东面+北面+西面+南面+往西+往北+往南+东+西+北+东+南+西边+东边+北边+南边+武器库+门+吉普车+密室+办公室+指挥部办公室+西丛林+北丛林+南丛林+东丛林+周围+一下+里面+上面+下面+左边+右边+前面+后面+四周+附近+外面+周边+车+这里+向北+向南+向东+向西+向上+向下+向左+向右+向前+向后+下一关+上海+北京+好的+要+森林+营地+指挥部大厅+山洞+灰土的房间+这里+安全的地方+监控室+指挥官+保密官+臂章+安全绳+电筒+秘密任务+飞机+幸存者+接头人+杀人犯+犯人+别离开+别逃走+别逃离+别逃跑+别逃开+不逃走+不逃离+不逃跑+逃走+逃离+逃跑+开枪+卧底+脚印+游戏+信息+特务+警卫员+秘密武器设计图+哈娜+专家+部队+纸团+地方" + }] + }] + }, { + "num": "1-4", + "npcName": "", + "npcDiaContent": "【哈娜】虽然说得没有漏洞,但我还是不相信你们,我从没见有谁如此费尽心机的来到卡里岛,组织允许我用任何方式考验队友", + "branch": [{ + "nextNum": "1-5", + "conditionKeyword": [{ + "conditionName": "yaobuyao", + "keyword": "相信+搜索+检查+搜寻+搜+寻找+一下+搜查+线索+关系+埋伏+情况+任务+门+证据+搜搜+脚印+四处+四下+周围+四周+想干啥+危险+炸药+控制器+导线+物品+爆炸装置+炸弹+武器+资料+优盘+文件+信+设计图+肩章+报告+东西+急救包+秘密报告+武器设计图+设计图纸+残骸+材料+火手+司令+灰土+希尔+人+士兵+组织+博士+国家+安全部+他+李雪+驾驶员+主驾驶员+副驾驶员+身+上校+内奸+保密官+间谍+内奸+小岛+沙滩+指挥部+海边+丛林+北面丛林+西面丛林+资料室+死岛的房间+观察站+岛+岛上+沙滩+指挥部+海边+海里+海+丛林+森林+北面丛林+西面丛林+东面丛林+南面丛林+北边丛林+西边丛林+东边丛林+南边丛林+北面沙滩+西面沙滩+南面沙滩+东面沙滩+资料室+死岛的房间+希尔的房间+火手房间+司令的房间+死岛房间+希尔房间+火手的房间+司令房间+上校房间+上校的房间+房间+观察站+东面+北面+西面+南面+往西+往北+往南+东+西+北+东+南+西边+东边+北边+南边+武器库+门+吉普车+密室+办公室+指挥部办公室+西丛林+北丛林+南丛林+东丛林+周围+一下+里面+上面+下面+左边+右边+前面+后面+四周+附近+外面+周边+车+这里+向北+向南+向东+向西+向上+向下+向左+向右+向前+向后+下一关+上海+北京+好的+要+森林+营地+指挥部大厅+山洞+灰土的房间+这里+安全的地方+监控室+指挥官+保密官+臂章+安全绳+电筒+秘密任务+飞机+幸存者+接头人+杀人犯+犯人+别离开+别逃走+别逃离+别逃跑+别逃开+不逃走+不逃离+不逃跑+逃走+逃离+逃跑+开枪+卧底+脚印+游戏+信息+特务+警卫员+秘密武器设计图+哈娜+专家+部队+纸团+地方" + }] + }] + }, { + "num": "1-3", + "npcName": "瑞娜", + "npcDiaContent": "【(舱门打开声,气流声)就在瑞娜打开舱门的瞬间,(三个爆炸声,燃烧声,警报声,尖锐的风声)飞机被被两枚飞弹击中引发连锁爆炸,在夜空中燃烧着坠向卡里岛】【哈娜】喂,你们这么大费周章的来到卡里岛,是为了什么,你们是谁", + "branch": [{ + "nextNum": "1-4", + "conditionKeyword": [{ + "conditionName": "shishui", + "keyword": "找到+当+派+被+想+把+设计图+逃跑+脚印+发明+去+秘密报告+暗号+卧底+攻击+偷走+对话+有+人+做+干+发现+你们+你+他们+他+聊天+说话+主驾驶+副驾驶+秘密报告+信+肩章+组织+接头人+搏斗+瑞娜+士兵+李雪+司令+上校+指挥官+专家+杰克+保密官+孤儿+希尔+哈娜+博士+警卫员+主驾驶员+副驾驶员+通信官+哈尔+是+在+袭击+抢走+抢+杀+找+偷+帮+帮助+知道+间谍+发射+打倒+摧毁+指挥+执行+杀死+带+走+关系+声音+守卫+负责+管+管理+官+海边+沙滩+营地+山洞+指挥部大厅+指挥部+司令房间+上校房间+希尔房间+客房+房间+资料室+监控室+武器库+武器室+密室+陷阱+观察站+丛林+卡里岛+小岛+坠机点+双重间谍+landey+线索+设计图+维和任务+飞弹+下来+信任+细沙+特遣队+打倒" + }] + }] + }, { + "num": "1-2", + "npcName": "瑞娜", + "npcDiaContent": "【瑞娜冷笑的看着我,在她动作娴熟的盘起那黑色瀑布般头发的同时,那傲人的身材一览无余,我不由自主的吞咽了一下】\n【瑞娜】队长,在跳伞以前我有个问题,组织为什么让咱们两个互不相识的人做任务,组织只说到岛上找接头人,组织有告诉你什么消息吗\n", + "branch": [{ + "nextNum": "1-3", + "conditionKeyword": [{ + "conditionName": "yaobuyao", + "keyword": "好的" + }] + }] + }, { + "num": "1-1", + "npcName": "瑞娜", + "npcDiaContent": "【凌晨的大海上,(海浪声,飞机飞行声)我在一架悄然靠近卡里岛的无人运输机里,我身旁,一位身着黑色紧身作战服的黑发美女正泰然自若的看着窗外】\n【瑞娜】特遣队长,我是龙爪的副官瑞娜,擅长格斗(拳头卡拉卡拉声),希望在本次卡里岛的秘密任务中,合作愉快。", + "branch": [{ + "nextNum": "1-2", + "conditionKeyword": [{ + "conditionName": "yaobuyao::5", + "keyword": "相信+搜索+检查+搜寻+搜+寻找+一下+搜查+线索+关系+埋伏+情况+任务+门+证据+搜搜+脚印+四处+四下+周围+四周+想干啥+危险+炸药+控制器+导线+物品+爆炸装置+炸弹+武器+资料+优盘+文件+信+设计图+肩章+报告+东西+急救包+秘密报告+武器设计图+设计图纸+残骸+材料+火手+司令+灰土+希尔+人+士兵+组织+博士+国家+安全部+他+李雪+驾驶员+主驾驶员+副驾驶员+身+上校+内奸+保密官+间谍+内奸+小岛+沙滩+指挥部+海边+丛林+北面丛林+西面丛林+资料室+死岛的房间+观察站+岛+岛上+沙滩+指挥部+海边+海里+海+丛林+森林+北面丛林+西面丛林+东面丛林+南面丛林+北边丛林+西边丛林+东边丛林+南边丛林+北面沙滩+西面沙滩+南面沙滩+东面沙滩+资料室+死岛的房间+希尔的房间+火手房间+司令的房间+死岛房间+希尔房间+火手的房间+司令房间+上校房间+上校的房间+房间+观察站+东面+北面+西面+南面+往西+往北+往南+东+西+北+东+南+西边+东边+北边+南边+武器库+门+吉普车+密室+办公室+指挥部办公室+西丛林+北丛林+南丛林+东丛林+周围+一下+里面+上面+下面+左边+右边+前面+后面+四周+附近+外面+周边+车+这里+向北+向南+向东+向西+向上+向下+向左+向右+向前+向后+下一关+上海+北京+好的+要+森林+营地+指挥部大厅+山洞+灰土的房间+这里+安全的地方+监控室+指挥官+保密官+臂章+安全绳+电筒+秘密任务+飞机+幸存者+接头人+杀人犯+犯人+别离开+别逃走+别逃离+别逃跑+别逃开+不逃走+不逃离+不逃跑+逃走+逃离+逃跑+开枪+卧底+脚印+游戏+信息+特务+警卫员+秘密武器设计图+哈娜+专家+部队+纸团+地方" + }] + }] + }] +} +``` + +###### 搜索剧情文本,通过npc名陈 +URL: /plot/search/ + +METHOD: POST + +URL Parameters|TYPE:Form + +Parameter | Type | Description +| :----------- | :------: | ------------: | +|categoryId|Long|分类id| +|searchText|String|搜索的文本| + +content-type | application/x-www-form-urlencoded +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "plotId": 21, + "plotNum": "1-1", + "plotPlaceCategoryId": 41, + "plotPlaceId": 57, + "plotPlaceName": "海边", + "categoryId": 19, + "plotTextVos": [{ + "id": 37, + "content": "【凌晨的大海上,(海浪声,飞机飞行声)我在一架悄然靠近卡里岛的无人运输机里,我身旁,一位身着黑色紧身作战服的黑发美女正泰然自若的看着窗外】\n【瑞娜】特遣队长,我是龙爪的副官瑞娜,擅长格斗(拳头卡拉卡拉声),希望在本次卡里岛的秘密任务中,合作愉快。", + "npcCategoryId": 23, + "npcId": 32, + "npcName": "瑞娜", + "plotId": 21 + }] + }, { + "plotId": 22, + "plotNum": "1-2", + "plotPlaceCategoryId": 41, + "plotPlaceId": 57, + "plotPlaceName": "海边", + "categoryId": 19, + "plotTextVos": [{ + "id": 38, + "content": "【瑞娜冷笑的看着我,在她动作娴熟的盘起那黑色瀑布般头发的同时,那傲人的身材一览无余,我不由自主的吞咽了一下】\n【瑞娜】队长,在跳伞以前我有个问题,组织为什么让咱们两个互不相识的人做任务,组织只说到岛上找接头人,组织有告诉你什么消息吗\n", + "npcCategoryId": 23, + "npcId": 32, + "npcName": "瑞娜", + "plotId": 22 + }] + }, { + "plotId": 36, + "plotNum": "1-3", + "plotPlaceCategoryId": 41, + "plotPlaceId": 53, + "plotPlaceName": "观察站", + "categoryId": 19, + "plotTextVos": [{ + "id": 49, + "content": "【(舱门打开声,气流声)就在瑞娜打开舱门的瞬间,(三个爆炸声,燃烧声,警报声,尖锐的风声)飞机被被两枚飞弹击中引发连锁爆炸,在夜空中燃烧着坠向卡里岛】【哈娜】喂,你们这么大费周章的来到卡里岛,是为了什么,你们是谁", + "npcCategoryId": 23, + "npcId": 32, + "npcName": "瑞娜", + "plotId": 36 + }] + }, { + "plotId": 37, + "plotNum": "1-4", + "plotPlaceCategoryId": 41, + "plotPlaceId": 57, + "plotPlaceName": "海边", + "categoryId": 19, + "plotTextVos": [{ + "id": 50, + "content": "【哈娜】虽然说得没有漏洞,但我还是不相信你们,我从没见有谁如此费尽心机的来到卡里岛,组织允许我用任何方式考验队友", + "npcCategoryId": 25, + "npcId": 34, + "npcName": "", + "plotId": 37 + }, { + "id": 51, + "content": "【瑞娜】队长,看来我可以跟这个小姑娘好好聊聊,可以吗", + "npcCategoryId": 23, + "npcId": 32, + "npcName": "瑞娜", + "plotId": 37 + }] + }, { + "plotId": 39, + "plotNum": "1-5", + "plotPlaceCategoryId": 41, + "plotPlaceId": 57, + "plotPlaceName": "海边", + "categoryId": 19, + "plotTextVos": [{ + "id": 52, + "content": "【哈娜】喂,队长,你的乳牛很自信啊,我叫哈娜,岛上没有人敢叫我小姑娘,任何和我相处久的人都知道,我很不友善。\n【瑞娜】小姑娘,虽然你为救我们烧伤了手和头发,但我会给你留下回答我们问题的力气\n【火光中,两个狂徒在展开了疯狂的互殴,在一阵恐怖的碰撞声后,瑞娜一脚踢中哈娜的小腹,哈娜后退几步怒视着瑞娜,突然,哈娜掏出了手枪,两个人都看向我这边】\n【瑞娜】: 要不要干掉他", + "npcCategoryId": 25, + "npcId": 34, + "npcName": "哈娜", + "plotId": 39 + }] + }, { + "plotId": 40, + "plotNum": "1-6", + "plotPlaceCategoryId": 41, + "plotPlaceId": 57, + "plotPlaceName": "海边", + "categoryId": 19, + "plotTextVos": [{ + "id": 53, + "content": "【瑞娜】组织的审核员真是严格呢,哈娜,你是个不错的对手哦,现在可以解释任务了吧\n【哈娜】你也很棒,下一步,在岛上找你们的接头人,接头暗语是,恶梦;你们的接头暗号是:梦总会醒\n【哈娜舔了一下紫红色的嘴唇,缓步走到我的面前,我可以闻到哈娜身上夹杂淡淡香气的汗味】\n【哈娜】队长,我想问你们一个问题,就像我救了你们,那我算好人吗,施救者一定是好人吗", + "npcCategoryId": 23, + "npcId": 32, + "npcName": "瑞娜", + "plotId": 40 + }] + }, { + "plotId": 45, + "plotNum": "1-7", + "plotPlaceCategoryId": 41, + "plotPlaceId": 57, + "plotPlaceName": "海边", + "categoryId": 19, + "plotTextVos": [{ + "id": 54, + "content": "【哈娜听完我的回答,转身面向大海的方向,做了一个舒展全身的动作,修长的身材映着月光,甚是好看】瑞娜】队长,差不多该行动了,我想趁着迷人的夜色,调查一下周围的环境,可以吗", + "npcCategoryId": 23, + "npcId": 32, + "npcName": "瑞娜", + "plotId": 45 + }] + }, { + "plotId": 46, + "plotNum": "1-8", + "plotPlaceCategoryId": 41, + "plotPlaceId": 57, + "plotPlaceName": "海边", + "categoryId": 19, + "plotTextVos": [{ + "id": 55, + "content": "【哈娜听完我的回答,转身冲向漆黑的大海,掏出枪疯狂的射击,就在哈娜要自杀的瞬间,瑞娜一脚踢飞了哈娜,然后把哈娜从海里拖到了岸上】", + "npcCategoryId": 23, + "npcId": 32, + "npcName": "瑞娜", + "plotId": 46 + }] + }, { + "plotId": 47, + "plotNum": "1-9", + "plotPlaceCategoryId": 41, + "plotPlaceId": 57, + "plotPlaceName": "海边", + "categoryId": 19, + "plotTextVos": [{ + "id": 56, + "content": "【瑞娜】队长,北面有一个废弃的营地,西面是一片安静的沙滩,东面有一个空旷的山洞,咱们去哪", + "npcCategoryId": 23, + "npcId": 32, + "npcName": "瑞娜", + "plotId": 47 + }] + }] +} +``` + +``` +plotBranchRelateVo: + module: + -1:condition + 0:goods + 1:npc + 2:globalAttr + 3:place + type: + match + num + time + any + objectId: 如果是角色,物品,地点把相应的id放在这 + attrId:属性id,如果有就填写,没有可以不填 + attrName: 属性名称,如果是condition必须得有 + operator: 几乎没有变 +``` diff --git a/design/qaExample.xlsx b/design/qaExample.xlsx new file mode 100644 index 0000000..b36b2f3 Binary files /dev/null and b/design/qaExample.xlsx differ diff --git a/design/relation_prediction_service.md b/design/relation_prediction_service.md new file mode 100644 index 0000000..fd7f32c --- /dev/null +++ b/design/relation_prediction_service.md @@ -0,0 +1,58 @@ +## Relation Prediction + +输入一组{sent, rel}句子关系对,判断每个句子是否属于对应的关系,分值越接近于1表示可能性越大。 + +1. 如果格式不正确,没有“sents",则返回{"error": "xxx"} +2. 每个句子关系对中,若对应的关系rel没有分类模型,则返回-1;若不存在sent或者rel,则直接跳过; + +``` +$ http --verbose POST http://localhost:5000/predict <<< '{"sents": [ + {"sent": "hello", "rel": "negative_mood"}, + {"sent": "hello", "rel": "something_where"}]}' + +POST /predict HTTP/1.1 +Accept: application/json +Accept-Encoding: gzip, deflate +Connection: keep-alive +Content-Length: 110 +Content-Type: application/json +Host: localhost:5000 +User-Agent: HTTPie/0.9.2 + +{ + "sents": [ + { + "rel": "negative_mood", + "sent": "hello" + }, + { + "rel": "something_where", + "sent": "hello" + } + ] +} + +HTTP/1.1 200 OK +Connection: close +Date: Tue, 07 Apr 2020 02:51:53 GMT +Server: gunicorn/20.0.4 +content-length: 145 +content-type: application/json + +{ + "result": [ + { + "rel": "negative_mood", + "score": "0.26477456", + "sent": "hello" + }, + { + "rel": "something_where", + "score": "0.6543278", + "sent": "hello" + } + ] +} + +``` + diff --git a/design/speechcraft-api.md b/design/speechcraft-api.md new file mode 100644 index 0000000..920bfa0 --- /dev/null +++ b/design/speechcraft-api.md @@ -0,0 +1,124 @@ +###### 获取话术列表 +URL: /speechcraft/{projectId}/ + +METHOD: GET + +URL Parameters|TYPE: JSON + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 1, + "name": "WHERE_I_AM", + "value": "你在%s", + "description": "我在哪里", + "projectId": 172 + }, { + "id": 2, + "name": "PATH_AT", + "value": "你已经在%s", + "description": "怎么去沙滩/我要去xx", + "projectId": 172 + }, { + "id": 3, + "name": "PATH_ADJOINT", + "value": "就在附近哦", + "description": "怎么去沙滩", + "projectId": 172 + }, { + "id": 4, + "name": "PATH_EXIST", + "value": "通过%s可以到达目的地", + "description": "怎么去沙滩", + "projectId": 172 + }, { + "id": 5, + "name": "PATH_NOT_EXIST", + "value": "不可到达", + "description": "怎么去沙滩/我要去xx", + "projectId": 172 + }, { + "id": 6, + "name": "CAN_GO_SITES", + "value": "你可以去%s", + "description": "我能去哪里", + "projectId": 172 + }, { + "id": 7, + "name": "CAN_GO_NOWHERE", + "value": "没什么地方可去的,继续玩吧", + "description": "我能去哪里", + "projectId": 172 + }, { + "id": 8, + "name": "SITE_NOT_ACTIVE", + "value": "你来到了%s\",现在什么都没有, 请继续之前的剧情,接着往下玩吧!\"", + "description": "我要去xx", + "projectId": 172 + }, { + "id": 9, + "name": "SITE_NOT_ADJOINT", + "value": "通过%s可以到达目的地", + "description": "我要去xx", + "projectId": 172 + }, { + "id": 10, + "name": "AROUND_PEOPLE", + "value": "周围有%s", + "description": "周围有什么人", + "projectId": 172 + }, { + "id": 11, + "name": "AROUND_ITEMS", + "value": "周围有%s", + "description": "周围有什么物品", + "projectId": 172 + }, { + "id": 12, + "name": "AROUND_THINGS", + "value": "周围有%s", + "description": "周围有什么", + "projectId": 172 + }] +} +``` + +###### 更新话术列表 +URL: /speechcraft/{projectId}/ + +METHOD: PUT + +URL Parameters|TYPE: JSON +``` +[ + { + "id":单个话术id, // Long + "value":单个话术的值, // String + }, + { + "id":单个话术id, // Long + "value":单个话术的值, // String + }, + ... +] +``` + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} +``` diff --git a/design/speechcraft.json b/design/speechcraft.json new file mode 100644 index 0000000..73d3b9b --- /dev/null +++ b/design/speechcraft.json @@ -0,0 +1,170 @@ +{ + "WHERE_I_AM":{ + "purpose":"询问现在的位置", + "exampleSentence":[ + "我在哪里", + "我们在哪里", + "现在在哪里", + "这是什么地方", + "这是哪", + "什么地方这是", + "我们在哪啊", + "我们到哪里了", + "你能告诉我,现在到了什么地方吗", + "快告诉我,这是哪里啊", + "快说说现在的位置是在哪里", + "现在在什么位置", + "现在在什么 位置呢,你能告诉我吗" + ] + }, + "PATH_AT":{ + "purpose":"怎么去一个地点(同当前的地点)", + "exampleSentence":[ + "怎么去沙滩/我要去xx", + "怎么能去到沙滩", + "如何去沙滩呢", + "如何到达沙滩啊", + "怎么能到达沙滩", + "我想去沙滩", + "快说,怎么能去沙滩", + "怎么样能去沙滩呢" + ] + }, + "PATH_ADJOINT":{ + "purpose":"怎么去一个地点(临近当前的地点)", + "exampleSentence":[ + "怎么去沙滩", + "怎么能去到沙滩", + "如何去沙滩呢", + "如何到达沙滩啊", + "怎么能到达沙滩", + "我想去沙滩", + "快说,怎么能去沙滩", + "怎么样能去沙滩呢" + ] + }, + "PATH_EXIST":{ + "purpose":"怎么去一个地点(不临近当前的地点)", + "exampleSentence":[ + "怎么去沙滩", + "怎么能去到沙滩", + "如何去沙滩呢", + "如何到达沙滩啊", + "怎么能到达沙滩", + "我想去沙滩", + "快说,怎么能去沙滩", + "怎么样能去沙滩呢" + ] + }, + "PATH_NOT_EXIST":{ + "purpose":"怎么去一个地点(不可去的地点)", + "exampleSentence":[ + "怎么去沙滩", + "怎么能去到沙滩", + "如何去沙滩呢", + "如何到达沙滩啊", + "怎么能到达沙滩", + "我想去沙滩", + "快说,怎么能去沙滩", + "怎么样能去沙滩呢" + ] + }, + "CAN_GO_SITES":{ + "purpose":"问可以去的地点(从当前位置可以去的)", + "exampleSentence":[ + "我能去哪里", + "我可以去哪里", + "能去哪里呢", + "可以去哪,你说啊", + "有哪些地方可以去", + "现在能去哪里呢", + "那现在去哪里" + ] + }, + "CAN_GO_NOWHERE":{ + "purpose":"问可以去的地点(当前地点周围是空地)", + "exampleSentence":[ + "我能去哪里", + "我可以去哪里", + "能去哪里呢", + "可以去哪,你说啊", + "有哪些地方可以去", + "现在能去哪里呢", + "那现在去哪里" + ] + }, + "SITE_NOT_ACTIVE":{ + "purpose":"说要去一个地点(当前地点任务没有完成,去另一个地点)", + "exampleSentence":[ + "我要去xx", + "我想去沙滩", + "沙滩可以去吗", + "能不能去沙滩看看", + "去沙滩吧", + "马上去沙滩" + ] + }, + "SITE_NOT_ADJOINT":{ + "purpose":"说要去一个地点(当前地点任务完成,去另一个地点)但是不能直接到达", + "exampleSentence":[ + "我要去xx", + "我想去沙滩", + "沙滩可以去吗", + "能不能去沙滩看看", + "去沙滩吧", + "马上去沙滩" + ] + }, + "AROUND_NOT_EXIST":{ + "purpose":"当周围没有任何东西的时候。", + "exampleSentence":[ + "周围有什么", + "附近有什么吗", + "附近有什么啊,快去看看", + "先看看附近有什么再说吧", + "这里有什么", + "沙滩有什么呢", + "你快看看,沙滩附近有什么吗", + "你快看看,沙滩附近有什么" + ] + }, + "AROUND_PEOPLE":{ + "purpose":"问周围的人", + "exampleSentence":[ + "周围有什么人", + "附近有什么人吗", + "我想知道,这附近都有哪些人呢", + "周围的人都有哪些呢", + "看看周围是什么人", + "找找这附近还有谁吗", + "周围的东西都有哪些呢", + "周围的物品有什么" + ] + }, + "AROUND_ITEMS":{ + "purpose":"问周围的物品", + "exampleSentence":[ + "周围有什么物品", + "附近有什么东西吗", + "我想知道,这附近都有哪些东西呢", + "看看有什么东西在附近", + "找找能用的东西吧", + "这周边有什么东西啊", + "周围的东西都有哪些呢", + "周围的物品有什么" + ] + }, + "AROUND_THINGS":{ + "purpose":"问周围的有什么", + "exampleSentence":[ + "周围有什么", + "附近有什么吗", + "附近有什么啊,快去看看", + "先看看附近有什么再说吧", + "这里有什么", + "沙滩有什么呢", + "你快看看,沙滩附近有什么吗", + "你快看看,沙滩附近有什么" + ] + }] +} diff --git a/design/status-code.md b/design/status-code.md new file mode 100644 index 0000000..5bdabaf --- /dev/null +++ b/design/status-code.md @@ -0,0 +1,72 @@ +### 状态码定义 +注释:英文名(状态码,"提示信息") +###### 成功状态码 +SUCCESS(1, "成功") + +###### 通用 +SERVER_IS_EXCEPTION(500, "服务器异常") + +###### 参数错误:10001-19999 +PARAM_IS_INVALID(10001, "参数无效") + +PARAM_IS_BLANK(10002, "参数为空") + +PARAM_TYPE_BIND_ERROR(10003, "参数类型错误") + +PARAM_NOT_COMPLETE(10004, "参数缺失") + +PARAM_IS_FAULT(10005, "字段错误") + +FILE_NOT_EXIST(10006, "文件不存在") + +FILE_NOT_IMAGE(10007, "非图片文件") + +###### 用户错误:20001-29999*/ + +USER_NOT_LOGGED_IN(20001, "用户未登录") + +USER_LOGIN_ERROR(20002, "账号不存在或密码错误") + +USER_ACCOUNT_FORBIDDEN(20003, "账号已被禁用") + +USER_NOT_EXIST(20004, "用户不存在") + +USER_HAS_EXISTED( 20005, "用户已存在") + +DATA_NOT_EXIST(20006, "数据不存在") + +USER_AUTHENTICATION_FAIL(20007, "用户认证失败!") + +###### 业务错误:30001-39999 +SPECIFIED_QUESTIONED_USER_NOT_EXIST(30001, "某业务出现问题") + + +###### 系统错误:40001-49999 +SYSTEM_INNER_ERROR(40001, "系统繁忙,请稍后重试") + + +###### 数据错误:50001-599999 +RESULE_DATA_NONE(50001, "数据未找到") + +DATA_IS_WRONG(50002, "数据有误") + +DATA_ALREADY_EXISTED(50003, "数据已存在") + + +###### 接口错误:60001-69999 +INTERFACE_INNER_INVOKE_ERROR(60001, "内部系统接口调用异常") + +INTERFACE_OUTTER_INVOKE_ERROR(60002, "外部系统接口调用异常") + +INTERFACE_FORBID_VISIT(60003, "该接口禁止访问") + +INTERFACE_ADDRESS_INVALID(60004, "接口地址无效") + +INTERFACE_REQUEST_TIMEOUT(60005, "接口请求超时") + +INTERFACE_EXCEED_LOAD(60006, "接口负载过高") +那我还是坐火车吧,帮我导去高铁站 + +###### 权限错误:70001-79999 +PERMISSION_NO_ACCESS(70001, "无访问权限") +1f5962a70ae64a06a02196b4f64df068 diff --git a/design/struct.json b/design/struct.json new file mode 100644 index 0000000..b58497c --- /dev/null +++ b/design/struct.json @@ -0,0 +1,29 @@ +{ + "type": "game_bot_init", + "userName": "jinfengli", + "nickName": "李进峰", + "botName_yhm": "音乐", + "botName": "", + "cdt_name_ls": [], + "cate": ["游戏"], + "catName": "游戏", + "intro": "音乐", + "botId": "undefined" +} + + +{ + "code": 1, + "msg": "成功", + "data": { + "type": "game_bot_init", + "userName": "jinfengli", + "nickName": "李进峰", + "botName_yhm": "放羊的小子1", + "botName": "", + "cdt_name_ls": [], + "cate": ["游戏"], + "catName ":"游戏 ", + "intro ":"今天去放羊, 我的故事结束了 ", + "botId ":"undefined" + }} diff --git a/design/struct.sql b/design/struct.sql new file mode 100644 index 0000000..58372f4 --- /dev/null +++ b/design/struct.sql @@ -0,0 +1,9 @@ +ALTER TABLE `game_editor_db1`.`game_project_tb` +CHANGE COLUMN `nickname` `user_nickname` VARCHAR(45) NULL DEFAULT NULL AFTER `username`; +ALTER TABLE `game_editor_db1`.`game_project_tb` +CHANGE COLUMN `generate_status` `generate_status` VARCHAR(45) NULL DEFAULT NULL , +ADD COLUMN `nickname` VARCHAR(45) NULL AFTER `name`, +ADD COLUMN `game_project_tbcol` VARCHAR(45) NULL AFTER `gmt_modified`; + +ALTER TABLE `game_editor_db1`.`game_project_tb` +CHANGE COLUMN `generate_status` `generate_status` TINYINT NULL DEFAULT NULL ; diff --git a/design/sync_condition.md b/design/sync_condition.md new file mode 100644 index 0000000..7e4b42a --- /dev/null +++ b/design/sync_condition.md @@ -0,0 +1,93 @@ +BASE_URL: http://didi-gz4.jiaoyou365.com + +###### 获取服务器列表 +URL: BASE_URL:18083/api/servers + +METHOD: GET + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +| Authorization | token | 用户token | + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [ + { + "id": 1, + "name": "gz3" + } + ] +} +``` +###### 同步语义关系 +URL: BASE_URL:18083/api/sync/conditions + +METHOD: POST + +RequestBody: +``` +{ + "note":"test", // 注释 + "serverId":1 // 服务器ID +} +``` +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +| Content-Type | application/json;charset=UTF-8 | | +| Authorization | token | 用户token | + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": null +} +``` + +###### 获取语义关系部署记录 +URL: BASE_URL:18083/api/sync/conditions/record?page=0&pageSize=20 + +METHOD: GET + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +| Authorization | token | 用户token | + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": { + "historys": [ + { + "serverName": "gz3", + "updateSemanticRelationNames": [ + "回答什么是什么之主宾" + ], + "note": "jinfengli测试", + "status": "完成", + "gmtCreate": 1585119280000 + }, + { + "serverName": "gz3", + "updateSemanticRelationNames": [], + "note": "jinfengli测试", + "status": "远程服务器异常,该服务器已经被设置为禁止更新服务!", + "gmtCreate": 1585116480000 + } + ], + "count": 2 + } +} +``` diff --git a/design/sync_phrase.md b/design/sync_phrase.md new file mode 100644 index 0000000..dc4f7f4 --- /dev/null +++ b/design/sync_phrase.md @@ -0,0 +1,95 @@ +BASE_URL: http://didi-gz4.jiaoyou365.com + +###### 获取服务器列表 +URL: BASE_URL:18083/api/servers + +METHOD: GET + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +| Authorization | token | 用户token | + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [ + { + "id": 1, + "name": "gz3" + } + ] +} +``` +###### 同步词组 +URL: BASE_URL:18083/api/sync/phrases + +METHOD: POST + +RequestBody: +``` +{ + "note":"test", // 注释 + "serverId":1 // 服务器ID +} +``` +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +| Content-Type | application/json;charset=UTF-8 | | +| Authorization | token | 用户token | + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": null +} +``` + +###### 获取词组部署记录 +URL: BASE_URL:18083/api/sync/phrases/record?page=0&pageSize=20 + +METHOD: GET + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +| Authorization | token | 用户token | + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": { + "historys": [ + { + "serverName": "didi-gz4", + "updatePhraseNames": [ + "名词词组", + "水果大全", + "时间段o词组" + ], + "note": "词组测试", + "status": "完成", + "gmtCreate": 1585551041000 + }, + { + "serverName": "didi-gz4", + "updatePhraseNames": [], + "note": "词组测试", + "status": "完成,没有需要更新词组!", + "gmtCreate": 1585549625000 + } + ], + "count": 2 + } +} +``` diff --git a/design/system_qa.md b/design/system_qa.md new file mode 100644 index 0000000..68960fc --- /dev/null +++ b/design/system_qa.md @@ -0,0 +1,204 @@ +BaseUrl: http://hw-gz25.heyqiwu.cn +测试用例:刘希bot 星球大战 + +##### 获取所有系统问答 + +URL: BaseUrl:19082/system/qa/all?projectId={项目ID} + +Method: GET + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | +| Authorization | token | +| groupId | 组ID | +| mul | true | +| projectId | 项目ID | + +ResponseBody: +``` +SUCCESS: +{ + "code": 1, + "msg": "成功", + "data": [ + { + "id": 1, + "intentName": "人物简介", + "enable": true, + "systemQaTmpls": [ + { + "id": 1, + "question": "你是谁", + "answer": "我是[人名]" + }, + { + "id": 2, + "question": "我是谁", + "answer": "你是[人名]" + } + ] + }, + { + "id": 2, + "intentName": "人物在哪里", + "enable": true, + "systemQaTmpls": [ + { + "id": 3, + "question": "我在哪里", + "answer": "你在[地名]" + }, + { + "id": 4, + "question": "小白在哪里", + "answer": "[人名]在[地名]" + } + ] + } + ] +} + +``` +##### 系统问答全部更新为不可用 +URL: baseUrl:19082/system/qa/all/disable?projectId={项目ID} + +Method: PUT + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | +| Authorization | token | +| groupId | 组ID | +| mul | true | +| projectId | 项目ID | + +ResponseBody: +``` +SUCCESS: +{ + "code": 1, + "msg": "成功", + "data": null +} +``` + +##### 系统问答全部更新可用状态 +URL: baseUrl:19082/system/qa/all/enable?projectId={项目ID} + +Method: PUT + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | +| Authorization | token | +| groupId | 组ID | +| mul | true | +| projectId | 项目ID | + +ResponseBody: +``` +SUCCESS: +{ + "code": 1, + "msg": "成功", + "data": null +} +``` + +##### 单个系统问答更新为不可用状态 +URL: baseUrl:19082/system/qa/{意图ID}/disable?projectId={项目ID} + +Method: PUT + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | +| Authorization | token | +| groupId | 组ID | +| mul | true | +| projectId | 项目ID | + +ResponseBody: +``` +SUCCESS: +{ + "code": 1, + "msg": "成功", + "data": null +} + +``` + +##### 单个系统问答更新为可用状态 +URL: baseUrl:19082/system/qa/{意图ID}/enable?projectId={项目ID} + +Method: PUT + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | +| Authorization | token | +| groupId | 组ID | +| mul | true | +| projectId | 项目ID | + +ResponseBody: +``` +SUCCESS: +{ + "code": 1, + "msg": "成功", + "data": null +} +``` + +##### 更新系统问答模板回答 +URL: baseUrl:19082/system/qa/tmpl + +Method: PUT + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | +| Authorization | token | +| groupId | 组ID | +| mul | true | +| projectId | 项目ID | + +RequestBody: +``` +{ + "id":4, + "answer":"测试[人名]在[地点名]", + "projectId":2055 +} +``` + +ResponseBody: +``` +SUCCESS: +{ + "code": 1, + "msg": "成功", + "data": null +} +FAILTRUE: +{ + "code": 10005, + "msg": "字段错误", + "data": null +} +``` \ No newline at end of file diff --git a/design/tables.sql b/design/tables.sql new file mode 100644 index 0000000..789369e --- /dev/null +++ b/design/tables.sql @@ -0,0 +1,29 @@ +CREATE TABLE `system_qa_intent_tb` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `intent_id` varchar(128) COLLATE utf8_bin NOT NULL , + `intent_name` varchar(128) COLLATE utf8_bin NOT NULL , + `enable` tinyint(4) NOT NULL DEFAULT '1', + `project_id` int(11) NOT NULL, + `owner_id` int(11) NOT NULL, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime DEFAULT NULL, + UNIQUE KEY `uniqueId`(`intent_id`, `project_id`), + INDEX `projectId`(`project_id`), + INDEX `projectIdAndOwnerId`(`project_id`, `owner_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `system_qa_tmpl_tb` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `tmpl_id` varchar(128) COLLATE utf8_bin NOT NULL , + `question` varchar(256) COLLATE utf8_bin NOT NULL , + `answer` varchar(256) COLLATE utf8_bin NOT NULL , + `system_qa_intent_id` int(11) NOT NULL, + `project_id` int(11) NOT NULL, + `owner_id` int(11) NOT NULL, + `gmt_create` datetime NOT NULL, + `gmt_modified` datetime DEFAULT NULL, + UNIQUE KEY `uniqueId`(`tmpl_id`, `system_qa_intent_id`), + INDEX `systemQaIntentId`(`system_qa_intent_id`), + INDEX `projectIdAndOwnerId`(`project_id`, `owner_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +ALTER TABLE `global_attr_tb` ADD `extra` VARCHAR(2048) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT '{}' COMMENT '变量额外的配置' AFTER `in_post_url`; diff --git a/design/threeTripleData.xls b/design/threeTripleData.xls new file mode 100644 index 0000000..7632ace Binary files /dev/null and b/design/threeTripleData.xls differ diff --git a/design/tokenize.md b/design/tokenize.md new file mode 100644 index 0000000..0dd68bb --- /dev/null +++ b/design/tokenize.md @@ -0,0 +1,81 @@ +BASE_URL: http://didi-gz5.jiaoyou365.com + +###### 句子分词 +URL: BASE_URL:19082/sentence/tokenize?sentence=张三喜欢打篮球 + +METHOD: GET + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +| Authorization | token | 用户token | + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [ + { + "word": "张三", + "pos": "固有名词", + "location": 1 + }, + { + "word": "喜欢打", + "pos": "动词", + "location": 2 + }, + { + "word": "篮球", + "pos": "常用名词", + "location": 3 + } + ] +} + +``` + +###### 保存分词 +URL: BASE_URL:19082/sentence/tokenize/save + +METHOD: POST + +Parameter | Type | Description +| :----------- | :------: | ------------: | +| Authorization | token | 用户token | + +RequestBody: +``` +{ + "sentence":"张三喜欢打篮球", + "projectId":1702, + "tokenizeWords":[ + { + "word": "张三", + "pos": "固有名词", + "location": 1 + }, + { + "word": "喜欢", + "pos": "动词", + "location": 2 + }, + { + "word": "打篮球", + "pos": "名词", + "location": 3 + } + ] +} +``` + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": null +} +``` diff --git a/design/word-property.md b/design/word-property.md new file mode 100644 index 0000000..be5bcec --- /dev/null +++ b/design/word-property.md @@ -0,0 +1,62 @@ +###### 更新词性 +URL: /keyword/property/ + +METHOD: PUT + +URL Parameters|TYPE: JSON +``` +[ + { + "id":1, + "keyword":"test", + "wordProperty":"动词", + "projectId":50 + }, + { // 没有id的 + "keyword":"all", + "wordProperty":"动词", + "projectId":50 + } +] +``` +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{"code":1,"msg":"成功","data":null} +``` +###### 获取关键词属性 +URL: /keyword/property/{projectId}/ + +METHOD: GET + +URL Parameters|TYPE: JSON + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +content-type | application/json;charset=utf-8 + +ResponseBody: +``` +{ + "code": 1, + "msg": "成功", + "data": [{ + "id": 1, + "keyword": "test", + "wordProperty": "动词", + "projectId": 50 + }, { + "id": 3, + "keyword": "all", + "wordProperty": "动词", + "projectId": 50 + }] +} +``` diff --git a/design/work-api.md b/design/work-api.md new file mode 100644 index 0000000..d2817b9 --- /dev/null +++ b/design/work-api.md @@ -0,0 +1,108 @@ +### 工程 +###### 创建游戏 +URL: /work + +METHOD: POST + +URL Parameters:TYPE: JSON + +Parameter | Type | Description +| :----------- | :------: | ------------: | +``` +{ + "name":"最后一次测试", + "intro":"今天去放羊,我的故事结束了", + "username":"jinfengli", + "nickname":"李进峰", + "BannerImgUrl":"/upload/img/other/2019/03/06135304602.png", + "preface":"这是个很好玩的游戏!" //作者说的话 + "labels":[{ + "name":"1" + }, { + name:"2" + }] +} +``` + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +Content-Type | application/json;charset=UTF-8 +Authorization | Basic ZXlKbGVIQWlPakUxTlRJd05qTTJNakVzSW1Gc1p5STZJa2hUTWpVMklpd2lhV0YwSWpveE5UVXlNREV6TWpJeGZRLmV5SnBaQ0k2TmpKOS5Sa0U2MFpzbnpwallBTXRwMS1na3l3ZkhkUmNsWmVxdUJlRm44TXB0ZjR3OnMwMHBlcnMzY3JldA== + +ResponseBody: +``` +{ + "code":1, + "msg":"成功", + "data":{ + "id": 407 + } +} +``` + +###### 改变游戏信息 +URL: /work/{botAccount} + +METHOD: PUT + +URL Parameters:TYPE: JSON + +Parameter | Type | Description +| :----------- | :------: | ------------: | +``` +{ + "name":"最后一次测试2", + "intro":"今天去放羊,我的故事结束了", + "username":"jinfengli", + "nickname":"李进", + "bannerImgUrl":"/upload/img/other/2019/03/06135304602.png", + "preface":"这是个很好玩的游戏!", + "labels":[{ + "id":1 + "name":"1" + }, { + name:"2" + }] +} +``` + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +Content-Type | application/json;charset=UTF-8 +Authorization | Basic ZXlKbGVIQWlPakUxTlRJd05qTTJNakVzSW1Gc1p5STZJa2hUTWpVMklpd2lhV0YwSWpveE5UVXlNREV6TWpJeGZRLmV5SnBaQ0k2TmpKOS5Sa0U2MFpzbnpwallBTXRwMS1na3l3ZkhkUmNsWmVxdUJlRm44TXB0ZjR3OnMwMHBlcnMzY3JldA== + +ResponseBody: +``` +{ + "code":1, + "msg":"成功", + "data":null +} +``` + +###### 删除游戏 +URL: /work/{botAccount} + +METHOD: DELETE + +URL Parameters:(NULL) + +Headers: + +Parameter | Type | Description +| :----------- | :------: | ------------: | +Content-Type | application/json;charset=UTF-8 +Authorization | Basic ZXlKbGVIQWlPakUxTlRJd05qTTJNakVzSW1Gc1p5STZJa2hUTWpVMklpd2lhV0YwSWpveE5UVXlNREV6TWpJeGZRLmV5SnBaQ0k2TmpKOS5Sa0U2MFpzbnpwallBTXRwMS1na3l3ZkhkUmNsWmVxdUJlRm44TXB0ZjR3OnMwMHBlcnMzY3JldA== + +ResponseBody: +``` +{ + "code":1, + "msg":"成功", + "data":null +} +``` diff --git a/design/xiaowei_backend_api.md b/design/xiaowei_backend_api.md new file mode 100644 index 0000000..4229f27 --- /dev/null +++ b/design/xiaowei_backend_api.md @@ -0,0 +1,226 @@ +##### 收藏作品 + +URL: /api/favorite?module=works + +METHOD: POST + +URL Parameters + +| Parameter | Type | Description | SendWay| +| :----------- | :------: | ------------: | :------------- | +| aipioneerUsername | String | 作品ID | RequestsParam | + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/x-www-form-urlencoded;charset=utf-8 | +| Authorization | Bearer YOUR_ACCESS_TOKEN | + +responseBody: +``` +SUCCESS: +{ + "code":1, + "msg":成功, + "data":null +} +FAILTURE: +{ + "code":20002, + "msg":用户认证失败!, + "data":null +} +``` + +##### 取消作品收藏 + +URL: /api/favorite?module=works + +METHOD: DELETE + +URL Parameters + +| Parameter | Type | Description | SendWay| +| :----------- | :------: | ------------: | :------------- | +| aipioneerUsername | String | 作品ID | RequestsParam | + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/x-www-form-urlencoded;charset=utf-8 | +| Authorization | Bearer YOUR_ACCESS_TOKEN | + +responseBody: +``` +SUCCESS: +{ + "code":1, + "msg":成功, + "data":null +} +FAILTURE: +{ + "code":20002, + "msg":用户认证失败!, + "data":null +} +``` + +##### 收藏作品列表 + +URL: /api/favorite?module=works + +METHOD: GET + +URL Parameters + +| Parameter | Type | Description | SendWay| +| :----------- | :------: | ------------: | :------------- | + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/x-www-form-urlencoded;charset=utf-8 | +| Authorization | Bearer YOUR_ACCESS_TOKEN | + +responseBody: +``` +SUCCESS: +{ + "code":1, + "msg":成功, + "data":[ + { + worksName: ,// 作品名称 + authorName:, + aipioneerUsername: , // 作品用户名 + } + ] +} +FAILTURE: +{ + "code":20002, + "msg":用户认证失败!, + "data":null +} +``` + +##### 获取作品角色信息并更新最近一次用户玩的作品信息 + +URL: /api/npc/voiceClass + +METHOD: GET + +URL Parameters + +| Parameter | Type | Description | SendWay| +| :----------- | :------: | ------------: | :------------- | +| aipioneerUsername | String | 作品ID | RequestsParam | + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/x-www-form-urlencoded;charset=utf-8 | +| Authorization | Bearer YOUR_ACCESS_TOKEN | + +responseBody: +``` +SUCCESS: +{ + "code":1, + "msg":成功!, + "data":{ + npcName:voiceClass + } +} +FAILTURE: +{ + "code":50001, + "msg":作品不存在!, + "data":null +} +``` + +##### 获得用户最后一次玩的作品 + +URL: /api/user/current_play_works + +METHOD: GET + +URL Parameters + +| Parameter | Type | Description | SendWay| +| :----------- | :------: | ------------: | :------------- | + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/x-www-form-urlencoded;charset=utf-8 | +| Authorization | Bearer YOUR_ACCESS_TOKEN | + +responseBody: +``` +{ + "code":1, + "msg":成功!, + "data":{ + aipioneerUsername:"", // 最近一次用户玩的作品 + worksName:"" // 最近一次玩的作品名称 + } +} +FAILTURE: +{ + "code":20002, + "msg":用户认证失败!, + "data":null +} +{ + "code":50001, + "msg":您当前没有玩过任何作品!, + "data":null +} +{ + "code":50001, + "msg":当前作品不存在!, + "data":null +} +``` + +##### 获取音频 (app) + +URL: http://qcloud-sh1.chewrobot.com:9663/api/tts + +METHOD: POST + +URL Parameters + +| Parameter | Type | Description | SendWay | +| :----------- | :------: | :------------ | :-----------| +| person | Number | 声音的类别 | JSON| +| tone | Number | 声音的语气 | JSON| +| text | String | 播放语音的文本内容 | JSON| +| _type | String | 返回数据类型(可选参数)| JSON | + +Headers: + +| key | value | +| :----------- | :------------: | +| Content-Type | application/json;charset=utf-8 | + +responseBody: +``` +如果_type 参数不添加,直接返回音频文件 + 直接返回音频的二进制数据 + 数据格式为: mp3 + +如果 "_type":"json" +{ + "audio": "http://qcloud-sh1.chewrobot.com:9663/api/v1/tts/get_audio?dirs=[1,0]&filename=xxx.mp3", // 音频的url + "status": true // 是否调用成功 +} +``` diff --git "a/design/\346\226\260\345\271\263\345\217\260\346\226\260\345\273\272bot.md" "b/design/\346\226\260\345\271\263\345\217\260\346\226\260\345\273\272bot.md" new file mode 100644 index 0000000..6e37551 --- /dev/null +++ "b/design/\346\226\260\345\271\263\345\217\260\346\226\260\345\273\272bot.md" @@ -0,0 +1,77 @@ +#### 新平台机器人新建接口 + +接口名: http://aliyun-hz1.chewrobot.com:1111/conditionProcess + +METHOD: POST + +Headers: + +| key | value| +| :----------- | :------------ | +| Content-Type | application/json;charset=utf-8| +| Authorization | Bearer YOUR_ACCESS_TOKEN| + + +URL Parameters: + +|参数名 | 数据类型 | 描述| SendWay | +| :----------- | :------: | :------------ | :------- | +| type | string | 默认为"bot_init" | JSON | +| userName | string | 用户名 | JSON | +| botName_yhm | string | bot的名字 | JSON | +| catName | string | bot类别名 | JSON | +| botId | string | 默认为"undefined" | JSON | + + +responseBody: +``` +{ + "status": 状态码, 成功时为1, 失败为0 + "parameters": 如果状态为0,paramters为失败原因 + +} + +{ + "type": "game_bot_init", + "userName": "jinfengli", + "nickName": "李进峰", + "botName_yhm": "疾风作品", + "botName": "", + "cdt_name_ls": [], + "cate": ["游戏"], + "catName": "游戏", + "intro": "疾风作品", + "botId": "undefined" +} + +private Long id; + private String name; + private String intro; + private Long botId; + private String botAccount; + private Long userId; + private String username; + private String nickname; + private Integer generateStatus; + private Integer applyStatus; + private String applySuggestion; + private Long watch; + private String BannerImgUrl; + private String preface; + +{ + "actions":[], + "botname":"疾风", + "catName":"游戏", + "cdt_name_ls":[], + "id":3627 +} + + +{ + "actions":[], + "botname":"放羊的小子", + "catName":"游戏", + "cdt_name_ls":[], + "id":3313 +}