作者 庄敏学
... ... @@ -16,10 +16,6 @@ info(
)
service Core {
@doc "小程序获取回复@人可选列表"
@handler MiniArticleCommentAtUser
post /article_comment/at_user/select (MiniArticleCommentAtUserRequest) returns (MiniArticleCommentAtUserResponse)
@doc "小程序填写文章的评论"
@handler MiniCreateArticleComment
post /article_comment (MiniCreateArticleCommentRequest) returns (MiniCreateArticleCommentResponse)
... ... @@ -58,17 +54,6 @@ service Core {
post /article_comment/search/me (SystemArticleCommentSearchMeRequest) returns (SystemArticleCommentSearchMeResponse)
}
//
// 小程序获取回复@人可选列表
type (
MiniArticleCommentAtUserRequest {
ArtitceId int64 `json:"articleId"`
}
MiniArticleCommentAtUserResponse {
}
)
//评论的填写人
type CommentAuthor {
Id int64 `json:"id"` // 人员id
... ... @@ -206,15 +191,15 @@ type (
}
)
type(
SystemArticleCommentSearchMeRequest{
type (
SystemArticleCommentSearchMeRequest {
Page int `json:"page"`
Size int `json:"size"`
AuthorId int64 `json:"authorId"` // 用户
BeginTime int64 `json:"beginTime,optional"` // 开始时间
EndTime int64 `json:"endTime,optional"` // 结束时间
}
SystemArticleCommentSearchMeResponse{
SystemArticleCommentSearchMeResponse {
List []ArticleCommentItem `json:"list"`
Total int64 `json:"total"`
}
... ...
... ... @@ -7,6 +7,8 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/logic/article"
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc"
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types"
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/contextdata"
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result"
)
func MiniArticleSetTagHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
... ... @@ -18,11 +20,10 @@ func MiniArticleSetTagHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
}
l := article.NewMiniArticleSetTagLogic(r.Context(), svcCtx)
token := contextdata.GetUserTokenFromCtx(r.Context())
req.UserId = token.UserId
req.CompanyId = token.CompanyId
resp, err := l.MiniArticleSetTag(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
result.HttpResult(r, w, resp, err)
}
}
... ...
package comment
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/logic/comment"
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc"
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types"
)
func MiniArticleCommentAtUserHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.MiniArticleCommentAtUserRequest
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
l := comment.NewMiniArticleCommentAtUserLogic(r.Context(), svcCtx)
resp, err := l.MiniArticleCommentAtUser(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
}
}
... ... @@ -22,11 +22,6 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
[]rest.Route{
{
Method: http.MethodPost,
Path: "/article_comment/at_user/select",
Handler: comment.MiniArticleCommentAtUserHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/article_comment",
Handler: comment.MiniCreateArticleCommentHandler(serverCtx),
},
... ...
... ... @@ -23,8 +23,9 @@ func NewMiniArticleSetTagLogic(ctx context.Context, svcCtx *svc.ServiceContext)
}
}
// 设置文章的定性标签
func (l *MiniArticleSetTagLogic) MiniArticleSetTag(req *types.MiniArticleSetTagRequest) (resp *types.MiniArticleSetTagResponse, err error) {
// todo: add your logic here and delete this line
//
return
}
... ...
package comment
import (
"context"
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc"
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type MiniArticleCommentAtUserLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewMiniArticleCommentAtUserLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MiniArticleCommentAtUserLogic {
return &MiniArticleCommentAtUserLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *MiniArticleCommentAtUserLogic) MiniArticleCommentAtUser(req *types.MiniArticleCommentAtUserRequest) (resp *types.MiniArticleCommentAtUserResponse, err error) {
// todo: add your logic here and delete this line
return
}
// Code generated by goctl. DO NOT EDIT.
package types
type MiniArticleCommentAtUserRequest struct {
ArtitceId int64 `json:"articleId"`
}
type MiniArticleCommentAtUserResponse struct {
}
type CommentAuthor struct {
Id int64 `json:"id"` // 人员id
Name string `json:"name"` // 人员的名字
... ...