Merge branch 'comments' with new imports

This commit is contained in:
NaMe2te 2024-01-13 16:48:31 +03:00
parent c00519038a
commit 7326d7046e
19 changed files with 9 additions and 17 deletions

0
.gitignore vendored Normal file → Executable file
View file

0
.idea/.gitignore vendored Normal file → Executable file
View file

0
.idea/Blog.iml Normal file → Executable file
View file

0
.idea/modules.xml Normal file → Executable file
View file

0
.idea/vcs.xml Normal file → Executable file
View file

4
Comment/comment.go Normal file → Executable file
View file

@ -1,7 +1,7 @@
package Comment package Comment
import ( 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/native/std"
"github.com/nspcc-dev/neo-go/pkg/interop/storage" "github.com/nspcc-dev/neo-go/pkg/interop/storage"
) )
@ -18,7 +18,7 @@ type Comment struct {
func CreateNewComment(authorId string, postId string, text string) { func CreateNewComment(authorId string, postId string, text string) {
ctx := storage.GetContext() ctx := storage.GetContext()
newComment := Comment{ newComment := Comment{
id: guuid.New().String(), id: "1", // guuid.New().String(),
authorId: authorId, authorId: authorId,
postId: postId, postId: postId,
text: text, text: text,

View file

@ -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
View file

0
Forum/forum_contract.go Normal file → Executable file
View file

0
Models/categories.json Normal file → Executable file
View file

View 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
View file

@ -0,0 +1,4 @@
name: post
safemethods: []
supportedstandards: []
events: []

2
Post/post_contract.go Normal file → Executable file
View file

@ -51,7 +51,7 @@ func GetPost(postId string) Post {
ctx := storage.GetReadOnlyContext() ctx := storage.GetReadOnlyContext()
data := storage.Get(ctx, postId) data := storage.Get(ctx, postId)
if data == nil { if data == nil {
panic("player not found") panic("user not found")
} }
return std.Deserialize(data.([]byte)).(Post) return std.Deserialize(data.([]byte)).(Post)

0
README.md Normal file → Executable file
View file

0
User/user.go Normal file → Executable file
View file

0
User/user.yml Normal file → Executable file
View file

0
go.mod Normal file → Executable file
View file

3
go.sum Normal file → Executable file
View 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/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 h1:HwR9fWkdJXCbsTnrb2Rm92xkDGdEM0VHvZV+7XJUXM0=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231219060339-de98b39a9502/go.mod h1:J/Mk6+nKeKSW4wygkZQFLQ6SkLOSGX5Ga0RuuuktEag= 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=