comment.api 1.4 KB

syntax = "v1"

info(
    title: "xx实例"
    desc: "xx实例"
    author: "author"
    email: "email"
    version: "v1"
)

@server(
    prefix: comment/v1
    group: comment
    jwt: JwtAuth
)
service Core {
    @handler getComment
    post /comment/:id (CommentGetRequest) returns (CommentGetResponse)
    @handler saveComment
    post /comment (CommentSaveRequest) returns (CommentSaveResponse)
    @handler deleteComment
    delete /comment/:id (CommentDeleteRequest) returns (CommentDeleteResponse)
    @handler updateComment
    put /comment/:id (CommentUpdateRequest) returns (CommentUpdateResponse)
    @handler searchComment
    post /comment/search (CommentSearchRequest) returns (CommentSearchResponse)
}

type (
    CommentGetRequest {
		Id int64 `path:"id"`
	}
    CommentGetResponse struct{
		Comment CommentItem `json:"comment"`
    }

	CommentSaveRequest struct{
		Comment CommentItem `json:"comment"`
    }
    CommentSaveResponse struct{}

	CommentDeleteRequest struct{
        Id int64 `path:"id"`
    }
    CommentDeleteResponse struct{}

	CommentUpdateRequest struct{
		Id int64 `path:"id"`
        Comment CommentItem `json:"comment"`
    }
    CommentUpdateResponse struct{}

 	CommentSearchRequest struct{
         Page int  `json:"page"`
         Size int  `json:"size"`
    }
    CommentSearchResponse{
        List []CommentItem  `json:"list"`
        Total int64 `json:"total"`
    }
	CommentItem struct{
	
	}
)