mm_os 2.8.2 → 2.8.3
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/package.json +1 -1
- package/demo/app/dev/README.md +0 -1
- package/demo/app/dev/app.js +0 -149
- package/demo/app/dev/app.json +0 -12
- package/demo/app/dev/event_api/client/event.json +0 -11
- package/demo/app/dev/event_api/client/main.js +0 -19
- package/demo/app/dev/event_api/manage/event.json +0 -19
- package/demo/app/dev/event_api/manage/main.js +0 -26
- package/demo/app/dev/plugin/doc/static/api_list.html +0 -144
- package/demo/app/dev/plugin/doc/static/api_view.html +0 -692
- package/demo/app/dev/plugin/doc/static/index.html +0 -138
- package/demo/app/dev/plugin/doc/static/request_test.html +0 -311
- package/demo/app/dev/plugin/main/api_dev_client/api/api.json +0 -11
- package/demo/app/dev/plugin/main/api_dev_client/api/index.js +0 -54
- package/demo/app/dev/plugin/main/api_dev_client/api/param.json +0 -31
- package/demo/app/dev/plugin/main/api_dev_client/app/api.json +0 -13
- package/demo/app/dev/plugin/main/api_dev_client/app/index.js +0 -13
- package/demo/app/dev/plugin/main/api_dev_client/app/param.json +0 -147
- package/demo/app/dev/plugin/main/api_dev_client/app/sql.json +0 -28
- package/demo/app/dev/plugin/main/api_dev_client/auto/api.json +0 -37
- package/demo/app/dev/plugin/main/api_dev_client/auto/auto_db.js +0 -70
- package/demo/app/dev/plugin/main/api_dev_client/auto/auto_file.js +0 -32
- package/demo/app/dev/plugin/main/api_dev_client/auto/index.js +0 -51
- package/demo/app/dev/plugin/main/api_dev_client/auto/param.json +0 -51
- package/demo/app/dev/plugin/main/api_dev_client/com.js +0 -349
- package/demo/app/dev/plugin/main/api_dev_client/db/api.json +0 -10
- package/demo/app/dev/plugin/main/api_dev_client/db/index.js +0 -71
- package/demo/app/dev/plugin/main/api_dev_client/db/param.json +0 -31
- package/demo/app/dev/plugin/main/api_dev_client/dict/api.json +0 -10
- package/demo/app/dev/plugin/main/api_dev_client/dict/index.js +0 -49
- package/demo/app/dev/plugin/main/api_dev_client/dict/param.json +0 -29
- package/demo/app/dev/plugin/main/api_dev_client/event/api.json +0 -10
- package/demo/app/dev/plugin/main/api_dev_client/event/index.js +0 -31
- package/demo/app/dev/plugin/main/api_dev_client/event/param.json +0 -31
- package/demo/app/dev/plugin/main/api_dev_client/help/api.json +0 -10
- package/demo/app/dev/plugin/main/api_dev_client/help/index.js +0 -14
- package/demo/app/dev/plugin/main/api_dev_client/help/param.json +0 -31
- package/demo/app/dev/plugin/main/api_dev_client/nav/api.json +0 -10
- package/demo/app/dev/plugin/main/api_dev_client/nav/index.js +0 -36
- package/demo/app/dev/plugin/main/api_dev_client/nav/param.json +0 -36
- package/demo/app/dev/plugin/main/api_dev_client/plugin/api.json +0 -10
- package/demo/app/dev/plugin/main/api_dev_client/plugin/index.js +0 -13
- package/demo/app/dev/plugin/main/api_dev_client/plugin/param.json +0 -31
- package/demo/app/dev/plugin/main/api_dev_client/source/api.json +0 -10
- package/demo/app/dev/plugin/main/api_dev_client/source/index.js +0 -14
- package/demo/app/dev/plugin/main/api_dev_client/source/param.json +0 -31
- package/demo/app/dev/plugin/main/api_dev_client/sql/api.json +0 -10
- package/demo/app/dev/plugin/main/api_dev_client/sql/index.js +0 -13
- package/demo/app/dev/plugin/main/api_dev_client/sql/param.json +0 -31
- package/demo/app/dev/plugin/main/api_dev_client/task/api.json +0 -16
- package/demo/app/dev/plugin/main/api_dev_client/task/index.js +0 -13
- package/demo/app/dev/plugin/main/api_dev_client/task/param.json +0 -31
- package/demo/app/dev/plugin/main/api_dev_client/translate/api.json +0 -39
- package/demo/app/dev/plugin/main/api_dev_client/translate/index.js +0 -43
- package/demo/app/dev/plugin/main/api_dev_client/translate/param.json +0 -130
- package/demo/app/dev/plugin/main/api_dev_client/translate/sql.json +0 -62
- package/demo/app/dev/plugin/main/api_dev_client/ui/api.json +0 -10
- package/demo/app/dev/plugin/main/api_dev_client/ui/index.js +0 -146
- package/demo/app/dev/plugin/main/api_dev_client/ui/param.json +0 -31
- package/demo/app/dev/plugin/main/api_dev_client/view/api.json +0 -10
- package/demo/app/dev/plugin/main/api_dev_client/view/index.js +0 -100
- package/demo/app/dev/plugin/main/api_dev_client/view/param.json +0 -29
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/block/nav.vue +0 -12
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/block/obj.vue +0 -12
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/block/post.vue +0 -12
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/block/query.vue +0 -12
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/edit.vue +0 -39
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/list.vue +0 -12
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/search.vue +0 -12
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/table.vue +0 -12
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/type.vue +0 -12
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/page/view.vue +0 -56
- package/demo/app/dev/plugin/main/api_dev_client/view/tpl/view.json +0 -48
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/api.json +0 -37
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/auto_db.js +0 -120
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/copy/copy.js +0 -101
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/copy/copy_framework.js +0 -118
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/copy/copy_template.js +0 -78
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/copy_file.js +0 -97
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/common.js +0 -198
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/django_server.js +0 -104
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/helper.js +0 -161
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/koa_art_server.js +0 -102
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/mini_app_home.js +0 -415
- 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 +0 -418
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/vue_cli_admin.js +0 -78
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create/vue_cli_home.js +0 -112
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/create_file.js +0 -97
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/db/add_data.js +0 -221
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/db/create_table.js +0 -162
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/db/set_auth_table.js +0 -86
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/index.js +0 -524
- package/demo/app/dev/plugin/main/api_dev_manage/auto_subject/param.json +0 -37
- package/demo/app/route/app.js +0 -131
- package/demo/app/route/app.json +0 -11
- package/demo/app/route/event_api/client/event.json +0 -10
- package/demo/app/route/event_api/client/main.js +0 -19
- package/demo/app/route/event_api/manage/event.json +0 -18
- package/demo/app/route/event_api/manage/main.js +0 -70
- package/demo/app/route/plugin/main/api_route_client/pass/api.json +0 -37
- package/demo/app/route/plugin/main/api_route_client/pass/index.js +0 -33
- package/demo/app/route/plugin/main/api_route_client/pass/param.json +0 -50
- package/demo/app/route/plugin/main/index.js +0 -144
- package/demo/app/route/plugin/main/plugin.json +0 -20
- package/demo/app/sys/app.js +0 -169
- package/demo/app/sys/app.json +0 -11
- package/demo/app/sys/event_api/api/before.js +0 -80
- package/demo/app/sys/event_api/api/check.js +0 -103
- package/demo/app/sys/event_api/api/event.json +0 -31
- package/demo/app/sys/event_api/api/main.js +0 -19
- package/demo/app/sys/event_api/apis/before.js +0 -80
- package/demo/app/sys/event_api/apis/event.json +0 -21
- package/demo/app/sys/event_api/apis/main.js +0 -19
- package/demo/app/sys/event_api/client/event.json +0 -10
- package/demo/app/sys/event_api/client/main.js +0 -17
- package/demo/app/sys/event_api/doc/event.json +0 -18
- package/demo/app/sys/event_api/doc/main.js +0 -67
- package/demo/app/sys/event_api/img/event.json +0 -11
- package/demo/app/sys/event_api/img/main.js +0 -90
- package/demo/app/sys/event_api/manage/event.json +0 -10
- package/demo/app/sys/event_api/manage/main.js +0 -19
- package/demo/app/sys/event_api/upload/event.json +0 -10
- package/demo/app/sys/event_api/upload/main.js +0 -17
- package/demo/app/sys/plugin/app_admin/index.js +0 -127
- package/demo/app/sys/plugin/app_admin/plugin.json +0 -20
- package/demo/app/sys/plugin/main/api_client/config/api.json +0 -39
- package/demo/app/sys/plugin/main/api_client/config/index.js +0 -37
- package/demo/app/sys/plugin/main/api_client/config/param.json +0 -27
- package/demo/app/sys/plugin/main/api_client/config/sql.json +0 -70
- package/demo/app/sys/plugin/main/api_client/lang/api.json +0 -37
- package/demo/app/sys/plugin/main/api_client/lang/index.js +0 -27
- package/demo/app/sys/plugin/main/api_client/lang/param.json +0 -22
- package/demo/app/sys/plugin/main/api_client/nav/api.json +0 -15
- package/demo/app/sys/plugin/main/api_client/nav/index.js +0 -39
- package/demo/app/sys/plugin/main/api_client/nav/param.json +0 -87
- package/demo/app/sys/plugin/main/api_client/query/api.json +0 -35
- package/demo/app/sys/plugin/main/api_client/query/index.js +0 -48
- package/demo/app/sys/plugin/main/api_client/theme/api.json +0 -37
- package/demo/app/sys/plugin/main/api_client/theme/index.js +0 -30
- package/demo/app/sys/plugin/main/api_client/theme/param.json +0 -31
- package/demo/app/sys/plugin/main/api_client/translate/api.json +0 -39
- package/demo/app/sys/plugin/main/api_client/translate/index.js +0 -21
- package/demo/app/sys/plugin/main/api_client/translate/param.json +0 -130
- package/demo/app/sys/plugin/main/api_client/translate/sql.json +0 -62
- package/demo/app/sys/plugin/main/api_upload/image/api.json +0 -15
- package/demo/app/sys/plugin/main/api_upload/image/index.js +0 -62
- package/demo/app/sys/plugin/main/api_upload/image/param.json +0 -9
- package/demo/app/sys/plugin/main/task/task_demo/index.js +0 -37
- package/demo/app/sys/plugin/main/task/task_demo/task.json +0 -24
- package/demo/app/sys/plugin/user/index.js +0 -127
- package/demo/app/sys/plugin/user/plugin.json +0 -20
- 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 +0 -148
- package/demo/app/user/app.json +0 -11
- package/demo/app/user/event_api/client/event.json +0 -10
- package/demo/app/user/event_api/client/main.js +0 -18
- package/demo/app/user/event_api/manage/event.json +0 -10
- package/demo/app/user/event_api/manage/main.js +0 -19
- package/demo/app/user/plugin/main/api_user_client/account/api.json +0 -39
- package/demo/app/user/plugin/main/api_user_client/account/index.js +0 -53
- package/demo/app/user/plugin/main/api_user_client/account/param.json +0 -130
- package/demo/app/user/plugin/main/api_user_client/base/api.json +0 -27
- package/demo/app/user/plugin/main/api_user_client/base/index.js +0 -84
- package/demo/app/user/plugin/main/api_user_client/base/param.json +0 -130
- package/demo/app/user/plugin/main/api_user_client/core/api.json +0 -20
- package/demo/app/user/plugin/main/api_user_client/core/forgot.js +0 -14
- package/demo/app/user/plugin/main/api_user_client/core/password.js +0 -14
- package/demo/app/user/plugin/main/api_user_client/core/sign_out.js +0 -26
- package/demo/app/user/plugin/main/api_user_client/core/state.js +0 -21
- package/demo/app/user/plugin/main/api_user_client/count/api.json +0 -27
- package/demo/app/user/plugin/main/api_user_client/count/chongzhi.js +0 -103
- package/demo/app/user/plugin/main/api_user_client/count/index.js +0 -40
- package/demo/app/user/plugin/main/api_user_client/count/param.json +0 -40
- package/demo/app/user/plugin/main/api_user_client/forgot/api.json +0 -37
- package/demo/app/user/plugin/main/api_user_client/forgot/index - /345/211/257/346/234/254.jsbat" +0 -41
- package/demo/app/user/plugin/main/api_user_client/forgot/index.js +0 -36
- package/demo/app/user/plugin/main/api_user_client/forgot/param.json +0 -56
- package/demo/app/user/plugin/main/api_user_client/oauth/WXBizDataCrypt.js +0 -33
- package/demo/app/user/plugin/main/api_user_client/oauth/api.json +0 -31
- package/demo/app/user/plugin/main/api_user_client/oauth/index.js +0 -16
- package/demo/app/user/plugin/main/api_user_client/oauth/oauth.js +0 -270
- package/demo/app/user/plugin/main/api_user_client/oauth/oauth.json +0 -88
- package/demo/app/user/plugin/main/api_user_client/oauth/param.json +0 -111
- package/demo/app/user/plugin/main/api_user_client/password/api.json +0 -21
- package/demo/app/user/plugin/main/api_user_client/password/index.js +0 -56
- package/demo/app/user/plugin/main/api_user_client/password/param.json +0 -44
- package/demo/app/user/plugin/main/api_user_client/phone_code/aliyun.js +0 -230
- package/demo/app/user/plugin/main/api_user_client/phone_code/api.json +0 -37
- package/demo/app/user/plugin/main/api_user_client/phone_code/index.js +0 -18
- package/demo/app/user/plugin/main/api_user_client/phone_code/index.js_ +0 -230
- package/demo/app/user/plugin/main/api_user_client/phone_code/param.json +0 -58
- package/demo/app/user/plugin/main/api_user_client/phone_code/phone_code.js +0 -278
- package/demo/app/user/plugin/main/api_user_client/realname/api.json +0 -21
- package/demo/app/user/plugin/main/api_user_client/realname/index.js +0 -48
- package/demo/app/user/plugin/main/api_user_client/realname/param.json +0 -74
- package/demo/app/user/plugin/main/api_user_client/servicer/api.json +0 -29
- package/demo/app/user/plugin/main/api_user_client/servicer/index.js +0 -19
- package/demo/app/user/plugin/main/api_user_client/servicer/param.json +0 -41
- package/demo/app/user/plugin/main/api_user_client/servicer/sql.json +0 -113
- package/demo/app/user/plugin/main/api_user_client/set_address/api.json +0 -37
- package/demo/app/user/plugin/main/api_user_client/set_address/index.js +0 -101
- package/demo/app/user/plugin/main/api_user_client/set_address/param.json +0 -165
- package/demo/app/user/plugin/main/api_user_client/set_avatar/api.json +0 -35
- package/demo/app/user/plugin/main/api_user_client/set_avatar/index.js +0 -77
- package/demo/app/user/plugin/main/api_user_client/set_info/api.json +0 -35
- package/demo/app/user/plugin/main/api_user_client/set_info/index.js +0 -47
- package/demo/app/user/plugin/main/api_user_client/set_nickname/api.json +0 -35
- package/demo/app/user/plugin/main/api_user_client/set_nickname/index.js +0 -49
- package/demo/app/user/plugin/main/api_user_client/set_pay_password/api.json +0 -21
- package/demo/app/user/plugin/main/api_user_client/set_pay_password/index.js +0 -67
- package/demo/app/user/plugin/main/api_user_client/sign_in/api.json +0 -11
- package/demo/app/user/plugin/main/api_user_client/sign_in/index.js +0 -275
- package/demo/app/user/plugin/main/api_user_client/sign_in/param.json +0 -125
- package/demo/app/user/plugin/main/api_user_client/sign_in/state.js +0 -37
- package/demo/app/user/plugin/main/api_user_client/sign_up/api.json +0 -12
- package/demo/app/user/plugin/main/api_user_client/sign_up/index.js +0 -110
- package/demo/app/user/plugin/main/api_user_client/sign_up/param.json +0 -65
- package/demo/app/user/plugin/main/api_user_client/sign_up_in/api.json +0 -37
- package/demo/app/user/plugin/main/api_user_client/sign_up_in/index.js +0 -110
- package/demo/app/user/plugin/main/api_user_client/sign_up_in/param.json +0 -34
- package/demo/app/user/plugin/main/api_user_client/token/api.json +0 -25
- package/demo/app/user/plugin/main/api_user_client/token/index.js +0 -20
- package/demo/app/user/plugin/main/api_user_client/token/param.json +0 -16
- package/demo/app/user/plugin/main/api_user_manage/account_base/api.json +0 -37
- package/demo/app/user/plugin/main/api_user_manage/account_base/index.js +0 -40
- package/demo/app/user/plugin/main/api_user_manage/account_base/param.json +0 -130
- package/demo/app/user/plugin/main/api_user_manage/invitation_code/api.json +0 -37
- package/demo/app/user/plugin/main/api_user_manage/invitation_code/index.js +0 -106
- package/demo/app/user/plugin/main/api_user_manage/invitation_code/param.json +0 -130
- package/demo/app/user/plugin/main/api_user_manage/update_team/api.json +0 -35
- package/demo/app/user/plugin/main/api_user_manage/update_team/index.js +0 -218
- package/demo/app/user/plugin/main/api_user_manage/update_team/param.json +0 -130
- package/demo/app/user/static/img/logo.png +0 -0
- package/demo/app/ws/app.js +0 -122
- package/demo/app/ws/app.json +0 -11
- package/demo/app/ws/event_api/client/event.json +0 -10
- package/demo/app/ws/event_api/client/main.js +0 -17
- package/demo/app/ws/socket/ws/index.js +0 -43
- package/demo/app/ws/socket/ws/socket.json +0 -14
- package/demo/config/development.json +0 -95
- package/demo/config/face.sql +0 -3824
- package/demo/config/local.json +0 -80
- package/demo/index.js +0 -19
|
@@ -1,104 +0,0 @@
|
|
|
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;
|
|
@@ -1,161 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,102 +0,0 @@
|
|
|
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;
|