From 5f5563faf152942c5e38ef35b5e0577f98ef44f0 Mon Sep 17 00:00:00 2001 From: Marina Sakai <118230951+Marina-Sakai@users.noreply.github.com> Date: Wed, 12 Jun 2024 11:45:56 +0800 Subject: [PATCH] fix: register api key (#58) fix: reigster api key --- thrift/annotation/register.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/thrift/annotation/register.go b/thrift/annotation/register.go index f9d97356..4f432789 100644 --- a/thrift/annotation/register.go +++ b/thrift/annotation/register.go @@ -42,7 +42,8 @@ func init() { thrift.RegisterAnnotation(newValueMappingAnnotation(thrift.MakeAnnoID(thrift.AnnoKindValueMapping, thrift.AnnoScopeField, JSConv)), "api.js_conv") // KeyMapping - + thrift.RegisterAnnotation(newKeyMappingAnnotation(thrift.MakeAnnoID(thrift.AnnoKindKeyMapping, thrift.AnnoScopeField, APIKey)), APIKeyName) + // AnnotationMapper thrift.RegisterAnnotationMapper(thrift.AnnoScopeField, goTagMapper{}, "go.tag") thrift.RegisterAnnotationMapper(thrift.AnnoScopeField, apiBodyMapper{}, "api.body") @@ -59,7 +60,7 @@ func init() { func InitAGWAnnos() { thrift.RegisterAnnotation(newValueMappingAnnotation(thrift.MakeAnnoID(thrift.AnnoKindValueMapping, thrift.AnnoScopeField, JSConv)), "agw.js_conv") thrift.RegisterAnnotation(newValueMappingAnnotation(thrift.MakeAnnoID(thrift.AnnoKindValueMapping, thrift.AnnoScopeField, BodyDynamic)), "agw.body_dynamic") - thrift.RegisterAnnotation(newKeyMappingAnnotation(thrift.MakeAnnoID(thrift.AnnoKindKeyMapping, thrift.AnnoScopeField, APIKey)), "agw.key", APIKeyName) + thrift.RegisterAnnotation(newKeyMappingAnnotation(thrift.MakeAnnoID(thrift.AnnoKindKeyMapping, thrift.AnnoScopeField, APIKey)), "agw.key") // thrift.RegisterAnnotation(newKeyMappingAnnotation(thrift.MakeAnnoID(thrift.AnnoKindKeyMapping, thrift.AnnoScopeField, NameCase)), "agw.to_snake", "janus.to_snake", "agw.to_lower_camel_case", "janus.to_lower_camel_case") thrift.RegisterAnnotationMapper(thrift.AnnoScopeField, sourceMapper{}, "janus.source", "agw.source") thrift.RegisterAnnotationMapper(thrift.AnnoScopeField, targetMapper{}, "agw.target", "janus.target") @@ -74,5 +75,3 @@ func errNotFound(key string, scope string) error { func errNotImplemented(msg string) error { return meta.NewError(meta.ErrUnsupportedType, msg, nil) } - -