Files
wwweww 19cc7a778c Refactor: Remove deprecated gRPC service files and implement new API structure
- Deleted old gRPC service definitions in `game_grpc.pb.go` and `public.go`.
- Added new API server implementations for objectstory, player, and shop services.
- Introduced configuration files for new APIs in `etc/*.yaml`.
- Created main entry points for each service in `objectstory.go`, `player.go`, and `shop.go`.
- Removed unused user update handler and user API files.
- Added utility functions for context management and HTTP header parsing.
- Introduced PostgreSQL backup configuration in `backup/postgreSql.yaml`.
2026-02-28 18:35:56 +08:00

203 lines
10 KiB
Go

// Code generated by goctl. DO NOT EDIT.
// goctl 1.9.2
// Source: community.proto
package communityservice
import (
"context"
"juwan-backend/app/community/rpc/pb"
"github.com/zeromicro/go-zero/zrpc"
"google.golang.org/grpc"
)
type (
AddCommentLikesReq = pb.AddCommentLikesReq
AddCommentLikesResp = pb.AddCommentLikesResp
AddCommentsReq = pb.AddCommentsReq
AddCommentsResp = pb.AddCommentsResp
AddPostLikesReq = pb.AddPostLikesReq
AddPostLikesResp = pb.AddPostLikesResp
AddPostsReq = pb.AddPostsReq
AddPostsResp = pb.AddPostsResp
CommentLikes = pb.CommentLikes
Comments = pb.Comments
DelCommentLikesReq = pb.DelCommentLikesReq
DelCommentLikesResp = pb.DelCommentLikesResp
DelCommentsReq = pb.DelCommentsReq
DelCommentsResp = pb.DelCommentsResp
DelPostLikesReq = pb.DelPostLikesReq
DelPostLikesResp = pb.DelPostLikesResp
DelPostsReq = pb.DelPostsReq
DelPostsResp = pb.DelPostsResp
GetCommentLikesByIdReq = pb.GetCommentLikesByIdReq
GetCommentLikesByIdResp = pb.GetCommentLikesByIdResp
GetCommentsByIdReq = pb.GetCommentsByIdReq
GetCommentsByIdResp = pb.GetCommentsByIdResp
GetPostLikesByIdReq = pb.GetPostLikesByIdReq
GetPostLikesByIdResp = pb.GetPostLikesByIdResp
GetPostsByIdReq = pb.GetPostsByIdReq
GetPostsByIdResp = pb.GetPostsByIdResp
PostLikes = pb.PostLikes
Posts = pb.Posts
SearchCommentLikesReq = pb.SearchCommentLikesReq
SearchCommentLikesResp = pb.SearchCommentLikesResp
SearchCommentsReq = pb.SearchCommentsReq
SearchCommentsResp = pb.SearchCommentsResp
SearchPostLikesReq = pb.SearchPostLikesReq
SearchPostLikesResp = pb.SearchPostLikesResp
SearchPostsReq = pb.SearchPostsReq
SearchPostsResp = pb.SearchPostsResp
UpdateCommentLikesReq = pb.UpdateCommentLikesReq
UpdateCommentLikesResp = pb.UpdateCommentLikesResp
UpdateCommentsReq = pb.UpdateCommentsReq
UpdateCommentsResp = pb.UpdateCommentsResp
UpdatePostLikesReq = pb.UpdatePostLikesReq
UpdatePostLikesResp = pb.UpdatePostLikesResp
UpdatePostsReq = pb.UpdatePostsReq
UpdatePostsResp = pb.UpdatePostsResp
CommunityService interface {
// -----------------------commentLikes-----------------------
AddCommentLikes(ctx context.Context, in *AddCommentLikesReq, opts ...grpc.CallOption) (*AddCommentLikesResp, error)
UpdateCommentLikes(ctx context.Context, in *UpdateCommentLikesReq, opts ...grpc.CallOption) (*UpdateCommentLikesResp, error)
DelCommentLikes(ctx context.Context, in *DelCommentLikesReq, opts ...grpc.CallOption) (*DelCommentLikesResp, error)
GetCommentLikesById(ctx context.Context, in *GetCommentLikesByIdReq, opts ...grpc.CallOption) (*GetCommentLikesByIdResp, error)
SearchCommentLikes(ctx context.Context, in *SearchCommentLikesReq, opts ...grpc.CallOption) (*SearchCommentLikesResp, error)
// -----------------------comments-----------------------
AddComments(ctx context.Context, in *AddCommentsReq, opts ...grpc.CallOption) (*AddCommentsResp, error)
UpdateComments(ctx context.Context, in *UpdateCommentsReq, opts ...grpc.CallOption) (*UpdateCommentsResp, error)
DelComments(ctx context.Context, in *DelCommentsReq, opts ...grpc.CallOption) (*DelCommentsResp, error)
GetCommentsById(ctx context.Context, in *GetCommentsByIdReq, opts ...grpc.CallOption) (*GetCommentsByIdResp, error)
SearchComments(ctx context.Context, in *SearchCommentsReq, opts ...grpc.CallOption) (*SearchCommentsResp, error)
// -----------------------postLikes-----------------------
AddPostLikes(ctx context.Context, in *AddPostLikesReq, opts ...grpc.CallOption) (*AddPostLikesResp, error)
UpdatePostLikes(ctx context.Context, in *UpdatePostLikesReq, opts ...grpc.CallOption) (*UpdatePostLikesResp, error)
DelPostLikes(ctx context.Context, in *DelPostLikesReq, opts ...grpc.CallOption) (*DelPostLikesResp, error)
GetPostLikesById(ctx context.Context, in *GetPostLikesByIdReq, opts ...grpc.CallOption) (*GetPostLikesByIdResp, error)
SearchPostLikes(ctx context.Context, in *SearchPostLikesReq, opts ...grpc.CallOption) (*SearchPostLikesResp, error)
// -----------------------posts-----------------------
AddPosts(ctx context.Context, in *AddPostsReq, opts ...grpc.CallOption) (*AddPostsResp, error)
UpdatePosts(ctx context.Context, in *UpdatePostsReq, opts ...grpc.CallOption) (*UpdatePostsResp, error)
DelPosts(ctx context.Context, in *DelPostsReq, opts ...grpc.CallOption) (*DelPostsResp, error)
GetPostsById(ctx context.Context, in *GetPostsByIdReq, opts ...grpc.CallOption) (*GetPostsByIdResp, error)
SearchPosts(ctx context.Context, in *SearchPostsReq, opts ...grpc.CallOption) (*SearchPostsResp, error)
}
defaultCommunityService struct {
cli zrpc.Client
}
)
func NewCommunityService(cli zrpc.Client) CommunityService {
return &defaultCommunityService{
cli: cli,
}
}
// -----------------------commentLikes-----------------------
func (m *defaultCommunityService) AddCommentLikes(ctx context.Context, in *AddCommentLikesReq, opts ...grpc.CallOption) (*AddCommentLikesResp, error) {
client := pb.NewCommunityServiceClient(m.cli.Conn())
return client.AddCommentLikes(ctx, in, opts...)
}
func (m *defaultCommunityService) UpdateCommentLikes(ctx context.Context, in *UpdateCommentLikesReq, opts ...grpc.CallOption) (*UpdateCommentLikesResp, error) {
client := pb.NewCommunityServiceClient(m.cli.Conn())
return client.UpdateCommentLikes(ctx, in, opts...)
}
func (m *defaultCommunityService) DelCommentLikes(ctx context.Context, in *DelCommentLikesReq, opts ...grpc.CallOption) (*DelCommentLikesResp, error) {
client := pb.NewCommunityServiceClient(m.cli.Conn())
return client.DelCommentLikes(ctx, in, opts...)
}
func (m *defaultCommunityService) GetCommentLikesById(ctx context.Context, in *GetCommentLikesByIdReq, opts ...grpc.CallOption) (*GetCommentLikesByIdResp, error) {
client := pb.NewCommunityServiceClient(m.cli.Conn())
return client.GetCommentLikesById(ctx, in, opts...)
}
func (m *defaultCommunityService) SearchCommentLikes(ctx context.Context, in *SearchCommentLikesReq, opts ...grpc.CallOption) (*SearchCommentLikesResp, error) {
client := pb.NewCommunityServiceClient(m.cli.Conn())
return client.SearchCommentLikes(ctx, in, opts...)
}
// -----------------------comments-----------------------
func (m *defaultCommunityService) AddComments(ctx context.Context, in *AddCommentsReq, opts ...grpc.CallOption) (*AddCommentsResp, error) {
client := pb.NewCommunityServiceClient(m.cli.Conn())
return client.AddComments(ctx, in, opts...)
}
func (m *defaultCommunityService) UpdateComments(ctx context.Context, in *UpdateCommentsReq, opts ...grpc.CallOption) (*UpdateCommentsResp, error) {
client := pb.NewCommunityServiceClient(m.cli.Conn())
return client.UpdateComments(ctx, in, opts...)
}
func (m *defaultCommunityService) DelComments(ctx context.Context, in *DelCommentsReq, opts ...grpc.CallOption) (*DelCommentsResp, error) {
client := pb.NewCommunityServiceClient(m.cli.Conn())
return client.DelComments(ctx, in, opts...)
}
func (m *defaultCommunityService) GetCommentsById(ctx context.Context, in *GetCommentsByIdReq, opts ...grpc.CallOption) (*GetCommentsByIdResp, error) {
client := pb.NewCommunityServiceClient(m.cli.Conn())
return client.GetCommentsById(ctx, in, opts...)
}
func (m *defaultCommunityService) SearchComments(ctx context.Context, in *SearchCommentsReq, opts ...grpc.CallOption) (*SearchCommentsResp, error) {
client := pb.NewCommunityServiceClient(m.cli.Conn())
return client.SearchComments(ctx, in, opts...)
}
// -----------------------postLikes-----------------------
func (m *defaultCommunityService) AddPostLikes(ctx context.Context, in *AddPostLikesReq, opts ...grpc.CallOption) (*AddPostLikesResp, error) {
client := pb.NewCommunityServiceClient(m.cli.Conn())
return client.AddPostLikes(ctx, in, opts...)
}
func (m *defaultCommunityService) UpdatePostLikes(ctx context.Context, in *UpdatePostLikesReq, opts ...grpc.CallOption) (*UpdatePostLikesResp, error) {
client := pb.NewCommunityServiceClient(m.cli.Conn())
return client.UpdatePostLikes(ctx, in, opts...)
}
func (m *defaultCommunityService) DelPostLikes(ctx context.Context, in *DelPostLikesReq, opts ...grpc.CallOption) (*DelPostLikesResp, error) {
client := pb.NewCommunityServiceClient(m.cli.Conn())
return client.DelPostLikes(ctx, in, opts...)
}
func (m *defaultCommunityService) GetPostLikesById(ctx context.Context, in *GetPostLikesByIdReq, opts ...grpc.CallOption) (*GetPostLikesByIdResp, error) {
client := pb.NewCommunityServiceClient(m.cli.Conn())
return client.GetPostLikesById(ctx, in, opts...)
}
func (m *defaultCommunityService) SearchPostLikes(ctx context.Context, in *SearchPostLikesReq, opts ...grpc.CallOption) (*SearchPostLikesResp, error) {
client := pb.NewCommunityServiceClient(m.cli.Conn())
return client.SearchPostLikes(ctx, in, opts...)
}
// -----------------------posts-----------------------
func (m *defaultCommunityService) AddPosts(ctx context.Context, in *AddPostsReq, opts ...grpc.CallOption) (*AddPostsResp, error) {
client := pb.NewCommunityServiceClient(m.cli.Conn())
return client.AddPosts(ctx, in, opts...)
}
func (m *defaultCommunityService) UpdatePosts(ctx context.Context, in *UpdatePostsReq, opts ...grpc.CallOption) (*UpdatePostsResp, error) {
client := pb.NewCommunityServiceClient(m.cli.Conn())
return client.UpdatePosts(ctx, in, opts...)
}
func (m *defaultCommunityService) DelPosts(ctx context.Context, in *DelPostsReq, opts ...grpc.CallOption) (*DelPostsResp, error) {
client := pb.NewCommunityServiceClient(m.cli.Conn())
return client.DelPosts(ctx, in, opts...)
}
func (m *defaultCommunityService) GetPostsById(ctx context.Context, in *GetPostsByIdReq, opts ...grpc.CallOption) (*GetPostsByIdResp, error) {
client := pb.NewCommunityServiceClient(m.cli.Conn())
return client.GetPostsById(ctx, in, opts...)
}
func (m *defaultCommunityService) SearchPosts(ctx context.Context, in *SearchPostsReq, opts ...grpc.CallOption) (*SearchPostsResp, error) {
client := pb.NewCommunityServiceClient(m.cli.Conn())
return client.SearchPosts(ctx, in, opts...)
}