文档注释

This commit is contained in:
2024-07-31 15:57:09 +08:00
parent 6bc7acba47
commit 6bc176375a
2 changed files with 12 additions and 4 deletions

View File

@@ -233,6 +233,10 @@ go build bin/main.go
# 上传到服务器
scp ./main root@47.103.40.152:~/main
# 图像转向量(为了更快速度它应当运行在GPU服务器上)
python3 api/resnet.py
```

View File

@@ -29,7 +29,8 @@ func NewSchema(config Config) (graphql.Schema, error) {
// 文章的可选字段
article := graphql.NewObject(graphql.ObjectConfig{
Name: "Article",
Name: "Article",
Description: "文章信息",
Fields: graphql.Fields{
"id": &graphql.Field{Type: graphql.Int},
"title": &graphql.Field{Type: graphql.String},
@@ -41,7 +42,8 @@ func NewSchema(config Config) (graphql.Schema, error) {
// 用户的可选字段
user := graphql.NewObject(graphql.ObjectConfig{
Name: "User",
Name: "User",
Description: "用户信息",
Fields: graphql.Fields{
"id": &graphql.Field{Type: graphql.Int},
"user_name": &graphql.Field{Type: graphql.String},
@@ -55,7 +57,8 @@ func NewSchema(config Config) (graphql.Schema, error) {
// 图像中的文字提取
text := graphql.NewObject(graphql.ObjectConfig{
Name: "Text",
Name: "Text",
Description: "图像中的文字提取",
Fields: graphql.Fields{
"text": &graphql.Field{Type: graphql.String},
"confidence": &graphql.Field{Type: graphql.Float},
@@ -67,7 +70,8 @@ func NewSchema(config Config) (graphql.Schema, error) {
// 图像的可选字段
image := graphql.NewObject(graphql.ObjectConfig{
Name: "Image",
Name: "Image",
Description: "图像信息",
Fields: graphql.Fields{
"id": &graphql.Field{Type: graphql.Int},
"width": &graphql.Field{Type: graphql.Int},