Skip to content

Commit 0624cfc

Browse files
committed
feat: node release user info
1 parent 29ccdad commit 0624cfc

File tree

20 files changed

+400
-46
lines changed

20 files changed

+400
-46
lines changed

backend/api/node/v1/node.go

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,23 @@ type GetNodeDetailReq struct {
1313
}
1414

1515
type NodeDetailResp struct {
16-
ID string `json:"id"`
17-
KbID string `json:"kb_id"`
18-
Type domain.NodeType `json:"type"`
19-
Status domain.NodeStatus `json:"status"`
20-
Name string `json:"name"`
21-
Content string `json:"content"`
22-
Meta domain.NodeMeta `json:"meta"`
23-
ParentID string `json:"parent_id"`
24-
CreatedAt time.Time `json:"created_at"`
25-
UpdatedAt time.Time `json:"updated_at"`
26-
Permissions domain.NodePermissions `json:"permissions"`
16+
ID string `json:"id"`
17+
KbID string `json:"kb_id"`
18+
Type domain.NodeType `json:"type"`
19+
Status domain.NodeStatus `json:"status"`
20+
Name string `json:"name"`
21+
Content string `json:"content"`
22+
Meta domain.NodeMeta `json:"meta"`
23+
ParentID string `json:"parent_id"`
24+
CreatedAt time.Time `json:"created_at"`
25+
UpdatedAt time.Time `json:"updated_at"`
26+
Permissions domain.NodePermissions `json:"permissions"`
27+
CreatorId string `json:"creator_id"`
28+
EditorId string `json:"editor_id"`
29+
PublisherId string `json:"publisher_id" gorm:"-"`
30+
CreatorAccount string `json:"creator_account"`
31+
EditorAccount string `json:"editor_account"`
32+
PublisherAccount string `json:"publisher_account" gorm:"-"`
2733
}
2834

2935
type NodePermissionReq struct {

backend/api/share/v1/node.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package v1
2+
3+
import (
4+
"time"
5+
6+
"github.com/chaitin/panda-wiki/domain"
7+
)
8+
9+
type ShareNodeDetailResp struct {
10+
ID string `json:"id"`
11+
KbID string `json:"kb_id"`
12+
Type domain.NodeType `json:"type"`
13+
Status domain.NodeStatus `json:"status"`
14+
Name string `json:"name"`
15+
Content string `json:"content"`
16+
Meta domain.NodeMeta `json:"meta"`
17+
ParentID string `json:"parent_id"`
18+
CreatedAt time.Time `json:"created_at"`
19+
UpdatedAt time.Time `json:"updated_at"`
20+
Permissions domain.NodePermissions `json:"permissions"`
21+
CreatorId string `json:"creator_id"`
22+
EditorId string `json:"editor_id"`
23+
PublisherId string `json:"publisher_id"`
24+
CreatorAccount string `json:"creator_account"`
25+
EditorAccount string `json:"editor_account"`
26+
PublisherAccount string `json:"publisher_account"`
27+
}

backend/cmd/api/wire_gen.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/cmd/consumer/wire_gen.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/cmd/migrate/wire_gen.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/docs/docs.go

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3616,7 +3616,19 @@ const docTemplate = `{
36163616
"200": {
36173617
"description": "OK",
36183618
"schema": {
3619-
"$ref": "#/definitions/domain.Response"
3619+
"allOf": [
3620+
{
3621+
"$ref": "#/definitions/domain.Response"
3622+
},
3623+
{
3624+
"type": "object",
3625+
"properties": {
3626+
"data": {
3627+
"$ref": "#/definitions/v1.ShareNodeDetailResp"
3628+
}
3629+
}
3630+
}
3631+
]
36203632
}
36213633
}
36223634
}
@@ -8070,6 +8082,18 @@ const docTemplate = `{
80708082
"created_at": {
80718083
"type": "string"
80728084
},
8085+
"creator_account": {
8086+
"type": "string"
8087+
},
8088+
"creator_id": {
8089+
"type": "string"
8090+
},
8091+
"editor_account": {
8092+
"type": "string"
8093+
},
8094+
"editor_id": {
8095+
"type": "string"
8096+
},
80738097
"id": {
80748098
"type": "string"
80758099
},
@@ -8088,6 +8112,12 @@ const docTemplate = `{
80888112
"permissions": {
80898113
"$ref": "#/definitions/domain.NodePermissions"
80908114
},
8115+
"publisher_account": {
8116+
"type": "string"
8117+
},
8118+
"publisher_id": {
8119+
"type": "string"
8120+
},
80918121
"status": {
80928122
"$ref": "#/definitions/domain.NodeStatus"
80938123
},
@@ -8192,6 +8222,62 @@ const docTemplate = `{
81928222
}
81938223
}
81948224
},
8225+
"v1.ShareNodeDetailResp": {
8226+
"type": "object",
8227+
"properties": {
8228+
"content": {
8229+
"type": "string"
8230+
},
8231+
"created_at": {
8232+
"type": "string"
8233+
},
8234+
"creator_account": {
8235+
"type": "string"
8236+
},
8237+
"creator_id": {
8238+
"type": "string"
8239+
},
8240+
"editor_account": {
8241+
"type": "string"
8242+
},
8243+
"editor_id": {
8244+
"type": "string"
8245+
},
8246+
"id": {
8247+
"type": "string"
8248+
},
8249+
"kb_id": {
8250+
"type": "string"
8251+
},
8252+
"meta": {
8253+
"$ref": "#/definitions/domain.NodeMeta"
8254+
},
8255+
"name": {
8256+
"type": "string"
8257+
},
8258+
"parent_id": {
8259+
"type": "string"
8260+
},
8261+
"permissions": {
8262+
"$ref": "#/definitions/domain.NodePermissions"
8263+
},
8264+
"publisher_account": {
8265+
"type": "string"
8266+
},
8267+
"publisher_id": {
8268+
"type": "string"
8269+
},
8270+
"status": {
8271+
"$ref": "#/definitions/domain.NodeStatus"
8272+
},
8273+
"type": {
8274+
"$ref": "#/definitions/domain.NodeType"
8275+
},
8276+
"updated_at": {
8277+
"type": "string"
8278+
}
8279+
}
8280+
},
81958281
"v1.StatCountResp": {
81968282
"type": "object",
81978283
"properties": {

backend/docs/swagger.json

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3609,7 +3609,19 @@
36093609
"200": {
36103610
"description": "OK",
36113611
"schema": {
3612-
"$ref": "#/definitions/domain.Response"
3612+
"allOf": [
3613+
{
3614+
"$ref": "#/definitions/domain.Response"
3615+
},
3616+
{
3617+
"type": "object",
3618+
"properties": {
3619+
"data": {
3620+
"$ref": "#/definitions/v1.ShareNodeDetailResp"
3621+
}
3622+
}
3623+
}
3624+
]
36133625
}
36143626
}
36153627
}
@@ -8063,6 +8075,18 @@
80638075
"created_at": {
80648076
"type": "string"
80658077
},
8078+
"creator_account": {
8079+
"type": "string"
8080+
},
8081+
"creator_id": {
8082+
"type": "string"
8083+
},
8084+
"editor_account": {
8085+
"type": "string"
8086+
},
8087+
"editor_id": {
8088+
"type": "string"
8089+
},
80668090
"id": {
80678091
"type": "string"
80688092
},
@@ -8081,6 +8105,12 @@
80818105
"permissions": {
80828106
"$ref": "#/definitions/domain.NodePermissions"
80838107
},
8108+
"publisher_account": {
8109+
"type": "string"
8110+
},
8111+
"publisher_id": {
8112+
"type": "string"
8113+
},
80848114
"status": {
80858115
"$ref": "#/definitions/domain.NodeStatus"
80868116
},
@@ -8185,6 +8215,62 @@
81858215
}
81868216
}
81878217
},
8218+
"v1.ShareNodeDetailResp": {
8219+
"type": "object",
8220+
"properties": {
8221+
"content": {
8222+
"type": "string"
8223+
},
8224+
"created_at": {
8225+
"type": "string"
8226+
},
8227+
"creator_account": {
8228+
"type": "string"
8229+
},
8230+
"creator_id": {
8231+
"type": "string"
8232+
},
8233+
"editor_account": {
8234+
"type": "string"
8235+
},
8236+
"editor_id": {
8237+
"type": "string"
8238+
},
8239+
"id": {
8240+
"type": "string"
8241+
},
8242+
"kb_id": {
8243+
"type": "string"
8244+
},
8245+
"meta": {
8246+
"$ref": "#/definitions/domain.NodeMeta"
8247+
},
8248+
"name": {
8249+
"type": "string"
8250+
},
8251+
"parent_id": {
8252+
"type": "string"
8253+
},
8254+
"permissions": {
8255+
"$ref": "#/definitions/domain.NodePermissions"
8256+
},
8257+
"publisher_account": {
8258+
"type": "string"
8259+
},
8260+
"publisher_id": {
8261+
"type": "string"
8262+
},
8263+
"status": {
8264+
"$ref": "#/definitions/domain.NodeStatus"
8265+
},
8266+
"type": {
8267+
"$ref": "#/definitions/domain.NodeType"
8268+
},
8269+
"updated_at": {
8270+
"type": "string"
8271+
}
8272+
}
8273+
},
81888274
"v1.StatCountResp": {
81898275
"type": "object",
81908276
"properties": {

0 commit comments

Comments
 (0)