generated from VLADIMIR/template
36 lines
1.1 KiB
Go
36 lines
1.1 KiB
Go
package app
|
|
|
|
import (
|
|
"context"
|
|
|
|
"evening_detective_server/docs"
|
|
proto "evening_detective_server/proto"
|
|
"google.golang.org/grpc/codes"
|
|
"google.golang.org/grpc/status"
|
|
)
|
|
|
|
func (s *server) GetTerms(_ context.Context, _ *proto.GetTermsReq) (*proto.GetTermsRsp, error) {
|
|
text, err := docs.FS.ReadFile("TERMS.md")
|
|
if err != nil {
|
|
return nil, status.Error(codes.Internal, "не удалось получить документ")
|
|
}
|
|
return &proto.GetTermsRsp{Text: string(text)}, nil
|
|
}
|
|
|
|
// /api/privacy).
|
|
func (s *server) GetPrivacy(_ context.Context, _ *proto.GetPrivacyReq) (*proto.GetPrivacyRsp, error) {
|
|
text, err := docs.FS.ReadFile("PRIVACY.md")
|
|
if err != nil {
|
|
return nil, status.Error(codes.Internal, "не удалось получить документ")
|
|
}
|
|
return &proto.GetPrivacyRsp{Text: string(text)}, nil
|
|
}
|
|
|
|
func (s *server) GetConsent(_ context.Context, _ *proto.GetConsentReq) (*proto.GetConsentRsp, error) {
|
|
text, err := docs.FS.ReadFile("CONSENT.md")
|
|
if err != nil {
|
|
return nil, status.Error(codes.Internal, "не удалось получить документ")
|
|
}
|
|
return &proto.GetConsentRsp{Text: string(text)}, nil
|
|
}
|