# 自动生成参数导入导出 **测试环境URL**: tx-gz18.heyqiwu.cn **生产环境URL**: juben.jiaoyou365.com ## 1. 导出作品的AIGC参数 **METHOD**: GET **path**: /api/juben/aigc/exportParam **RequestHeaders:** | key | description | | ------------- | ----------------- | | Authorization | \*\*鉴权Token\*\* | **RequestParam:** | 参数名 | 类型 | 示例值 | 是否必填 | 参数描述 | | ------ | ------- | ------ | -------- | ------------ | | id | Integer | 2701 | 是 | 作品的项目id | #### 请求示例 ```json curl --location --request GET 'https://juben.jiaoyou365.com/api/juben/aigc/exportParam?id=2701' \ --header 'Authorization: ***' ``` **ResponseBody.data:** ##### 成功: | 参数名 | 类型 | 示例值 | 参数描述 | | -------- | ------ | ------------------------------------------------------------ | ----------------------- | | filePath | String | http://tx-gz18.heyqiwu.cn/downloads/第3个作品-aigc--1012--2023-11-10--09-57-30.txt | 导出的txt文件的下载地址 | #### 响应示例 ```json { "code": 1, "msg": "成功", "data": { "filePath": "http://tx-gz18.heyqiwu.cn/downloads/第3个作品-aigc--1012--2023-11-10--09-57-30.txt" } } ``` ## 2. 导入作品的AIGC参数 **METHOD**: POST **path**: /api/juben/aigc/importParam **RequestHeaders:** | key | description | | ------------- | ----------------- | | Authorization | \*\*鉴权Token\*\* | **RequestParam:** | 参数名 | 类型 | 示例值 | 是否必填 | 参数描述 | | ------ | ------- | ------ | -------- | ---------------------- | | id | Integer | 2701 | 是 | 要导入到的作品的项目id | **RequestFormData:** | 参数名 | 类型 | 示例值 | 是否必填 | 参数描述 | | ------ | -------- | ---------------- | -------- | ---------------------------- | | file | FormData | \*\*文件内容\*\* | 是 | 待上传文件对应的FormData对象 | #### 请求示例 ```json curl --location --request POST 'https://juben.jiaoyou365.com/api/juben/aigc/importParam?id=2701' \ --header 'Authorization: ***' ``` #### 响应示例 **成功:** ```json { "code": 1, "msg": "成功", "data": null } ``` ## **导出的参数文件格式 - JSON** 每个项目导出为一个文件,包含setting对象(故事背景)、themes列表(故事中的所有主题)、scenarios列表(故事中的所有大纲); setting对象包含属性setting(故事背景内容)、player(故事的玩家角色名); themes列表的每个元素包含id(主题原来的内部id)、theme(主题内容)、entryPlotNumber(主题的入口剧情点在本故事中的剧情点编号(如有)); scenarios列表的每个元素包含id(与themes列表中的id关联)、plotNumber(大纲所对应的剧情点在本故事中的剧情点编号)、scenario(大纲内容)、roleList(该大纲中出现的角色列表)。 每个在scenarios列表中出现的themeId都必须能在themes列表中出现的id中找到。 themes列表、scenarios列表以及setting对象中的两个参数均可空,但列表和对象本身必须显式写出 ```json { "setting":{ "setting":"一个养女儿的游戏", "player":"玩家" }, "themes":[ { "id":340, "theme":"一个主题", }, { "id":341, "theme":"另一个主题" }, { "id":342, "theme":"主题", "entryPlotNumber":"1-1" } ], "scenarios":[ { "themeId":340, "plotNumber":"1-1-1", "scenario":"大纲1-1", "roleList":"妻子|女儿" }, { "themeId":341, "plotNumber":"1-1-2", "scenario":"大纲1-2", "roleList":"女儿|妻子" }, { "themeId":342, "plotNumber":"1-1", "scenario":"大纲1", "roleList":"妻子" }, { "themeId":342, "plotNumber":"1-2", "scenario":"大纲2", "roleList":"女儿" } ] } ```