Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions backend/api/node/v1/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,23 @@ type GetNodeDetailReq struct {
}

type NodeDetailResp struct {
ID string `json:"id"`
KbID string `json:"kb_id"`
Type domain.NodeType `json:"type"`
Status domain.NodeStatus `json:"status"`
Name string `json:"name"`
Content string `json:"content"`
Meta domain.NodeMeta `json:"meta"`
ParentID string `json:"parent_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Permissions domain.NodePermissions `json:"permissions"`
ID string `json:"id"`
KbID string `json:"kb_id"`
Type domain.NodeType `json:"type"`
Status domain.NodeStatus `json:"status"`
Name string `json:"name"`
Content string `json:"content"`
Meta domain.NodeMeta `json:"meta"`
ParentID string `json:"parent_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Permissions domain.NodePermissions `json:"permissions"`
CreatorId string `json:"creator_id"`
EditorId string `json:"editor_id"`
PublisherId string `json:"publisher_id" gorm:"-"`
CreatorAccount string `json:"creator_account"`
EditorAccount string `json:"editor_account"`
PublisherAccount string `json:"publisher_account" gorm:"-"`
}

type NodePermissionReq struct {
Expand Down
27 changes: 27 additions & 0 deletions backend/api/share/v1/node.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package v1

import (
"time"

"github.com/chaitin/panda-wiki/domain"
)

type ShareNodeDetailResp struct {
ID string `json:"id"`
KbID string `json:"kb_id"`
Type domain.NodeType `json:"type"`
Status domain.NodeStatus `json:"status"`
Name string `json:"name"`
Content string `json:"content"`
Meta domain.NodeMeta `json:"meta"`
ParentID string `json:"parent_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Permissions domain.NodePermissions `json:"permissions"`
CreatorId string `json:"creator_id"`
EditorId string `json:"editor_id"`
PublisherId string `json:"publisher_id"`
CreatorAccount string `json:"creator_account"`
EditorAccount string `json:"editor_account"`
PublisherAccount string `json:"publisher_account"`
}
2 changes: 1 addition & 1 deletion backend/cmd/api/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion backend/cmd/consumer/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions backend/cmd/migrate/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

100 changes: 99 additions & 1 deletion backend/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3616,7 +3616,19 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/domain.Response"
"allOf": [
{
"$ref": "#/definitions/domain.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/v1.ShareNodeDetailResp"
}
}
}
]
}
}
}
Expand Down Expand Up @@ -7444,6 +7456,18 @@ const docTemplate = `{
"is_open": {
"type": "boolean"
},
"recommend_node_ids": {
"type": "array",
"items": {
"type": "string"
}
},
"recommend_questions": {
"type": "array",
"items": {
"type": "string"
}
},
"theme_mode": {
"type": "string"
}
Expand Down Expand Up @@ -8123,6 +8147,18 @@ const docTemplate = `{
"created_at": {
"type": "string"
},
"creator_account": {
"type": "string"
},
"creator_id": {
"type": "string"
},
"editor_account": {
"type": "string"
},
"editor_id": {
"type": "string"
},
"id": {
"type": "string"
},
Expand All @@ -8141,6 +8177,12 @@ const docTemplate = `{
"permissions": {
"$ref": "#/definitions/domain.NodePermissions"
},
"publisher_account": {
"type": "string"
},
"publisher_id": {
"type": "string"
},
"status": {
"$ref": "#/definitions/domain.NodeStatus"
},
Expand Down Expand Up @@ -8245,6 +8287,62 @@ const docTemplate = `{
}
}
},
"v1.ShareNodeDetailResp": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"created_at": {
"type": "string"
},
"creator_account": {
"type": "string"
},
"creator_id": {
"type": "string"
},
"editor_account": {
"type": "string"
},
"editor_id": {
"type": "string"
},
"id": {
"type": "string"
},
"kb_id": {
"type": "string"
},
"meta": {
"$ref": "#/definitions/domain.NodeMeta"
},
"name": {
"type": "string"
},
"parent_id": {
"type": "string"
},
"permissions": {
"$ref": "#/definitions/domain.NodePermissions"
},
"publisher_account": {
"type": "string"
},
"publisher_id": {
"type": "string"
},
"status": {
"$ref": "#/definitions/domain.NodeStatus"
},
"type": {
"$ref": "#/definitions/domain.NodeType"
},
"updated_at": {
"type": "string"
}
}
},
"v1.StatCountResp": {
"type": "object",
"properties": {
Expand Down
100 changes: 99 additions & 1 deletion backend/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -3609,7 +3609,19 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/domain.Response"
"allOf": [
{
"$ref": "#/definitions/domain.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/v1.ShareNodeDetailResp"
}
}
}
]
}
}
}
Expand Down Expand Up @@ -7437,6 +7449,18 @@
"is_open": {
"type": "boolean"
},
"recommend_node_ids": {
"type": "array",
"items": {
"type": "string"
}
},
"recommend_questions": {
"type": "array",
"items": {
"type": "string"
}
},
"theme_mode": {
"type": "string"
}
Expand Down Expand Up @@ -8116,6 +8140,18 @@
"created_at": {
"type": "string"
},
"creator_account": {
"type": "string"
},
"creator_id": {
"type": "string"
},
"editor_account": {
"type": "string"
},
"editor_id": {
"type": "string"
},
"id": {
"type": "string"
},
Expand All @@ -8134,6 +8170,12 @@
"permissions": {
"$ref": "#/definitions/domain.NodePermissions"
},
"publisher_account": {
"type": "string"
},
"publisher_id": {
"type": "string"
},
"status": {
"$ref": "#/definitions/domain.NodeStatus"
},
Expand Down Expand Up @@ -8238,6 +8280,62 @@
}
}
},
"v1.ShareNodeDetailResp": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"created_at": {
"type": "string"
},
"creator_account": {
"type": "string"
},
"creator_id": {
"type": "string"
},
"editor_account": {
"type": "string"
},
"editor_id": {
"type": "string"
},
"id": {
"type": "string"
},
"kb_id": {
"type": "string"
},
"meta": {
"$ref": "#/definitions/domain.NodeMeta"
},
"name": {
"type": "string"
},
"parent_id": {
"type": "string"
},
"permissions": {
"$ref": "#/definitions/domain.NodePermissions"
},
"publisher_account": {
"type": "string"
},
"publisher_id": {
"type": "string"
},
"status": {
"$ref": "#/definitions/domain.NodeStatus"
},
"type": {
"$ref": "#/definitions/domain.NodeType"
},
"updated_at": {
"type": "string"
}
}
},
"v1.StatCountResp": {
"type": "object",
"properties": {
Expand Down
Loading