biz9-logic 4.9.12 → 4.9.16
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/biz9_config +1 -1
- package/index.js +51 -56
- package/package.json +1 -1
- package/test.js +6 -2
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -64,21 +64,23 @@ static get_test_list = (data_type,option) =>{
|
|
|
64
64
|
class Title {
|
|
65
65
|
//page
|
|
66
66
|
static PAGE_ABOUT='About';
|
|
67
|
-
static PAGE_BLOG_POST='Blog Post';
|
|
68
|
-
static PAGE_BLOG_POST_DETAIL='Blog Post Detail';
|
|
69
|
-
static PAGE_CATEGORY='Category';
|
|
70
67
|
static PAGE_CONTACT='Contact';
|
|
71
|
-
static PAGE_EVENT='Event';
|
|
72
|
-
static PAGE_EVENT_DETAIL='Event Detail';
|
|
73
|
-
static PAGE_FAQ='Faq';
|
|
74
|
-
static PAGE_GALLERY='Gallery';
|
|
75
|
-
static PAGE_GALLERY_DETAIL='Gallery Detail';
|
|
76
68
|
static PAGE_HOME='Home';
|
|
69
|
+
static PAGE_BLOG_POST='Blog Post';
|
|
70
|
+
static PAGE_BLOG_POST_HOME='Blog Post Home';
|
|
71
|
+
static PAGE_BLOG_POST_SEARCH='Blog Post Search';
|
|
77
72
|
static PAGE_PRODUCT='Product';
|
|
78
|
-
static
|
|
73
|
+
static PAGE_PRODUCT_HOME='Product Home';
|
|
74
|
+
static PAGE_PRODUCT_SEARCH='Product Search';
|
|
75
|
+
static PAGE_EVENT='Event';
|
|
76
|
+
static PAGE_EVENT_HOME='Event Home';
|
|
77
|
+
static PAGE_EVENT_SEARCH='Event Search';
|
|
78
|
+
static PAGE_GALLERY='Gallery';
|
|
79
|
+
static PAGE_GALLERY_HOME='Gallery Home';
|
|
80
|
+
static PAGE_GALLERY_SEARCH='Gallery Search';
|
|
79
81
|
static PAGE_SERVICE='Service';
|
|
80
|
-
static
|
|
81
|
-
|
|
82
|
+
static PAGE_SERVICE_HOME='Service Home';
|
|
83
|
+
static PAGE_SERVICE_SEARCH='Service Search';
|
|
82
84
|
//order
|
|
83
85
|
static ORDER_NUMBER="OR-";
|
|
84
86
|
static ORDER_TRANSACTION_ID="TR-";
|
|
@@ -173,20 +175,25 @@ class Demo_Logic {
|
|
|
173
175
|
class Type {
|
|
174
176
|
//page
|
|
175
177
|
static PAGE_ABOUT='about';
|
|
176
|
-
static PAGE_BLOG_POST='blog_post';
|
|
177
|
-
static PAGE_BLOG_POST_DETAIL='blog_post_detail';
|
|
178
178
|
static PAGE_CONTACT='contact';
|
|
179
|
-
static
|
|
180
|
-
static PAGE_EVENT='event';
|
|
181
|
-
static PAGE_EVENT_DETAIL='event_detail';
|
|
179
|
+
static PAGE_HOME='home';
|
|
182
180
|
static PAGE_FAQ='faq';
|
|
181
|
+
|
|
182
|
+
static PAGE_BLOG_POST='blog_post';
|
|
183
|
+
static PAGE_BLOG_POST_HOME='blog_post_home';
|
|
184
|
+
static PAGE_BLOG_POST_SEARCH='blog_post_search';
|
|
185
|
+
static PAGE_EVENT='event';
|
|
186
|
+
static PAGE_EVENT_HOME='event_home';
|
|
187
|
+
static PAGE_EVENT_SEARCH='event_search';
|
|
183
188
|
static PAGE_GALLERY='gallery';
|
|
184
|
-
static
|
|
185
|
-
static
|
|
189
|
+
static PAGE_GALLERY_HOME='gallery_home';
|
|
190
|
+
static PAGE_GALLERY_SEARCH='gallery_search';
|
|
186
191
|
static PAGE_PRODUCT='product';
|
|
187
|
-
static
|
|
192
|
+
static PAGE_PRODUCT_HOME='product_home';
|
|
193
|
+
static PAGE_PRODUCT_SEARCH='product_search';
|
|
188
194
|
static PAGE_SERVICE='service';
|
|
189
|
-
static
|
|
195
|
+
static PAGE_SERVICE_HOME='service_home';
|
|
196
|
+
static PAGE_SERVICE_SEARCH='service_search';
|
|
190
197
|
//stat
|
|
191
198
|
static STAT_VIEW='view_post';
|
|
192
199
|
static STAT_LOGIN='login_post';
|
|
@@ -202,31 +209,26 @@ class Type {
|
|
|
202
209
|
static TEMPLATE_NAVIGATION='navigation';
|
|
203
210
|
static TEMPLATE_BODY='body';
|
|
204
211
|
static TEMPLATE_FOOTER='footer';
|
|
205
|
-
|
|
206
212
|
//field_value
|
|
207
213
|
static FIELD_VALUE_TEXT="text";
|
|
208
214
|
static FIELD_VALUE_NOTE="note";
|
|
209
215
|
static FIELD_VALUE_IMAGE="image";
|
|
210
216
|
static FIELD_VALUE_LIST="list";
|
|
211
|
-
|
|
212
217
|
//role
|
|
213
218
|
static USER_ROLE_SUPER_ADMIN='super_admin';
|
|
214
219
|
static USER_ROLE_ADMIN='admin';
|
|
215
220
|
static USER_ROLE_MANAGER='manager';
|
|
216
221
|
static USER_ROLE_USER='user';
|
|
217
222
|
static USER_ROLE_GUEST='guest';
|
|
218
|
-
|
|
219
223
|
//data_source
|
|
220
224
|
static DATA_SOURCE_CACHE="cache";
|
|
221
225
|
static DATA_SOURCE_DATABASE="database";
|
|
222
226
|
static DATA_SOURCE_SERVER="server";
|
|
223
227
|
static DATA_SOURCE_NOT_FOUND="not_found";
|
|
224
|
-
|
|
225
228
|
//env
|
|
226
229
|
static ENV_TEST="test";
|
|
227
230
|
static ENV_STAGE="stage";
|
|
228
231
|
static ENV_PRODUCTION="production";
|
|
229
|
-
|
|
230
232
|
//size
|
|
231
233
|
static IMAGE_SIZE_THUMB="thumb";
|
|
232
234
|
static IMAGE_SIZE_MID="mid";
|
|
@@ -235,7 +237,6 @@ class Type {
|
|
|
235
237
|
static IMAGE_SIZE_SQUARE_THUMB="squre_thumb";
|
|
236
238
|
static IMAGE_SIZE_SQUARE_MID="squre_mid";
|
|
237
239
|
static IMAGE_SIZE_SQUARE_LARGE="squre_large";
|
|
238
|
-
|
|
239
240
|
//re_size
|
|
240
241
|
static IMAGE_RESIZE_NORMAL="normal";
|
|
241
242
|
static IMAGE_RESIZE_SQUARE="squre";
|
|
@@ -411,7 +412,11 @@ class Page_Logic {
|
|
|
411
412
|
static get_page_list(){
|
|
412
413
|
return [
|
|
413
414
|
{value:Type.PAGE_ABOUT,label:Title.PAGE_ABOUT},
|
|
415
|
+
|
|
414
416
|
{value:Type.PAGE_BLOG_POST,label:Title.PAGE_BLOG_POST},
|
|
417
|
+
{value:Type.PAGE_BLOG_POST_HOME,label:Title.PAGE_BLOG_POST_HOME},
|
|
418
|
+
{value:Type.PAGE_BLOG_POST_SEARCH,label:Title.PAGE_BLOG_POST_SEARCH},
|
|
419
|
+
|
|
415
420
|
{value:Type.PAGE_CONTACT,label:Title.PAGE_CONTACT},
|
|
416
421
|
{value:Type.PAGE_EVENT,label:Title.PAGE_EVENT},
|
|
417
422
|
{value:Type.PAGE_FAQ,label:Title.PAGE_FAQ},
|
|
@@ -456,7 +461,7 @@ class Order_Logic {
|
|
|
456
461
|
parent_data_type:cart.parent_data_type,
|
|
457
462
|
user_id:cart.user_id,
|
|
458
463
|
cart_number:cart.cart_number,
|
|
459
|
-
grand_total:
|
|
464
|
+
grand_total:0,
|
|
460
465
|
order_item_list:[]
|
|
461
466
|
});
|
|
462
467
|
cart.cart_item_list.forEach(cart_item => {
|
|
@@ -481,7 +486,6 @@ class Order_Logic {
|
|
|
481
486
|
order_item.order_sub_item_list.push(order_sub_item);
|
|
482
487
|
});
|
|
483
488
|
order.order_item_list.push(order_item);
|
|
484
|
-
|
|
485
489
|
});
|
|
486
490
|
order = Order_Logic.get_total(order);
|
|
487
491
|
return order;
|
|
@@ -1749,18 +1753,10 @@ class Image_Logic {
|
|
|
1749
1753
|
}
|
|
1750
1754
|
}
|
|
1751
1755
|
class Url {
|
|
1752
|
-
//blog_post
|
|
1753
|
-
static BLOG_POST_DETAIL="blog_post/detail";
|
|
1754
|
-
static BLOG_POST_HOME="blog_post/home";
|
|
1755
|
-
static BLOG_POST_SEARCH="blog_post/search";
|
|
1756
1756
|
//cart
|
|
1757
1757
|
static CART_DELETE="item/cart_delete";
|
|
1758
1758
|
static CART="item/cart";
|
|
1759
1759
|
static CART_POST="item/cart_post";
|
|
1760
|
-
//category
|
|
1761
|
-
static CATEGORY_DETAIL="category/detail";
|
|
1762
|
-
static CATEGORY_HOME="category/home";
|
|
1763
|
-
static CATEGORY_SEARCH="category/search";
|
|
1764
1760
|
//cms
|
|
1765
1761
|
static CMS_DEMO_POST="cms/demo_post";
|
|
1766
1762
|
static CMS_POST="cms/post";
|
|
@@ -1781,19 +1777,11 @@ class Url {
|
|
|
1781
1777
|
//dashboard
|
|
1782
1778
|
static DASHBOARD_USER_HOME="dashboard/user_home";
|
|
1783
1779
|
static DASHBOARD_APP_HOME="dashboard/app_home";
|
|
1784
|
-
//event
|
|
1785
|
-
static EVENT_DETAIL="event/detail";
|
|
1786
|
-
static EVENT_HOME="event/home";
|
|
1787
|
-
static EVENT_SEARCH="event/search";
|
|
1788
1780
|
//favorite
|
|
1789
1781
|
static FAVORITE_POST="item/favorite_post";
|
|
1790
1782
|
//field
|
|
1791
1783
|
static CUSTOM_FIELD="item/custom_field";
|
|
1792
1784
|
static FIELD_VALUE_POST="item/field_value_post";
|
|
1793
|
-
//gallery
|
|
1794
|
-
static GALLERY_DETAIL="gallery/detail";
|
|
1795
|
-
static GALLERY_HOME="gallery/home";
|
|
1796
|
-
static GALLERY_SEARCH="gallery/search";
|
|
1797
1785
|
//image
|
|
1798
1786
|
static IMAGE_POST="main/image/post";
|
|
1799
1787
|
static IMAGE_CDN_POST="main/image/cdn_post";
|
|
@@ -1802,21 +1790,28 @@ class Url {
|
|
|
1802
1790
|
static ORDER="item/order";
|
|
1803
1791
|
static ORDER_POST="item/order_post";
|
|
1804
1792
|
//page
|
|
1805
|
-
static
|
|
1806
|
-
static
|
|
1807
|
-
static
|
|
1808
|
-
static
|
|
1809
|
-
|
|
1810
|
-
static
|
|
1811
|
-
static
|
|
1812
|
-
static
|
|
1793
|
+
static PAGE_ABOUT="page/about";
|
|
1794
|
+
static PAGE_CONTACT="page/contact";
|
|
1795
|
+
static PAGE_HOME="page/home";
|
|
1796
|
+
static PAGE_FAQ="page/faq";
|
|
1797
|
+
static PAGE_BLOG_POST="page/blog_post";
|
|
1798
|
+
static PAGE_BLOG_POST_HOME="page/blog_post_home";
|
|
1799
|
+
static PAGE_BLOG_POST_SEARCH="page/blog_post_search";
|
|
1800
|
+
static PAGE_PRODUCT="page/product";
|
|
1801
|
+
static PAGE_PRODUCT_HOME="page/product_home";
|
|
1802
|
+
static PAGE_PRODUCT_SEARCH="page/product_search";
|
|
1803
|
+
static PAGE_EVENT="page/event";
|
|
1804
|
+
static PAGE_EVENT_HOME="page/event_home";
|
|
1805
|
+
static PAGE_EVENT_SEARCH="page/event_search";
|
|
1806
|
+
static PAGE_GALLERY="page/gallery";
|
|
1807
|
+
static PAGE_GALLERY_HOME="page/gallery_home";
|
|
1808
|
+
static PAGE_GALLERY_SEARCH="page/gallery_search";
|
|
1809
|
+
static PAGE_SERVICE="page/service";
|
|
1810
|
+
static PAGE_SERVICE_HOME="page/service_home";
|
|
1811
|
+
static PAGE_SERVICE_SEARCH="page/service_search";
|
|
1813
1812
|
//review
|
|
1814
1813
|
static REVIEW_POST="item/review_post";
|
|
1815
1814
|
static REVIEW_SEARCH="item/review_search";
|
|
1816
|
-
//service
|
|
1817
|
-
static SERVICE_DETAIL="service/detail";
|
|
1818
|
-
static SERVICE_HOME="service/home";
|
|
1819
|
-
static SERVICE_SEARCH="service/search";
|
|
1820
1815
|
//user
|
|
1821
1816
|
static USER_LOGIN="user/login";
|
|
1822
1817
|
static USER_LOGOUT="user/logout";
|
package/package.json
CHANGED
package/test.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const series = require('async-series');
|
|
2
2
|
const {DataItem,DataType,Page_Logic,Product_Logic,Type,Stat_Logic,Service_Logic,Blog_Post_Logic,Event_Logic,Demo_Logic,Cart_Logic} = require('./index');
|
|
3
|
-
const {Log,Num} = require('biz9-utility');
|
|
3
|
+
const {Log,Num,Str} = require('biz9-utility');
|
|
4
4
|
const {Scriptz}= require('biz9-scriptz');
|
|
5
5
|
|
|
6
6
|
/* --- TEST CONFIG START --- */
|
|
@@ -31,7 +31,10 @@ describe("connect", () => {
|
|
|
31
31
|
series([
|
|
32
32
|
function(call) {
|
|
33
33
|
console.log('CONNECT-START');
|
|
34
|
-
console.log(Cart_Logic.get_new(DataType.PRODUCT,123));
|
|
34
|
+
//console.log(Cart_Logic.get_new(DataType.PRODUCT,123));
|
|
35
|
+
//console.log(Type.get_title(Str.get_title(DataType.BLOG_POST)));
|
|
36
|
+
console.log(Type.get_title(DataType.BLOG_POST));
|
|
37
|
+
/*
|
|
35
38
|
|
|
36
39
|
let post_type_list = [
|
|
37
40
|
Demo_Logic.get_new_type('Computer 1',{
|
|
@@ -60,6 +63,7 @@ describe("connect", () => {
|
|
|
60
63
|
|
|
61
64
|
Log.w('post_type_list',post_type_list);
|
|
62
65
|
Log.w('post_type_list',post_type_list[0].categorys);
|
|
66
|
+
*/
|
|
63
67
|
//Log.w('post_item_count',post_item_count);
|
|
64
68
|
|
|
65
69
|
console.log('CONNECT-END');
|