@name 创建项目 @author lkq<2021-08-27> @param project_type 项目类型 1 内置 2 独立 3 Spring_boot 项目 @return string
(self, get)
| 2895 | return public.returnMsg(True, '开启外网映射成功') |
| 2896 | |
| 2897 | def create_project(self, get): |
| 2898 | ''' |
| 2899 | @name 创建项目 |
| 2900 | @author lkq<2021-08-27> |
| 2901 | @param project_type 项目类型 1 内置 2 独立 3 Spring_boot 项目 |
| 2902 | @return string |
| 2903 | ''' |
| 2904 | try: |
| 2905 | project_type = int(get.project_type) |
| 2906 | except: |
| 2907 | return public.returnMsg(False, '项目类型参数错误') |
| 2908 | if project_type == 1: |
| 2909 | # 检查Nginx/Apache 配置文件是否OK |
| 2910 | isError = public.checkWebConfig() |
| 2911 | if isError != True: |
| 2912 | return public.returnMsg( |
| 2913 | False, 'WEB服务器配置配置文件错误ERROR:<br><font style="color:red;">' + isError.replace( |
| 2914 | "\n", '<br>' |
| 2915 | ) + '</font>' |
| 2916 | ) |
| 2917 | return self.create_internal_project(get) |
| 2918 | elif project_type == 2: |
| 2919 | # 检查Nginx/Apache 配置文件是否OK |
| 2920 | isError = public.checkWebConfig() |
| 2921 | if isError != True: |
| 2922 | return public.returnMsg( |
| 2923 | False, 'WEB服务器配置配置文件错误ERROR:<br><font style="color:red;">' + isError.replace( |
| 2924 | "\n", '<br>' |
| 2925 | ) + '</font>' |
| 2926 | ) |
| 2927 | return self.create_independent_project(get) |
| 2928 | elif project_type == 3: |
| 2929 | return self.create_spring_boot_project(get) |
| 2930 | |
| 2931 | def create_internal_project(self, get): |
| 2932 | ''' |
nothing calls this directly
no test coverage detected