-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add BackEnd and StoryLine docs #1338
Conversation
This PR has been deployed to the preview environment. You can explore it using the preview URL. Warning Please note that deployments in the preview environment are temporary and will be automatically cleaned up after a certain period. Make sure to explore it before it is removed. For any questions, contact the Go+ Builder team. |
import { useRouter } from 'vue-router'; | ||
import { LocaleMessage } from './index'; | ||
|
||
interface StoryLine { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里为啥又出现一遍这个类型
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对啊,去修改 base.ts,不然某个类型很多地方用到,难道在每个地方都再粘贴一份吗..那样这个 base 还有啥意义
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
明白
|
||
```typescript | ||
// Delete `/storyline/{id}` | ||
declare function updateStoryLine(id: string): Promise<void> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updateStoryLine
?
我们之前提到过,对这个模块的使用方来说,这个导出的函数才是有意义的,反而是 Delete /storyline/{id}
是没什么意义的
当然严格来说,你的模块这个时候其实不应该叫 backend 了,它更接近前端代码中的一个 guide-apis(apis/guide.ts
)模块,只是顺便注释 Delete /storyline/{id}
这样的内容来说明一下这个模块所对应的 HTTP 接口的规格
type CreateStoryLineInput = Omit<StoryLine, 'id'> | ||
|
||
// POST `/storyline` | ||
declare function createStoryLine(input: CreateStoryLineInput): Promise<void> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
创建成功的话应该返回点东西?
storyLineName: string, | ||
} | ||
|
||
// Get `/storyline/{owner}/{name}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你这哪儿来的 owner、name 啊,project like 那里有 owner name 是因为 owner + name 共同构成了 project 的唯一标识,你这里 storyLine ID 已经是唯一标识了
- 用于获取故事线信息 | ||
|
||
```typescript | ||
type GetUserStoryLineRelationshipInput = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
获取故事线信息的接口,为什么输入是 GetUserStoryLineRelationshipInput?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的老师 我理解错了 后面都不应该有userName
|
||
```typescript | ||
type GetUserStoryLineRelationshipInput = { | ||
userName: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里为啥会有 userName
?
|
||
```typescript | ||
type CheckSnapshotInput = { | ||
userSnapshot: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1329 (comment) 这里提到的问题应该还没有确认好?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
此外,可能需要再引入所有api reference的信息作为额外信息?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你说的我觉得大体上没问题;那样的话需要对应调整下这里的接口,比如
-
snapshot 的概念就改为 code 就好
-
另外增加参数用于传递“背景信息”
只是这里我会建议接口上不用具体到它是步骤的说明信息还是项目的介绍,还是 api reference,这个留给接口的调用方去决定,而这里接口上可以定义为类似
context: string // 上下文(背景)信息,如当前项目、任务、步骤等
这样的东西;因为“通过各种信息组合出提供给 LLM 的文本”的逻辑大概率细节较多且易变,挪到接口的调用方那边去做的话这个接口会更简单、稳定一点
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
明白
```typescript | ||
type Props = { | ||
storyLineId: string, | ||
userName: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里 props 上不应该有 userName?
[Git-flow] Hi @Nan1179, There are some suggestions for your information: Rebase suggestions
Which seems insignificant, recommend to use For other If you have any questions about this comment, feel free to raise an issue here: |
No description provided.