Skip to content

Commit

Permalink
[MODIFY] Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
mallycrip committed May 11, 2021
1 parent 5ab3f85 commit 1452099
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
9 changes: 5 additions & 4 deletions application/decorator/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
from domain.exception.not_proxy_auth.bad_x_request_id_exception import BadXRequestId



def jagger_enable(fn):
def jaeger_enable(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
flag = 0
Expand All @@ -23,8 +22,10 @@ def wrapper(*args, **kwargs):
parents_span = v
flag += 1
else:
if not x_request_id: raise BadXRequestId
elif not parents_span: raise BadSpanContext
if not x_request_id:
raise BadXRequestId
elif not parents_span:
raise BadSpanContext

open_tracing_service = OpenTracing(open_tracing.tracer, parents_span, x_request_id)
return open_tracing_service.start_active_span(fn, *args, **kwargs)
Expand Down
8 changes: 4 additions & 4 deletions application/servicers/outing_parents_servicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from infrastructure.implementation.repository.outing_repository_impl import OutingRepositoryImpl

from proto.python.outing import outing_parents_pb2_grpc, outing_parents_pb2
from application.decorator.metadata import jagger_enable
from application.decorator.metadata import jaeger_enable
from application.decorator.error_handling import error_handling


Expand Down Expand Up @@ -46,16 +46,16 @@ def __init__(self):
)

@error_handling(outing_parents_pb2.ConfirmOutingByOCodeResponse)
@jagger_enable
@jaeger_enable
def ApproveOutingByOCode(self, request, context):
return self.service.approve_outing(request, context)

@error_handling(outing_parents_pb2.ConfirmOutingByOCodeResponse)
@jagger_enable
@jaeger_enable
def RejectOutingByOCode(self, request, context):
return self.service.reject_outing(request, context)

@error_handling(outing_parents_pb2.GetOutingByOCodeResponse)
@jagger_enable
@jaeger_enable
def GetOutingByOCode(self, request, context):
return self.service.get_outing(request, context)
14 changes: 7 additions & 7 deletions application/servicers/outing_student_servicer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from application.decorator.metadata import jagger_enable
from application.decorator.metadata import jaeger_enable
from application.decorator.error_handling import error_handling
from infrastructure.implementation.repository.confirm_code_repository_impl import ConfirmCodeRepositoryImpl
from infrastructure.implementation.repository.parents_repository_impl import ParentsRepositoryImpl
Expand Down Expand Up @@ -75,31 +75,31 @@ def __init__(self):
)

@error_handling(outing_student_pb2.CreateOutingResponse)
@jagger_enable
@jaeger_enable
def CreateOuting(self, request, context):
return self.service.create_outing(request, context)

@error_handling(outing_student_pb2.GetCardAboutOutingResponse)
@jagger_enable
@jaeger_enable
def GetCardAboutOuting(self, request, context):
return self.service.get_card_about_outing(request, context)

@error_handling(outing_student_pb2.GetOutingInformResponse)
@jagger_enable
@jaeger_enable
def GetOutingInform(self, request, context):
return self.service.get_outing_inform(request, context)

@error_handling(outing_student_pb2.GetStudentOutingsResponse)
@jagger_enable
@jaeger_enable
def GetStudentOutings(self, request, context):
return self.service.get_student_outings(request, context)

@error_handling(outing_student_pb2.GoOutResponse)
@jagger_enable
@jaeger_enable
def StartGoOut(self, request, context):
return self.service.go_out(request, context)

@error_handling(outing_student_pb2.GoOutResponse)
@jagger_enable
@jaeger_enable
def FinishGoOut(self, request, context):
return self.service.finish_go_out(request, context)
12 changes: 6 additions & 6 deletions application/servicers/outing_teacher_servicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from service.mapper.teacher_outing_mapper import TeacherOutingMapper

from service.teacher_outing_service import TeacherOutingService
from application.decorator.metadata import jagger_enable
from application.decorator.metadata import jaeger_enable
from application.decorator.error_handling import error_handling

from infrastructure.implementation.repository.outing_repository_impl import OutingRepositoryImpl
Expand Down Expand Up @@ -56,26 +56,26 @@ def __init__(self):
)

@error_handling(outing_teacher_pb2.OutingResponse)
@jagger_enable
@jaeger_enable
def GetOutingWithFilter(self, request, context):
return self.service.get_outings_with_filter(request, context)

@error_handling(outing_teacher_pb2.ConfirmOutingResponse)
@jagger_enable
@jaeger_enable
def ApproveOuting(self, request, context):
return self.service.approve_outing(request, context)

@error_handling(outing_teacher_pb2.ConfirmOutingResponse)
@jagger_enable
@jaeger_enable
def RejectOuting(self, request, context):
return self.service.reject_outing(request, context)

@error_handling(outing_teacher_pb2.ConfirmOutingResponse)
@jagger_enable
@jaeger_enable
def CertifyOuting(self, request, context):
return self.service.certify_outing(request, context)

@error_handling(outing_teacher_pb2.ConfirmOutingResponse)
@jagger_enable
@jaeger_enable
def ModifyOuting(self, request, context):
return self.service.modify_outing(request, context)

0 comments on commit 1452099

Please sign in to comment.