mm_os 2.7.9 → 2.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/demo/app/dev/README.md +1 -0
- package/demo/app/dev/app.js +149 -0
- package/demo/app/dev/app.json +12 -0
- package/demo/app/dev/event_api/client/event.json +11 -0
- package/demo/app/dev/event_api/client/main.js +19 -0
- package/demo/app/dev/event_api/manage/event.json +19 -0
- package/demo/app/dev/event_api/manage/main.js +26 -0
- package/demo/app/dev/plugin/doc/static/api_list.html +144 -0
- package/demo/app/dev/plugin/doc/static/api_view.html +692 -0
- package/demo/app/dev/plugin/doc/static/index.html +138 -0
- package/demo/app/dev/plugin/doc/static/request_test.html +311 -0
- package/demo/app/dev/plugin/main/api_dev_client/api/api.json +11 -0
- package/demo/app/dev/plugin/main/api_dev_client/api/index.js +54 -0
- package/demo/app/dev/plugin/main/api_dev_client/api/param.json +31 -0
- package/demo/app/dev/plugin/main/api_dev_client/app/api.json +13 -0
- package/demo/app/dev/plugin/main/api_dev_client/app/index.js +13 -0
- package/demo/app/dev/plugin/main/api_dev_client/app/param.json +147 -0
- package/demo/app/dev/plugin/main/api_dev_client/app/sql.json +28 -0
- package/demo/app/dev/plugin/main/api_dev_client/auto/api.json +37 -0
- package/demo/app/dev/plugin/main/api_dev_client/auto/auto_db.js +70 -0
- package/demo/app/dev/plugin/main/api_dev_client/auto/auto_file.js +32 -0
- package/demo/app/dev/plugin/main/api_dev_client/auto/index.js +51 -0
- package/demo/app/dev/plugin/main/api_dev_client/auto/param.json +51 -0
- package/demo/app/dev/plugin/main/api_dev_client/com.js +349 -0
- package/demo/app/dev/plugin/main/api_dev_client/db/api.json +10 -0
- package/demo/app/dev/plugin/main/api_dev_client/db/index.js +71 -0
- package/demo/app/dev/plugin/main/api_dev_client/db/param.json +31 -0
- package/demo/app/dev/plugin/main/api_dev_client/dict/api.json +10 -0
- package/demo/app/dev/plugin/main/api_dev_client/dict/index.js +49 -0
- package/demo/app/dev/plugin/main/api_dev_client/dict/param.json +29 -0
- package/demo/app/dev/plugin/main/api_dev_client/event/api.json +10 -0
- package/demo/app/dev/plugin/main/api_dev_client/event/index.js +31 -0
- package/demo/app/dev/plugin/main/api_dev_client/event/param.json +31 -0
- package/demo/app/dev/plugin/main/api_dev_client/help/api.json +10 -0
- package/demo/app/dev/plugin/main/api_dev_client/help/index.js +14 -0
- package/demo/app/dev/plugin/main/api_dev_client/help/param.json +31 -0
- package/demo/app/dev/plugin/main/api_dev_client/nav/api.json +10 -0
- package/demo/app/dev/plugin/main/api_dev_client/nav/index.js +36 -0
- package/demo/app/dev/plugin/main/api_dev_client/nav/param.json +36 -0
- package/demo/app/dev/plugin/main/api_dev_client/plugin/api.json +10 -0
- package/demo/app/dev/plugin/main/api_dev_client/plugin/index.js +13 -0
- package/demo/app/dev/plugin/main/api_dev_client/plugin/param.json +31 -0
- package/demo/app/dev/plugin/main/api_dev_client/source/api.json +10 -0
- package/demo/app/dev/plugin/main/api_dev_client/source/index.js +14 -0
- package/demo/app/dev/plugin/main/api_dev_client/source/param.json +31 -0
- package/demo/app/dev/plugin/main/api_dev_client/sql/api.json +10 -0
- package/demo/app/dev/plugin/main/api_dev_client/sql/index.js +13 -0
- package/demo/app/dev/plugin/main/api_dev_client/sql/param.json +31 -0
- package/demo/app/dev/plugin/main/api_dev_client/task/api.json +16 -0
- package/demo/app/dev/plugin/main/api_dev_client/task/index.js +13 -0
- package/demo/app/dev/plugin/main/api_dev_client/task/param.json +31 -0
- package/demo/app/dev/plugin/main/api_dev_client/translate/api.json +39 -0
- package/demo/app/dev/plugin/main/api_dev_client/translate/index.js +43 -0
- package/demo/app/dev/plugin/main/api_dev_client/translate/param.json +130 -0
- package/demo/app/dev/plugin/main/api_dev_client/translate/sql.json +62 -0
- package/demo/app/dev/plugin/main/api_dev_client/ui/api.json +10 -0
- package/demo/app/dev/plugin/main/api_dev_client/ui/index.js +146 -0
- package/demo/app/dev/plugin/main/api_dev_client/ui/param.json +31 -0
- package/demo/app/dev/plugin/main/api_dev_client/view/api.json +10 -0
- package/demo/app/dev/plugin/main/api_dev_client/view/index.js +100 -0
- package/demo/app/dev/plugin/main/api_dev_client/view/param.json +29 -0
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/block/nav.vue +12 -0
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/block/obj.vue +12 -0
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/block/post.vue +12 -0
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/block/query.vue +12 -0
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/edit.vue +39 -0
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/list.vue +12 -0
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/search.vue +12 -0
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/table.vue +12 -0
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/type.vue +12 -0
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/view.vue +56 -0
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/view.json +48 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/api.json +37 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/auto_db.js +120 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/copy/copy.js +101 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/copy/copy_framework.js +118 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/copy/copy_template.js +78 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/copy_file.js +97 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/common.js +198 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/django_server.js +104 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/helper.js +161 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/koa_art_server.js +102 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/mini_app_home.js +415 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/razor.js +0 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/springboot.js +0 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/thinkphp.js +0 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/uni_app_home.js +418 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/vue_cli_admin.js +78 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/vue_cli_home.js +112 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create_file.js +97 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/db/add_data.js +221 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/db/create_table.js +162 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/db/set_auth_table.js +86 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/index.js +524 -0
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/param.json +37 -0
- package/demo/app/proxy/event_api/all/event.json +20 -0
- package/demo/app/proxy/event_api/all/main.js +50 -0
- package/demo/app/route/app.js +131 -0
- package/demo/app/route/app.json +11 -0
- package/demo/app/route/event_api/client/event.json +10 -0
- package/demo/app/route/event_api/client/main.js +19 -0
- package/demo/app/route/event_api/manage/event.json +18 -0
- package/demo/app/route/event_api/manage/main.js +70 -0
- package/demo/app/route/plugin/main/api_route_client/pass/api.json +37 -0
- package/demo/app/route/plugin/main/api_route_client/pass/index.js +33 -0
- package/demo/app/route/plugin/main/api_route_client/pass/param.json +50 -0
- package/demo/app/route/plugin/main/index.js +144 -0
- package/demo/app/route/plugin/main/plugin.json +20 -0
- package/demo/app/sys/app.js +169 -0
- package/demo/app/sys/app.json +11 -0
- package/demo/app/sys/event_api/api/before.js +80 -0
- package/demo/app/sys/event_api/api/check.js +103 -0
- package/demo/app/sys/event_api/api/event.json +31 -0
- package/demo/app/sys/event_api/api/main.js +19 -0
- package/demo/app/sys/event_api/apis/before.js +80 -0
- package/demo/app/sys/event_api/apis/event.json +21 -0
- package/demo/app/sys/event_api/apis/main.js +19 -0
- package/demo/app/sys/event_api/client/event.json +10 -0
- package/demo/app/sys/event_api/client/main.js +17 -0
- package/demo/app/sys/event_api/doc/event.json +18 -0
- package/demo/app/sys/event_api/doc/main.js +67 -0
- package/demo/app/sys/event_api/img/event.json +11 -0
- package/demo/app/sys/event_api/img/main.js +90 -0
- package/demo/app/sys/event_api/manage/event.json +10 -0
- package/demo/app/sys/event_api/manage/main.js +19 -0
- package/demo/app/sys/event_api/upload/event.json +10 -0
- package/demo/app/sys/event_api/upload/main.js +17 -0
- package/demo/app/sys/plugin/app_admin/index.js +127 -0
- package/demo/app/sys/plugin/app_admin/plugin.json +20 -0
- package/demo/app/sys/plugin/main/api_client/config/api.json +39 -0
- package/demo/app/sys/plugin/main/api_client/config/index.js +37 -0
- package/demo/app/sys/plugin/main/api_client/config/param.json +27 -0
- package/demo/app/sys/plugin/main/api_client/config/sql.json +70 -0
- package/demo/app/sys/plugin/main/api_client/lang/api.json +37 -0
- package/demo/app/sys/plugin/main/api_client/lang/index.js +27 -0
- package/demo/app/sys/plugin/main/api_client/lang/param.json +22 -0
- package/demo/app/sys/plugin/main/api_client/nav/api.json +15 -0
- package/demo/app/sys/plugin/main/api_client/nav/index.js +39 -0
- package/demo/app/sys/plugin/main/api_client/nav/param.json +87 -0
- package/demo/app/sys/plugin/main/api_client/query/api.json +35 -0
- package/demo/app/sys/plugin/main/api_client/query/index.js +48 -0
- package/demo/app/sys/plugin/main/api_client/theme/api.json +37 -0
- package/demo/app/sys/plugin/main/api_client/theme/index.js +30 -0
- package/demo/app/sys/plugin/main/api_client/theme/param.json +31 -0
- package/demo/app/sys/plugin/main/api_client/translate/api.json +39 -0
- package/demo/app/sys/plugin/main/api_client/translate/index.js +21 -0
- package/demo/app/sys/plugin/main/api_client/translate/param.json +130 -0
- package/demo/app/sys/plugin/main/api_client/translate/sql.json +62 -0
- package/demo/app/sys/plugin/main/api_upload/image/api.json +15 -0
- package/demo/app/sys/plugin/main/api_upload/image/index.js +62 -0
- package/demo/app/sys/plugin/main/api_upload/image/param.json +9 -0
- package/demo/app/sys/plugin/main/task/task_demo/index.js +37 -0
- package/demo/app/sys/plugin/main/task/task_demo/task.json +24 -0
- package/demo/app/sys/plugin/user/index.js +127 -0
- package/demo/app/sys/plugin/user/plugin.json +20 -0
- package/demo/app/sys/plugin/user/static/img/logo.png +0 -0
- package/demo/app/sys/static/img/avatar_1674484608066.png +0 -0
- package/demo/app/sys/static/img/avatar_1674633778171.jpeg +0 -0
- package/demo/app/sys/static/img/avatar_1674962702334.jpeg +0 -0
- package/demo/app/sys/static/img/avatar_1675075431736.jpeg +0 -0
- package/demo/app/sys/static/img/avatar_1675497065533.jpeg +0 -0
- package/demo/app/sys/static/img/avatar_1685352550990.jpeg +0 -0
- package/demo/app/sys/static/img/avatar_1685353685992.jpeg +0 -0
- package/demo/app/sys/static/img/avatar_1685353956587.jpeg +0 -0
- package/demo/app/sys/static/img/avatar_1685353971148.jpeg +0 -0
- package/demo/app/sys/static/img/avatar_1685353983723.jpeg +0 -0
- package/demo/app/sys/static/img/avatar_1685354014745.jpeg +0 -0
- package/demo/app/sys/static/img/avatar_1685354122355.jpeg +0 -0
- package/demo/app/sys/static/img/avatar_1685357983520.jpeg +0 -0
- package/demo/app/sys/static/img/avatar_1685358453383.jpeg +0 -0
- package/demo/app/sys/static/img/avatar_1685416570438.jpeg +0 -0
- package/demo/app/sys/static/img/avatar_1685512675830.png +0 -0
- package/demo/app/sys/static/img/avatar_1685939425608.jpeg +0 -0
- package/demo/app/sys/static/img/avatar_1685939886560.jpeg +0 -0
- package/demo/app/sys/static/img/avatar_1686106313194.png +0 -0
- package/demo/app/sys/static/img/avatar_1686371876175.png +0 -0
- package/demo/app/sys/static/img/avatar_1686372033596.png +0 -0
- package/demo/app/sys/static/img/avatar_1688215220669.png +0 -0
- package/demo/app/sys/static/img/avatar_1688531184690.png +0 -0
- package/demo/app/sys/static/img/avatar_1688531233080.png +0 -0
- package/demo/app/sys/static/img/avatar_1688548526909.png +0 -0
- package/demo/app/sys/static/img/avatar_1688549213411.png +0 -0
- package/demo/app/sys/static/img/avatar_1688549511977.png +0 -0
- package/demo/app/sys/static/img/avatar_1688549685464.png +0 -0
- package/demo/app/sys/static/img/avatar_1688608623049.png +0 -0
- package/demo/app/sys/static/img/avatar_1688638500476.png +0 -0
- package/demo/app/sys/static/img/avatar_1688638515195.png +0 -0
- package/demo/app/sys/static/img/avatar_1688638539928.png +0 -0
- package/demo/app/sys/static/img/avatar_1688638557960.png +0 -0
- package/demo/app/sys/static/img/avatar_1688638761798.png +0 -0
- package/demo/app/sys/static/img/avatar_1688638943140.png +0 -0
- package/demo/app/sys/static/img/avatar_1688639068330.png +0 -0
- package/demo/app/sys/static/img/image_1685357101273.jpeg +0 -0
- package/demo/app/sys/static/img/logo.png +0 -0
- package/demo/app/user/app.js +148 -0
- package/demo/app/user/app.json +11 -0
- package/demo/app/user/event_api/client/event.json +10 -0
- package/demo/app/user/event_api/client/main.js +18 -0
- package/demo/app/user/event_api/manage/event.json +10 -0
- package/demo/app/user/event_api/manage/main.js +19 -0
- package/demo/app/user/plugin/main/api_user_client/account/api.json +39 -0
- package/demo/app/user/plugin/main/api_user_client/account/index.js +53 -0
- package/demo/app/user/plugin/main/api_user_client/account/param.json +130 -0
- package/demo/app/user/plugin/main/api_user_client/base/api.json +27 -0
- package/demo/app/user/plugin/main/api_user_client/base/index.js +84 -0
- package/demo/app/user/plugin/main/api_user_client/base/param.json +130 -0
- package/demo/app/user/plugin/main/api_user_client/core/api.json +20 -0
- package/demo/app/user/plugin/main/api_user_client/core/forgot.js +14 -0
- package/demo/app/user/plugin/main/api_user_client/core/password.js +14 -0
- package/demo/app/user/plugin/main/api_user_client/core/sign_out.js +26 -0
- package/demo/app/user/plugin/main/api_user_client/core/state.js +21 -0
- package/demo/app/user/plugin/main/api_user_client/count/api.json +27 -0
- package/demo/app/user/plugin/main/api_user_client/count/chongzhi.js +103 -0
- package/demo/app/user/plugin/main/api_user_client/count/index.js +40 -0
- package/demo/app/user/plugin/main/api_user_client/count/param.json +40 -0
- package/demo/app/user/plugin/main/api_user_client/forgot/api.json +37 -0
- package/demo/app/user/plugin/main/api_user_client/forgot/index - /345/211/257/346/234/254.jsbat" +41 -0
- package/demo/app/user/plugin/main/api_user_client/forgot/index.js +36 -0
- package/demo/app/user/plugin/main/api_user_client/forgot/param.json +56 -0
- package/demo/app/user/plugin/main/api_user_client/oauth/WXBizDataCrypt.js +33 -0
- package/demo/app/user/plugin/main/api_user_client/oauth/api.json +31 -0
- package/demo/app/user/plugin/main/api_user_client/oauth/index.js +16 -0
- package/demo/app/user/plugin/main/api_user_client/oauth/oauth.js +270 -0
- package/demo/app/user/plugin/main/api_user_client/oauth/oauth.json +88 -0
- package/demo/app/user/plugin/main/api_user_client/oauth/param.json +111 -0
- package/demo/app/user/plugin/main/api_user_client/password/api.json +21 -0
- package/demo/app/user/plugin/main/api_user_client/password/index.js +56 -0
- package/demo/app/user/plugin/main/api_user_client/password/param.json +44 -0
- package/demo/app/user/plugin/main/api_user_client/phone_code/aliyun.js +230 -0
- package/demo/app/user/plugin/main/api_user_client/phone_code/api.json +37 -0
- package/demo/app/user/plugin/main/api_user_client/phone_code/index.js +18 -0
- package/demo/app/user/plugin/main/api_user_client/phone_code/index.js_ +230 -0
- package/demo/app/user/plugin/main/api_user_client/phone_code/param.json +58 -0
- package/demo/app/user/plugin/main/api_user_client/phone_code/phone_code.js +278 -0
- package/demo/app/user/plugin/main/api_user_client/realname/api.json +21 -0
- package/demo/app/user/plugin/main/api_user_client/realname/index.js +48 -0
- package/demo/app/user/plugin/main/api_user_client/realname/param.json +74 -0
- package/demo/app/user/plugin/main/api_user_client/servicer/api.json +29 -0
- package/demo/app/user/plugin/main/api_user_client/servicer/index.js +19 -0
- package/demo/app/user/plugin/main/api_user_client/servicer/param.json +41 -0
- package/demo/app/user/plugin/main/api_user_client/servicer/sql.json +113 -0
- package/demo/app/user/plugin/main/api_user_client/set_address/api.json +37 -0
- package/demo/app/user/plugin/main/api_user_client/set_address/index.js +101 -0
- package/demo/app/user/plugin/main/api_user_client/set_address/param.json +165 -0
- package/demo/app/user/plugin/main/api_user_client/set_avatar/api.json +35 -0
- package/demo/app/user/plugin/main/api_user_client/set_avatar/index.js +77 -0
- package/demo/app/user/plugin/main/api_user_client/set_info/api.json +35 -0
- package/demo/app/user/plugin/main/api_user_client/set_info/index.js +47 -0
- package/demo/app/user/plugin/main/api_user_client/set_nickname/api.json +35 -0
- package/demo/app/user/plugin/main/api_user_client/set_nickname/index.js +49 -0
- package/demo/app/user/plugin/main/api_user_client/set_pay_password/api.json +21 -0
- package/demo/app/user/plugin/main/api_user_client/set_pay_password/index.js +67 -0
- package/demo/app/user/plugin/main/api_user_client/sign_in/api.json +11 -0
- package/demo/app/user/plugin/main/api_user_client/sign_in/index.js +275 -0
- package/demo/app/user/plugin/main/api_user_client/sign_in/param.json +125 -0
- package/demo/app/user/plugin/main/api_user_client/sign_in/state.js +37 -0
- package/demo/app/user/plugin/main/api_user_client/sign_up/api.json +12 -0
- package/demo/app/user/plugin/main/api_user_client/sign_up/index.js +110 -0
- package/demo/app/user/plugin/main/api_user_client/sign_up/param.json +65 -0
- package/demo/app/user/plugin/main/api_user_client/sign_up_in/api.json +37 -0
- package/demo/app/user/plugin/main/api_user_client/sign_up_in/index.js +110 -0
- package/demo/app/user/plugin/main/api_user_client/sign_up_in/param.json +34 -0
- package/demo/app/user/plugin/main/api_user_client/token/api.json +25 -0
- package/demo/app/user/plugin/main/api_user_client/token/index.js +20 -0
- package/demo/app/user/plugin/main/api_user_client/token/param.json +16 -0
- package/demo/app/user/plugin/main/api_user_manage/account_base/api.json +37 -0
- package/demo/app/user/plugin/main/api_user_manage/account_base/index.js +40 -0
- package/demo/app/user/plugin/main/api_user_manage/account_base/param.json +130 -0
- package/demo/app/user/plugin/main/api_user_manage/invitation_code/api.json +37 -0
- package/demo/app/user/plugin/main/api_user_manage/invitation_code/index.js +106 -0
- package/demo/app/user/plugin/main/api_user_manage/invitation_code/param.json +130 -0
- package/demo/app/user/plugin/main/api_user_manage/update_team/api.json +35 -0
- package/demo/app/user/plugin/main/api_user_manage/update_team/index.js +218 -0
- package/demo/app/user/plugin/main/api_user_manage/update_team/param.json +130 -0
- package/demo/app/user/static/img/logo.png +0 -0
- package/demo/app/ws/app.js +122 -0
- package/demo/app/ws/app.json +11 -0
- package/demo/app/ws/event_api/client/event.json +10 -0
- package/demo/app/ws/event_api/client/main.js +17 -0
- package/demo/app/ws/socket/ws/index.js +43 -0
- package/demo/app/ws/socket/ws/socket.json +14 -0
- package/demo/config/development.json +95 -0
- package/demo/config/face.sql +3824 -0
- package/demo/config/local.json +80 -0
- package/demo/index.js +19 -0
- package/package.json +59 -58
- package/cache/test/main/config.json +0 -7
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
var tpl = new $.Tpl();
|
|
2
|
+
|
|
3
|
+
//
|
|
4
|
+
tpl.config.root = "";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @description 创建koa_art模板
|
|
8
|
+
* @param {Objact} model 模型
|
|
9
|
+
*/
|
|
10
|
+
async function create_django(model) {
|
|
11
|
+
$.log.info("***** 开始刷Django服务端 *****");
|
|
12
|
+
|
|
13
|
+
// 从 模型 中取出 订单 表集
|
|
14
|
+
var {
|
|
15
|
+
order,
|
|
16
|
+
tables
|
|
17
|
+
} = model;
|
|
18
|
+
|
|
19
|
+
// 取出订单号 注:用于保存
|
|
20
|
+
var order_number = order.order_number;
|
|
21
|
+
|
|
22
|
+
// 模板路径
|
|
23
|
+
var dir_server = "../template/django/server/app/";
|
|
24
|
+
|
|
25
|
+
// 存放路径
|
|
26
|
+
var dir_save = "../project/" + order_number + "/server/app/";
|
|
27
|
+
|
|
28
|
+
// 存放服务路径
|
|
29
|
+
var dir_service = dir_server + "services/service.py";
|
|
30
|
+
|
|
31
|
+
// 存放控制器路径
|
|
32
|
+
var dir_controller = dir_server + "views/controller.py";
|
|
33
|
+
|
|
34
|
+
// 循环表集
|
|
35
|
+
for (var i = 0; i < tables.length; i++) {
|
|
36
|
+
// 取出表
|
|
37
|
+
var table = tables[i];
|
|
38
|
+
|
|
39
|
+
// 取出表名和表标题
|
|
40
|
+
var {name, title, formula} = table;
|
|
41
|
+
|
|
42
|
+
// 判断是否存在
|
|
43
|
+
if (name && title) {
|
|
44
|
+
// 服务名
|
|
45
|
+
var cs = name.charAt(0).toUpperCase() + name.slice(1);
|
|
46
|
+
|
|
47
|
+
// 模型
|
|
48
|
+
var vm = {
|
|
49
|
+
table,
|
|
50
|
+
title,
|
|
51
|
+
name,
|
|
52
|
+
formula,
|
|
53
|
+
cs
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// 渲染服务
|
|
57
|
+
tpl_file(vm, dir_service, dir_save + "services/" + name + ".py");
|
|
58
|
+
|
|
59
|
+
// 渲染控制器
|
|
60
|
+
tpl_file(vm, dir_controller, dir_save + "views/" + name + ".py");
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// 渲染数据库绑定
|
|
65
|
+
tpl_file({
|
|
66
|
+
order_number
|
|
67
|
+
}, dir_server + "settings.py", dir_save + "settings.py");
|
|
68
|
+
|
|
69
|
+
$.log.info("***** 结束刷Django服务端 *****")
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @description 渲染模板
|
|
74
|
+
* @param {Object} model 数据模型
|
|
75
|
+
* @param {String} _from 模板路径
|
|
76
|
+
* @param {String} _to 存储路径
|
|
77
|
+
*/
|
|
78
|
+
function tpl_file(model, _from, _to) {
|
|
79
|
+
var ret = "";
|
|
80
|
+
// 渲染模板路径
|
|
81
|
+
_from = _from.fullname();
|
|
82
|
+
|
|
83
|
+
// 保存文件路径
|
|
84
|
+
_to = _to.fullname();
|
|
85
|
+
|
|
86
|
+
// 渲染模型
|
|
87
|
+
var html = tpl.view(_from, model);
|
|
88
|
+
|
|
89
|
+
// 结果判断
|
|
90
|
+
if (!html) {
|
|
91
|
+
console.error("模板渲染错误", _to, tpl.error);
|
|
92
|
+
return ret;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// 生成文件目录
|
|
96
|
+
_to.addDir();
|
|
97
|
+
|
|
98
|
+
// 生成页面
|
|
99
|
+
_to.saveText(html);
|
|
100
|
+
|
|
101
|
+
return _to;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
module.exports = create_django;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
var tpl = new $.Tpl();
|
|
3
|
+
|
|
4
|
+
//
|
|
5
|
+
tpl.config.root = "";
|
|
6
|
+
|
|
7
|
+
var filter_dir = ["page", "diy"];
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 渲染模板模型
|
|
11
|
+
* @param {Object} vm 数据模型
|
|
12
|
+
* @param {String} _from 复制来源
|
|
13
|
+
* @param {String} _to 粘贴位置
|
|
14
|
+
*/
|
|
15
|
+
function tpl_dir(vm, _from, _to) {
|
|
16
|
+
if (!isExist(_to)) {
|
|
17
|
+
// 创建目录
|
|
18
|
+
fs.mkdirSync(_to);
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
var paths = fs.readdirSync(_from);
|
|
22
|
+
paths.forEach((path) => {
|
|
23
|
+
// 过滤刷出内容
|
|
24
|
+
if (filter_dir.indexOf(path) === -1) {
|
|
25
|
+
var src = `${_from}/${path}`;
|
|
26
|
+
var dist = `${_to}/${path}`;
|
|
27
|
+
var stat = fs.statSync(src);
|
|
28
|
+
try {
|
|
29
|
+
if (stat.isFile()) {
|
|
30
|
+
tpl_file(vm, src, dist);
|
|
31
|
+
} else if (stat.isDirectory()) {
|
|
32
|
+
tpl_dir(vm, src, dist);
|
|
33
|
+
}
|
|
34
|
+
} catch (err) {
|
|
35
|
+
// 子级类型错误
|
|
36
|
+
console.error(err);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
} catch (err) {
|
|
41
|
+
// 识别子级错误
|
|
42
|
+
console.error(err);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @description 渲染模板
|
|
48
|
+
* @param {Object} model 数据模型
|
|
49
|
+
* @param {String} _from 模板路径
|
|
50
|
+
* @param {String} _to 存储路径
|
|
51
|
+
*/
|
|
52
|
+
function tpl_file(model, _from, _to) {
|
|
53
|
+
try{
|
|
54
|
+
var ret = "";
|
|
55
|
+
|
|
56
|
+
// 渲染模板路径
|
|
57
|
+
_from = _from.fullname();
|
|
58
|
+
|
|
59
|
+
// 保存文件路径
|
|
60
|
+
_to = _to.fullname();
|
|
61
|
+
|
|
62
|
+
// 渲染模型
|
|
63
|
+
var html = tpl.view(_from, model);
|
|
64
|
+
|
|
65
|
+
// 结果判断
|
|
66
|
+
if (!html) {
|
|
67
|
+
console.error("模板渲染错误", _to, tpl.error);
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// 生成文件目录
|
|
72
|
+
_to.addDir();
|
|
73
|
+
|
|
74
|
+
// 生成页面
|
|
75
|
+
_to.saveText(html);
|
|
76
|
+
|
|
77
|
+
return _to;
|
|
78
|
+
}catch(err){
|
|
79
|
+
console.error(err);
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* 判断是否存在
|
|
86
|
+
* @param {String} file
|
|
87
|
+
* @return {Promise}
|
|
88
|
+
*/
|
|
89
|
+
function isExist(path) {
|
|
90
|
+
var bl = false;
|
|
91
|
+
try {
|
|
92
|
+
fs.accessSync(path, fs.constants.R_OK | fs.constants.W_OK);
|
|
93
|
+
bl = true;
|
|
94
|
+
} catch (err) {
|
|
95
|
+
console.error(`${path} 不存在`);
|
|
96
|
+
}
|
|
97
|
+
return bl;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @description 获取需要渲染的部分
|
|
103
|
+
* @param {Array} fields 字段集
|
|
104
|
+
*/
|
|
105
|
+
function get_vm(fields) {
|
|
106
|
+
var vm = {};
|
|
107
|
+
// 循环 表 过滤 非 图片列表页内容 以及 存放到对应属性
|
|
108
|
+
for (var i = 0; i < fields.length; i++) {
|
|
109
|
+
var field = fields[i];
|
|
110
|
+
if (field) {
|
|
111
|
+
var type = field.type;
|
|
112
|
+
var name = field.name;
|
|
113
|
+
var title = field.title;
|
|
114
|
+
|
|
115
|
+
// 判断是否属性齐全
|
|
116
|
+
if (vm.img && vm.title && vm.name && vm.text && vm.price && vm.num) {
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// 判断是否未存放 图片 并且是 图片 属性
|
|
121
|
+
else if (!vm.img && type === "图片") {
|
|
122
|
+
// console.log("有获取");
|
|
123
|
+
vm.img = name;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// 判断是否未存放 标题 并且是 文本 属性 同时还是具有 `标题`或`名称` 关键词
|
|
127
|
+
else if (!vm.title && type === "文本" && (title.indexOf("标题") !== -1 || title.indexOf("名称") !== -1)) {
|
|
128
|
+
vm.title = name;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// 判断是否未存放 姓名 并且是 文本 属性 同时还是具有 `姓名` 关键词
|
|
132
|
+
else if (!vm.name && type === "文本" && title.indexOf("姓名") !== -1) {
|
|
133
|
+
vm.name = name;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// 判断是否未存放 文本 并且是 文本 属性 注:这是用于存放无法辨识文本
|
|
137
|
+
else if (!vm.text && type === "文本") {
|
|
138
|
+
vm.text = name;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// 判断是否未存放 价格 并且是 数字 属性 同时还是具有 `价格` 关键词
|
|
142
|
+
else if (!vm.price && type === "数字" && (title.indexOf("价格") !== -1 || title.indexOf("单价") !== -1 || title
|
|
143
|
+
.indexOf("现价") !== -1)) {
|
|
144
|
+
vm.price = name;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// 判断是否未存放 数字 并且是 数字 属性 注:这是用于存放无法辨识数字
|
|
148
|
+
else if (!vm.num && type === "数字") {
|
|
149
|
+
vm.num = name;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return vm;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
module.exports = {
|
|
157
|
+
tpl_dir,
|
|
158
|
+
tpl_file,
|
|
159
|
+
isExist,
|
|
160
|
+
get_vm
|
|
161
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
var tpl = new $.Tpl();
|
|
2
|
+
|
|
3
|
+
//
|
|
4
|
+
tpl.config.root = "";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @description 创建koa_art模板
|
|
8
|
+
* @param {Objact} model 模型
|
|
9
|
+
*/
|
|
10
|
+
async function koa_art_server(model) {
|
|
11
|
+
$.log.info("**** 开始刷Koa_art服务端 ****");
|
|
12
|
+
|
|
13
|
+
// 从 模型 中取出 订单 表集
|
|
14
|
+
var {
|
|
15
|
+
order,
|
|
16
|
+
tables
|
|
17
|
+
} = model;
|
|
18
|
+
|
|
19
|
+
// 取出订单号 注:用于保存
|
|
20
|
+
var order_number = order.order_number;
|
|
21
|
+
|
|
22
|
+
// 项目存放路径
|
|
23
|
+
var dir_save = "../project/" + order_number + "/";
|
|
24
|
+
|
|
25
|
+
// 服务器存放路径
|
|
26
|
+
var dir_server = "../template/koa_art/server/";
|
|
27
|
+
|
|
28
|
+
// 服务与控制器路径
|
|
29
|
+
var dir_controller = dir_server + "controllers/controller.js";
|
|
30
|
+
var dir_service = dir_server + "services/service.js";
|
|
31
|
+
|
|
32
|
+
// 循环表
|
|
33
|
+
for (var i = 0; i < tables.length; i++) {
|
|
34
|
+
// 取出表
|
|
35
|
+
var table = tables[i];
|
|
36
|
+
|
|
37
|
+
// 取出表名和表标题
|
|
38
|
+
var name = table.name;
|
|
39
|
+
var title = table.title;
|
|
40
|
+
|
|
41
|
+
// 判断是否存在
|
|
42
|
+
if(name && title){
|
|
43
|
+
// 服务名
|
|
44
|
+
var cs = name.charAt(0).toUpperCase() + name.slice(1);
|
|
45
|
+
|
|
46
|
+
// 模型
|
|
47
|
+
var vm = {
|
|
48
|
+
table,
|
|
49
|
+
title,
|
|
50
|
+
name,
|
|
51
|
+
cs
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// 渲染控制器
|
|
55
|
+
tpl_file(vm, dir_controller, dir_save + "controllers/" + name + ".js");
|
|
56
|
+
|
|
57
|
+
// 渲染服务
|
|
58
|
+
tpl_file(vm, dir_service, dir_save + "services/" + name + ".js");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// 渲染数据库绑定
|
|
63
|
+
tpl_file({
|
|
64
|
+
order_number
|
|
65
|
+
}, dir_server + "config.js", dir_save + "/config.js")
|
|
66
|
+
|
|
67
|
+
$.log.info("**** 结束刷Koa_art服务端 ****");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @description 渲染模板
|
|
72
|
+
* @param {Object} model 数据模型
|
|
73
|
+
* @param {String} _from 模板路径
|
|
74
|
+
* @param {String} _to 存储路径
|
|
75
|
+
*/
|
|
76
|
+
function tpl_file(model, _from, _to) {
|
|
77
|
+
var ret = "";
|
|
78
|
+
// 渲染模板路径
|
|
79
|
+
_from = _from.fullname();
|
|
80
|
+
|
|
81
|
+
// 保存文件路径
|
|
82
|
+
_to = _to.fullname();
|
|
83
|
+
|
|
84
|
+
// 渲染模型
|
|
85
|
+
var html = tpl.view(_from, model);
|
|
86
|
+
|
|
87
|
+
// 结果判断
|
|
88
|
+
if (!html) {
|
|
89
|
+
console.error("模板渲染错误", _to, tpl.error);
|
|
90
|
+
return ret;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// 生成文件目录
|
|
94
|
+
_to.addDir();
|
|
95
|
+
|
|
96
|
+
// 生成页面
|
|
97
|
+
_to.saveText(html);
|
|
98
|
+
|
|
99
|
+
return _to;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
module.exports = koa_art_server;
|