Skip to content

Commit

Permalink
Merge pull request #122 from GSM-MSG/121-scaffold-script-fix
Browse files Browse the repository at this point in the history
🔀 :: scaffold를 생성하는 스크립트 이상한 점 변경
  • Loading branch information
baekteun authored Mar 29, 2023
2 parents 8d61bc2 + 4ee5051 commit 4babf36
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scaffold.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def write_code_in_file(file_path: str, codes: str):
def register_presentation(domain: str, api_name: str, method: str, path: str, has_request: bool, has_response: bool):
method_str = ''
if method == 'HEAD':
method_str = f'@RequestMapping(value={path}, method = RequestMethod.HEAD)'
method_str = f'@RequestMapping(value="{path}", method = RequestMethod.HEAD)'
else:
method_str = f'@{method.lower().capitalize()}Mapping'
method_str = f'@{method.lower().capitalize()}Mapping("{path}")'

param_str = ''
if has_request:
Expand Down Expand Up @@ -52,7 +52,7 @@ def register_service(domain: str, api_name: str, has_request: bool, has_response

response_str = ''
if has_response:
response_str = f': ResponseEntity<{api_name.capitalize()}ResponseDto>'
response_str = f': {api_name.capitalize()}ResponseDto'

service_content = f"""@TransactionalService
class {api_name.capitalize()}Service(
Expand All @@ -62,7 +62,7 @@ class {api_name.capitalize()}Service(
{'}'}
{'}'}
"""
write_file_at(f'src/main/kotlin/com/msg/gauth/domain/{domain}/services/{domain.capitalize()}Service.kt', service_content)
write_file_at(f'src/main/kotlin/com/msg/gauth/domain/{domain}/services/{api_name.capitalize()}Service.kt', service_content)

def read_file_at(file_path: str):
with open(file_path, 'r') as file:
Expand Down

0 comments on commit 4babf36

Please sign in to comment.