Files
evening_detective_server/internal/app/legal_docs.go
T
2026-09-16 23:56:15 +07:00

39 lines
1.6 KiB
Go

package app
import (
"context"
"evening_detective_server/docs"
proto "evening_detective_server/proto"
)
// GetTerms возвращает текст Пользовательского соглашения (постоянный URL
// /api/terms, на который ссылается форма регистрации при акцепте).
func (s *server) GetTerms(_ context.Context, _ *proto.GetTermsReq) (*proto.GetTermsRsp, error) {
text, err := docs.FS.ReadFile("TERMS.md")
if err != nil {
return &proto.GetTermsRsp{Error: "Не удалось получить документ"}, nil
}
return &proto.GetTermsRsp{Text: string(text)}, nil
}
// GetPrivacy возвращает текст Политики конфиденциальности (постоянный URL
// /api/privacy).
func (s *server) GetPrivacy(_ context.Context, _ *proto.GetPrivacyReq) (*proto.GetPrivacyRsp, error) {
text, err := docs.FS.ReadFile("PRIVACY.md")
if err != nil {
return &proto.GetPrivacyRsp{Error: "Не удалось получить документ"}, nil
}
return &proto.GetPrivacyRsp{Text: string(text)}, nil
}
// GetConsent возвращает текст согласия на обработку персональных данных
// (постоянный URL /api/consent).
func (s *server) GetConsent(_ context.Context, _ *proto.GetConsentReq) (*proto.GetConsentRsp, error) {
text, err := docs.FS.ReadFile("CONSENT.md")
if err != nil {
return &proto.GetConsentRsp{Error: "Не удалось получить документ"}, nil
}
return &proto.GetConsentRsp{Text: string(text)}, nil
}