'''
Author: deng.yinping deng.yinping@muchinfo.cn
Date: 2024-12-06 15:02:12
LastEditors: deng.yinping deng.yinping@muchinfo.cn
LastEditTime: 2025-03-07 16:58:12
FilePath: \MTP20_i18n_Tool\main.py
Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
'''

from src.tools import Tools
from src.service_tools import Service_Tools

output_folder_pc="output"
json_folder_pc="C:/Workspaces/Code_Git/MTP20_WEB_GLOBAL/public/locales/"
oem_json_folder_pc = "C:/Workspaces/Code_Git/MTP20_WEB_GLOBAL/oem/"

output_folder_manage="output_manage"
json_folder_manage="C:/Workspaces/Code_Git/MTP2.0_NEWMANAGE_WEB\public/locales/"
oem_json_folder_manage = "C:/Workspaces/Code_Git/MTP2.0_NEWMANAGE_WEB/oem/"

output_folder_manage_service="output_manage_service"
json_folder_manage_service="C:/Workspaces/Code_Git/MTP2.0_NEWMANAGE_SERVICE/mtp3-century/src/main/resources/"
oem_json_folder_manage_service = ""
      
if __name__ == "__main__":
    while True:    
        platform = input("请选择平台 (pc, manage, service, exit): ")
        
        if platform == "exit":
            break
        
        type = input("请选择生成类型 (excel, json): ")
        if platform == "pc":
            oem = "tss"
            inc_file = "20250306_tss_inc"
            print("inc_file:" + inc_file)
            if type == "excel":
                # 生成交易前端excel及增量
                Tools.generate_excel(oem, inc_file, output_folder_pc, json_folder_pc, oem_json_folder_pc)
            elif type == "json":
                # 生成交易前端json及增量
                Tools.generate_json_files(oem, output_folder_pc, json_folder_pc, oem_json_folder_pc)
        elif platform == "manage":
            oem = "newmanage"
            inc_file = "20250306_newmanage_inc"
            print("inc_file:" + inc_file)
            if type == "excel":
               # 生成新管理端前端excel及增量
               Tools.generate_excel(oem, inc_file, output_folder_manage, json_folder_manage, oem_json_folder_manage)
            elif type == "json":
                # 生成新管理端前端json
                Tools.generate_json_files(oem, output_folder_manage, json_folder_manage, oem_json_folder_manage)
        elif platform == "service":
            # 新管理端后台多语言
            oem = "newmanage_service"
            inc_file = "20250306_newmanage_service_inc"
            print("inc_file:" + inc_file)
            if type == "excel":
               # 生成新管理端服务excel及增量
               Service_Tools.generate_excel(oem, inc_file, output_folder_manage_service, json_folder_manage_service, oem_json_folder_manage_service)
            elif type == "json":
                # 生成新管理端服务properties
                Service_Tools.generate_properties_files(oem, output_folder_manage_service, json_folder_manage_service, oem_json_folder_manage_service)
        else:
            print("输入错误，请重新输入...")
        
        print("==============================")

     
   