Merge branch 'comments' with new imports
This commit is contained in:
parent
c00519038a
commit
7326d7046e
19 changed files with 9 additions and 17 deletions
0
.gitignore
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
0
.idea/.gitignore
vendored
Normal file → Executable file
0
.idea/.gitignore
vendored
Normal file → Executable file
0
.idea/Blog.iml
Normal file → Executable file
0
.idea/Blog.iml
Normal file → Executable file
0
.idea/modules.xml
Normal file → Executable file
0
.idea/modules.xml
Normal file → Executable file
0
.idea/vcs.xml
Normal file → Executable file
0
.idea/vcs.xml
Normal file → Executable file
4
Comment/comment.go
Normal file → Executable file
4
Comment/comment.go
Normal file → Executable file
|
@ -1,7 +1,7 @@
|
|||
package Comment
|
||||
|
||||
import (
|
||||
guuid "github.com/google/uuid"
|
||||
//guuid "github.com/google/uuid"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/native/std"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/storage"
|
||||
)
|
||||
|
@ -18,7 +18,7 @@ type Comment struct {
|
|||
func CreateNewComment(authorId string, postId string, text string) {
|
||||
ctx := storage.GetContext()
|
||||
newComment := Comment{
|
||||
id: guuid.New().String(),
|
||||
id: "1", // guuid.New().String(),
|
||||
authorId: authorId,
|
||||
postId: postId,
|
||||
text: text,
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"name":"comment","abi":{"methods":[{"name":"createNewComment","offset":0,"parameters":[{"name":"authorId","type":"String"},{"name":"postId","type":"String"},{"name":"text","type":"String"}],"returntype":"Void","safe":false},{"name":"getByAuthorId","offset":109,"parameters":[{"name":"postId","type":"String"},{"name":"authorId","type":"String"}],"returntype":"Array","safe":false},{"name":"getByPostId","offset":61,"parameters":[{"name":"postId","type":"String"}],"returntype":"Array","safe":false},{"name":"getComment","offset":157,"parameters":[{"name":"commentId","type":"String"},{"name":"postId","type":"String"}],"returntype":"Array","safe":false},{"name":"rateComment","offset":259,"parameters":[{"name":"isLike","type":"Boolean"},{"name":"postId","type":"String"},{"name":"commentId","type":"String"}],"returntype":"Void","safe":false}],"events":[{"name":"Hello world!","parameters":[{"name":"args","type":"Array"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null}
|
||||
{"name":"comment","abi":{"methods":[{"name":"createNewComment","offset":0,"parameters":[{"name":"authorId","type":"String"},{"name":"postId","type":"String"},{"name":"text","type":"String"}],"returntype":"Void","safe":false},{"name":"getByAuthorId","offset":109,"parameters":[{"name":"postId","type":"String"},{"name":"authorId","type":"String"}],"returntype":"Array","safe":false},{"name":"getByPostId","offset":61,"parameters":[{"name":"postId","type":"String"}],"returntype":"Array","safe":false},{"name":"getComment","offset":157,"parameters":[{"name":"commentId","type":"String"},{"name":"postId","type":"String"}],"returntype":"Array","safe":false},{"name":"rateComment","offset":259,"parameters":[{"name":"isLike","type":"Boolean"},{"name":"postId","type":"String"},{"name":"commentId","type":"String"}],"returntype":"Void","safe":false},{"name":"updateComment","offset":292,"parameters":[{"name":"comment","type":"Array"},{"name":"postId","type":"String"}],"returntype":"Void","safe":false}],"events":[{"name":"Hello world!","parameters":[{"name":"args","type":"Array"}]}]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null}
|
Binary file not shown.
0
Comment/comment.yml
Normal file → Executable file
0
Comment/comment.yml
Normal file → Executable file
0
Forum/forum_contract.go
Normal file → Executable file
0
Forum/forum_contract.go
Normal file → Executable file
0
Models/categories.json
Normal file → Executable file
0
Models/categories.json
Normal file → Executable file
|
@ -1,11 +0,0 @@
|
|||
name: Post
|
||||
sourceurl: http://example.com/
|
||||
safemethods: []
|
||||
supportedstandards: []
|
||||
events:
|
||||
- name: Hello world!
|
||||
parameters:
|
||||
- name: args
|
||||
type: Array
|
||||
permissions:
|
||||
- methods: '*'
|
4
Post/post.yml
Executable file
4
Post/post.yml
Executable file
|
@ -0,0 +1,4 @@
|
|||
name: post
|
||||
safemethods: []
|
||||
supportedstandards: []
|
||||
events: []
|
2
Post/post_contract.go
Normal file → Executable file
2
Post/post_contract.go
Normal file → Executable file
|
@ -51,7 +51,7 @@ func GetPost(postId string) Post {
|
|||
ctx := storage.GetReadOnlyContext()
|
||||
data := storage.Get(ctx, postId)
|
||||
if data == nil {
|
||||
panic("player not found")
|
||||
panic("user not found")
|
||||
}
|
||||
|
||||
return std.Deserialize(data.([]byte)).(Post)
|
||||
|
|
0
README.md
Normal file → Executable file
0
README.md
Normal file → Executable file
0
User/user.go
Normal file → Executable file
0
User/user.go
Normal file → Executable file
0
User/user.yml
Normal file → Executable file
0
User/user.yml
Normal file → Executable file
0
go.mod
Normal file → Executable file
0
go.mod
Normal file → Executable file
3
go.sum
Normal file → Executable file
3
go.sum
Normal file → Executable file
|
@ -2,5 +2,4 @@ github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
|
|||
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231219060339-de98b39a9502 h1:HwR9fWkdJXCbsTnrb2Rm92xkDGdEM0VHvZV+7XJUXM0=
|
||||
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231219060339-de98b39a9502/go.mod h1:J/Mk6+nKeKSW4wygkZQFLQ6SkLOSGX5Ga0RuuuktEag=
|
||||
github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc=
|
||||
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
||||
|
||||
|
|
Loading…
Reference in a new issue