biz9-logic 4.0.31 → 4.0.34

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.
Files changed (4) hide show
  1. package/biz9_config +1 -1
  2. package/index.js +85 -13
  3. package/package.json +1 -1
  4. package/test.js +19 -6
package/biz9_config CHANGED
@@ -1,4 +1,4 @@
1
- VERSION='4.3.1'
1
+ VERSION='4.3.4'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main';
package/index.js CHANGED
@@ -112,9 +112,9 @@ class Product{
112
112
  class Service{
113
113
  static get_test = (option) =>{
114
114
  if(!option){
115
- option = {item_count:9,service_count:9,get_value:false,get_item:false};
116
- }
117
- if(!option.item_count){
115
+ option = {item_count:10,get_value:false,get_item:false};
116
+ }
117
+ if(!option.item_count){
118
118
  option.item_count=10;
119
119
  }
120
120
  let service = DataItem.get_new_full_item(
@@ -147,11 +147,38 @@ class Service{
147
147
  }
148
148
  return item_list;
149
149
  };
150
+ static get_test_list_by_category = (option) =>{
151
+ let service_list = [];
152
+ let category_count = 9;
153
+ let service_count = 19;
154
+ if(!option){
155
+ option={};
156
+ }
157
+ else{
158
+ if(option.category_count){
159
+ category_count = parseInt(option.category_count);
160
+ }
161
+ if(option.category_count){
162
+ service_count = parseInt(option.service_count);
163
+ }
164
+ }
165
+ let category_list = Category.get_type_category_list(DataType.SERVICE,category_count);
166
+ let item_count = 0;
167
+ for(let a=0;a<category_list.length;a++){
168
+ for(let b=0;b<service_count;b++){
169
+ item_count++;
170
+ let service = Service.get_test({item_count:0,service_count:service_count,get_value:false,get_item:false});
171
+ service.category = category_list[Number.get_id(category_list.length-1)].title;
172
+ service_list.push(service);
173
+ }
174
+ }
175
+ return [category_list,service_list]
176
+ };
150
177
  }
151
178
  class Event{
152
179
  static get_test = (option) =>{
153
180
  if(!option){
154
- option = {item_count:9,event_count:9,get_value:false,get_item:false};
181
+ option = {item_count:9,get_value:false,get_item:false};
155
182
  }
156
183
  if(!option.item_count){
157
184
  option.item_count=10;
@@ -177,7 +204,7 @@ class Event{
177
204
  }
178
205
  event=Sub_Item.get_test_bind_item_sub_item(event);
179
206
  }
180
- return event;
207
+ return event;
181
208
  };
182
209
  static get_test_list=(option)=>{
183
210
  if(!option){
@@ -189,6 +216,33 @@ class Event{
189
216
  }
190
217
  return item_list;
191
218
  };
219
+ static get_test_list_by_category = (option) =>{
220
+ let event_list = [];
221
+ let category_count = 9;
222
+ let event_count = 19;
223
+ if(!option){
224
+ option={};
225
+ }
226
+ else{
227
+ if(option.category_count){
228
+ category_count = parseInt(option.category_count);
229
+ }
230
+ if(option.category_count){
231
+ event_count = parseInt(option.event_count);
232
+ }
233
+ }
234
+ let category_list = Category.get_type_category_list(DataType.EVENT,category_count);
235
+ let item_count = 0;
236
+ for(let a=0;a<category_list.length;a++){
237
+ for(let b=0;b<event_count;b++){
238
+ item_count++;
239
+ let event = Event.get_test({item_count:0,event_count:event_count,get_value:false,get_item:false});
240
+ event.category = category_list[Number.get_id(category_list.length-1)].title;
241
+ event_list.push(event);
242
+ }
243
+ }
244
+ return [category_list,event_list]
245
+ };
192
246
  }
193
247
  class Field{
194
248
  static get_test = (title,option) =>{
@@ -247,6 +301,7 @@ class Social {
247
301
  static TWITTER_URL="https://twitter.com/";
248
302
  static INSTAGRAM_URL="https://instagram.com/";
249
303
  static YOUTUBE_URL="https://youtube.com/";
304
+ static LINKEDIN_URL="https://linkedin.com/";
250
305
  }
251
306
  class PageType {
252
307
  static HOME='home';
@@ -341,7 +396,7 @@ class DataType {
341
396
  class Blog_Post{
342
397
  static get_test = (option) =>{
343
398
  if(!option){
344
- option = {item_count:9,blog_post_count:9,get_value:false,get_item:false};
399
+ option = {item_count:10,get_value:false,get_item:false};
345
400
  }
346
401
  if(!option.item_count){
347
402
  option.item_count=10;
@@ -362,15 +417,32 @@ class Blog_Post{
362
417
  }
363
418
  return blog_post;
364
419
  };
365
- static get_test_list=(option)=>{
420
+ static get_test_list_by_category = (option) =>{
421
+ let blog_post_list = [];
422
+ let category_count = 9;
423
+ let blog_post_count = 19;
366
424
  if(!option){
367
- option = {item_count:9,blog_post_count:9,get_value:false,get_item:false};
425
+ option={};
368
426
  }
369
- let item_list=[];
370
- for(let a=0;a<option.blog_post_count;a++){
371
- item_list.push(Blog_Post.get_test(option));
427
+ else{
428
+ if(option.category_count){
429
+ category_count = parseInt(option.category_count);
430
+ }
431
+ if(option.category_count){
432
+ blog_post_count = parseInt(option.blog_post_count);
433
+ }
372
434
  }
373
- return item_list;
435
+ let category_list = Category.get_type_category_list(DataType.BLOG_POST,category_count);
436
+ let item_count = 0;
437
+ for(let a=0;a<category_list.length;a++){
438
+ for(let b=0;b<blog_post_count;b++){
439
+ item_count++;
440
+ let blog_post = Blog_Post.get_test({item_count:0,blog_post_count:blog_post_count,get_value:false,get_item:false});
441
+ blog_post.category = category_list[Number.get_id(category_list.length-1)].title;
442
+ blog_post_list.push(blog_post);
443
+ }
444
+ }
445
+ return [category_list,blog_post_list]
374
446
  };
375
447
  }
376
448
  class Review{
@@ -584,7 +656,7 @@ class Category {
584
656
  DataItem.get_new(DataType.CATEGORY,"Category "+Number.get_id()),
585
657
  DataItem.get_new(DataType.CATEGORY,0),
586
658
  DataItem.get_new(DataType.CATEGORY,0),
587
- Field.get_test("Category " +Number.get_id()));
659
+ Field.get_test("Category " +Number.get_id(),{get_value:false}));
588
660
  category.type = type
589
661
  category_list.push(category);
590
662
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "4.0.31",
3
+ "version": "4.0.34",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/test.js CHANGED
@@ -49,6 +49,10 @@ describe("connect", () => {
49
49
  /* --PAGE--END */
50
50
 
51
51
  /* --BLOG_POST--START */
52
+ let [category_list,blog_post_list]=Blog_Post.get_test_list_by_category({category_count:5,blog_post_count:9});
53
+ Log.w('blog_post_list',blog_post_list);
54
+ //Log.w('category_list',category_list);
55
+
52
56
  //let blog_post = Blog_Post.get_test({item_count:9,blog_post_count:19,get_item:true,get_value:true})
53
57
  //let blog_post = Blog_Post.get_test()
54
58
  //let blog_post_list=Blog_Post.get_test_list({category_count:5,blog_post_count:9,get_value:true,get_item:true});
@@ -58,19 +62,28 @@ describe("connect", () => {
58
62
  //Log.w("BLog_Post_section_1_section_1_section_1",blog_post.section_1.section_1.section_1);
59
63
  /* --BLOG_POST--END */
60
64
 
61
-
62
65
  /* --PRODUCT--START */
63
66
  //let [category_list,product_list]=Product.get_test_list_by_category({category_count:5,product_count:9});
64
- let product = Product.get_test({item_count:9,product_count:19,get_item:true,get_value:true})
65
- //let product = Product.get_test()
66
67
  //Log.w('product_list',product_list);
67
68
  //Log.w('category_list',category_list);
68
- //Log.w("Product",product);
69
- Log.w("Product_section_1",product.section_1);
70
- Log.w("Product_section_1_section_1_section_1",product.section_1.section_1.section_1);
69
+
70
+ //let product = Product.get_test({item_count:9,product_count:19,get_item:true,get_value:true})
71
+ //let product = Product.get_test()
72
+ //Log.w("Product",product);
73
+ //Log.w("Product_section_1",product.section_1);
74
+ //Log.w("Product_section_1_section_1_section_1",product.section_1.section_1.section_1);
71
75
  /* --PRODUCT--END */
72
76
 
77
+ /* --EVENT--START */
78
+ //let [category_list,event_list]=Event.get_test_list_by_category({category_count:5,event_count:9});
79
+ //Log.w('event_list',event_list);
80
+ //Log.w('category_list',category_list);
81
+ /* --EVENT--END */
82
+
73
83
  /* --SERVICE--START */
84
+ //let [category_list,service_list]=Service.get_test_list_by_category({category_count:5,service_count:9});
85
+ //Log.w('service_list',service_list);
86
+ //Log.w('category_list',category_list);
74
87
  /*
75
88
  let service = Service.get_test({item_count:9,service_count:19,get_item:true,get_value:true})
76
89
  //let service = Service.get_test()