biz9-logic 4.5.6 → 4.5.8
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 +37 -32
- package/package.json +1 -1
- package/test.js +2 -1
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -19,7 +19,7 @@ class TemplateType {
|
|
|
19
19
|
static BODY='body';
|
|
20
20
|
static FOOTER='footer';
|
|
21
21
|
}
|
|
22
|
-
class Template_Logic{
|
|
22
|
+
class Template_Logic {
|
|
23
23
|
static get_test = () =>{
|
|
24
24
|
let template = DataItem.get_new_full_item(
|
|
25
25
|
DataItem.get_new(DataType.TEMPLATE,Number.get_id()),
|
|
@@ -34,7 +34,7 @@ class Template_Logic{
|
|
|
34
34
|
return template;
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
class Page_Logic{
|
|
37
|
+
class Page_Logic {
|
|
38
38
|
static get_test = (option) =>{
|
|
39
39
|
if(!option){
|
|
40
40
|
option = {item_count:9,page_count:9,get_value:false,get_item:false,value_count:20};
|
|
@@ -56,7 +56,7 @@ class Page_Logic{
|
|
|
56
56
|
return page;
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
class Product_Logic{
|
|
59
|
+
class Product_Logic {
|
|
60
60
|
static get_test = (option) =>{
|
|
61
61
|
if(!option){
|
|
62
62
|
option = {item_count:9,product_count:9,get_value:false,get_item:false,value_count:20};
|
|
@@ -118,7 +118,7 @@ class Product_Logic{
|
|
|
118
118
|
return [category_list,product_list]
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
|
-
class Service_Logic{
|
|
121
|
+
class Service_Logic {
|
|
122
122
|
static get_test = (option) =>{
|
|
123
123
|
if(!option){
|
|
124
124
|
option = {item_count:10,get_value:false,get_item:false,value_count:20};
|
|
@@ -184,7 +184,7 @@ class Service_Logic{
|
|
|
184
184
|
return [category_list,service_list]
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
|
-
class Event_Logic{
|
|
187
|
+
class Event_Logic {
|
|
188
188
|
static get_test = (option) =>{
|
|
189
189
|
if(!option){
|
|
190
190
|
option = {item_count:9,get_value:false,get_item:false,value_count:20};
|
|
@@ -253,7 +253,7 @@ class Event_Logic{
|
|
|
253
253
|
return [category_list,event_list]
|
|
254
254
|
};
|
|
255
255
|
}
|
|
256
|
-
class Field{
|
|
256
|
+
class Field {
|
|
257
257
|
static get_test = (title,option) =>{
|
|
258
258
|
if(!title){
|
|
259
259
|
title="";
|
|
@@ -376,10 +376,11 @@ class DataType {
|
|
|
376
376
|
static get_item_list = () =>{
|
|
377
377
|
return [
|
|
378
378
|
{ title:DataType.get_title(DataType.BLOG_POST),type:DataType.BLOG_POST},
|
|
379
|
-
{ title:DataType.get_title(DataType.SERVICE),type:DataType.SERVICE},
|
|
380
|
-
{ title:DataType.get_title(DataType.EVENT),type:DataType.EVENT},
|
|
381
379
|
{ title:DataType.get_title(DataType.GALLERY),type:DataType.GALLERY},
|
|
380
|
+
{ title:DataType.get_title(DataType.EVENT),type:DataType.EVENT},
|
|
381
|
+
{ title:DataType.get_title(DataType.TEAM),type:DataType.TEAM}
|
|
382
382
|
{ title:DataType.get_title(DataType.PRODUCT),type:DataType.PRODUCT}
|
|
383
|
+
{ title:DataType.get_title(DataType.SERVICE),type:DataType.SERVICE},
|
|
383
384
|
]
|
|
384
385
|
};
|
|
385
386
|
static ADMIN='admin_biz';
|
|
@@ -407,7 +408,7 @@ class DataType {
|
|
|
407
408
|
static USER='user_biz';
|
|
408
409
|
static VIDEO='video_biz';
|
|
409
410
|
}
|
|
410
|
-
class Blog_Post_Logic{
|
|
411
|
+
class Blog_Post_Logic {
|
|
411
412
|
static get_test = (option) =>{
|
|
412
413
|
if(!option){
|
|
413
414
|
option = {item_count:10,get_value:false,get_item:false,value_count:20};
|
|
@@ -469,7 +470,7 @@ class Blog_Post_Logic{
|
|
|
469
470
|
return [category_list,blog_post_list]
|
|
470
471
|
};
|
|
471
472
|
}
|
|
472
|
-
class Faq_Logic{
|
|
473
|
+
class Faq_Logic {
|
|
473
474
|
static get_test = () =>{
|
|
474
475
|
let faq = DataItem.get_new_full_item(
|
|
475
476
|
DataItem.get_new(DataType.FAQ,Number.get_id()),
|
|
@@ -491,7 +492,7 @@ class Faq_Logic{
|
|
|
491
492
|
return item_list;
|
|
492
493
|
};
|
|
493
494
|
}
|
|
494
|
-
class Review_Logic{
|
|
495
|
+
class Review_Logic {
|
|
495
496
|
static get_test = () =>{
|
|
496
497
|
let city_list = ["Miami","Atlanta","Chicago","Seattle","New York City"];
|
|
497
498
|
let state_list = ["Georgia","New York","Illinois","Washington","Flordia"];
|
|
@@ -602,33 +603,33 @@ class DataItem {
|
|
|
602
603
|
}
|
|
603
604
|
}
|
|
604
605
|
class BiZ_Url {
|
|
605
|
-
static get_item=(biz9_config,data_type,id)=>{
|
|
606
|
-
let action_url="main/biz_item/get/"+data_type+"/"+id
|
|
607
|
-
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,
|
|
606
|
+
static get_item = (biz9_config,data_type,id,params) => {
|
|
607
|
+
let action_url="main/biz_item/get/"+data_type+"/"+id;
|
|
608
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
608
609
|
};
|
|
609
|
-
static delete_item=(biz9_config,data_type,id)=>{
|
|
610
|
-
let action_url= "main/biz_item/delete/"+data_type+"/"+id
|
|
611
|
-
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,
|
|
610
|
+
static delete_item = (biz9_config,data_type,id,params) => {
|
|
611
|
+
let action_url= "main/biz_item/delete/"+data_type+"/"+id;
|
|
612
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
612
613
|
};
|
|
613
|
-
static get_full_item=(biz9_config,data_type,id)=>{
|
|
614
|
+
static get_full_item = (biz9_config,data_type,id,params) => {
|
|
614
615
|
let action_url= "main/biz_item/get_full/"+data_type+"/"+id;
|
|
615
|
-
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,
|
|
616
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
616
617
|
};
|
|
617
|
-
static get_page=(biz9_config,title_url)=>{
|
|
618
|
+
static get_page = (biz9_config,title_url,params) => {
|
|
618
619
|
let action_url= "main/biz_item/get_page/"+title_url;
|
|
619
|
-
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,
|
|
620
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
620
621
|
};
|
|
621
|
-
static get_template=(biz9_config,title_url)=>{
|
|
622
|
+
static get_template = (biz9_config,title_url,params) => {
|
|
622
623
|
let action_url= "main/biz_item/get_template/"+title_url;
|
|
623
|
-
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,
|
|
624
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
624
625
|
};
|
|
625
|
-
static get_custom_field=(biz9_config,data_type,id)=>{
|
|
626
|
+
static get_custom_field = (biz9_config,data_type,id,params) => {
|
|
626
627
|
let action_url="main/biz_item/get_custom_field/"+data_type+"/"+id;
|
|
627
|
-
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,
|
|
628
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
628
629
|
};
|
|
629
630
|
}
|
|
630
631
|
class Url{
|
|
631
|
-
static get = (biz9_config,action_url,params)=>{
|
|
632
|
+
static get = (biz9_config,action_url,params) => {
|
|
632
633
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
633
634
|
}
|
|
634
635
|
static connect = (biz9_config) => {
|
|
@@ -685,7 +686,7 @@ class Url{
|
|
|
685
686
|
};
|
|
686
687
|
}
|
|
687
688
|
class Obj {
|
|
688
|
-
static get_filter = (biz9_config,data_type,filter,sort_by,page_current,page_size)=>{
|
|
689
|
+
static get_filter = (biz9_config,data_type,filter,sort_by,page_current,page_size) => {
|
|
689
690
|
return get_cloud_filter_obj_main(data_type,filter,sort_by,page_current,page_size);
|
|
690
691
|
}
|
|
691
692
|
};
|
|
@@ -702,7 +703,7 @@ class Category_Logic {
|
|
|
702
703
|
category.type = Category_Logic.get_category_list()[Number.get_id(Category_Logic.get_category_list().length-1)].data_type;
|
|
703
704
|
return category;
|
|
704
705
|
}
|
|
705
|
-
static get_test_list=(option)=>{
|
|
706
|
+
static get_test_list = (option) => {
|
|
706
707
|
if(!option){
|
|
707
708
|
option={category_count:10};
|
|
708
709
|
}
|
|
@@ -712,7 +713,7 @@ class Category_Logic {
|
|
|
712
713
|
}
|
|
713
714
|
return item_list;
|
|
714
715
|
};
|
|
715
|
-
static get_type_category_list(type,count){
|
|
716
|
+
static get_type_category_list(type,count) {
|
|
716
717
|
let category_list = [];
|
|
717
718
|
for(let a=0;a<count;a++){
|
|
718
719
|
let category = DataItem.get_new_full_item(
|
|
@@ -741,6 +742,7 @@ class Category_Logic {
|
|
|
741
742
|
{data_type:DataType.SERVICE,value:DataType.SERVICE,label:"Services"},
|
|
742
743
|
{data_type:DataType.PRODUCT,value:DataType.PRODUCT,label:"Product"},
|
|
743
744
|
{data_type:DataType.TEMPLATE,value:DataType.TEMPLATE,label:"Template"}
|
|
745
|
+
{data_type:DataType.TEAM,value:DataType.TEAM,label:"Team"}
|
|
744
746
|
];
|
|
745
747
|
};
|
|
746
748
|
static get_title_by_type = (data_type) => {
|
|
@@ -772,6 +774,9 @@ class Category_Logic {
|
|
|
772
774
|
case DataType.TEMPLATE:
|
|
773
775
|
return "Template";
|
|
774
776
|
break;
|
|
777
|
+
case DataType.TEAM:
|
|
778
|
+
return "Team";
|
|
779
|
+
break;
|
|
775
780
|
case DataType.CONTENT:
|
|
776
781
|
return "Content";
|
|
777
782
|
break;
|
|
@@ -967,7 +972,7 @@ class Stock {
|
|
|
967
972
|
};
|
|
968
973
|
}
|
|
969
974
|
class Schedule {
|
|
970
|
-
static get_start_date_time = (item) =>{
|
|
975
|
+
static get_start_date_time = (item) => {
|
|
971
976
|
if(!item.date){
|
|
972
977
|
item.date = new Date();
|
|
973
978
|
}
|
|
@@ -979,7 +984,7 @@ class Schedule {
|
|
|
979
984
|
item.start_date_time = DateTime.get_full_date_time_by_date_time(item.date,item.time);
|
|
980
985
|
return item;
|
|
981
986
|
}
|
|
982
|
-
static get_start_date_time_by_list = (list) =>{
|
|
987
|
+
static get_start_date_time_by_list = (list) => {
|
|
983
988
|
for(let a=0;a<list.length;a++){
|
|
984
989
|
if(!list[a].date){
|
|
985
990
|
list[a].date = new Date();
|
|
@@ -1013,7 +1018,7 @@ class Storage {
|
|
|
1013
1018
|
window.localStorage.clear();
|
|
1014
1019
|
}
|
|
1015
1020
|
}
|
|
1016
|
-
class Sub_Item{
|
|
1021
|
+
class Sub_Item {
|
|
1017
1022
|
static get_bind_new_child = (id,title,item,parent_item,top_item,options) =>{
|
|
1018
1023
|
let new_sub_item = DataItem.get_new_full_item(
|
|
1019
1024
|
DataItem.get_new(DataType.ITEM,id),
|
package/package.json
CHANGED
package/test.js
CHANGED
|
@@ -34,7 +34,8 @@ describe("connect", () => {
|
|
|
34
34
|
//let action_url = 'test_get_url';
|
|
35
35
|
//let params = '&myparam1=p1&myparam2=p2'
|
|
36
36
|
let data_type = DataType.PRODUCT;
|
|
37
|
-
let
|
|
37
|
+
let id = "123";
|
|
38
|
+
let cloud_url = BiZ_Url.get_item(biz9_config,data_type,id,"&cool=1");
|
|
38
39
|
Log.w('connect_url',cloud_url);
|
|
39
40
|
console.log('GET-URL-SUCCESS');
|
|
40
41
|
//call()
|