@gt6/sdk 1.0.23 → 1.0.25

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.
@@ -103,6 +103,12 @@ class ArticlesAPI {
103
103
  async getArticle(articleId) {
104
104
  return this.client.request(`/articles/${articleId}.json`);
105
105
  }
106
+ /**
107
+ * 1.1 根据文章ID获取文章详情(使用上级平台ID)
108
+ */
109
+ async getArticle_p(articleId) {
110
+ return this.client.request(`/parentarticles/${articleId}.json`);
111
+ }
106
112
  /**
107
113
  * 2. 获取文章分类列表
108
114
  */
@@ -112,6 +118,15 @@ class ArticlesAPI {
112
118
  const response = await this.client.request(`/article-categories/platform-${config.platformId}-root-${categoryId}.json`);
113
119
  return response.categories;
114
120
  }
121
+ /**
122
+ * 2.1 获取文章分类列表(使用下级平台ID)
123
+ */
124
+ async getCategories_p(rootCategoryId_p) {
125
+ const config = this.client.getConfig();
126
+ const categoryId = rootCategoryId_p || config.rootCategoryId_p || '671920';
127
+ const response = await this.client.request(`/article-categories/platform-${config.platformId_p}-root-${categoryId}.json`);
128
+ return response.categories;
129
+ }
115
130
  /**
116
131
  * 3. 获取文章标签列表
117
132
  */
@@ -121,6 +136,15 @@ class ArticlesAPI {
121
136
  const response = await this.client.request(`/article-tags/platform-${config.platformId}-${alias}.json`);
122
137
  return response.tags;
123
138
  }
139
+ /**
140
+ * 3.1 获取文章标签列表(使用下级平台ID)
141
+ */
142
+ async getTags_p(tagAlias_p) {
143
+ const config = this.client.getConfig();
144
+ const alias = tagAlias_p || config.tagAlias_p || '001';
145
+ const response = await this.client.request(`/article-tags/platform-${config.platformId_p}-${alias}.json`);
146
+ return response.tags;
147
+ }
124
148
  /**
125
149
  * 4. 根据分类ID获取文章列表
126
150
  * 支持单个分类ID或分类ID数组
@@ -167,6 +191,98 @@ class ArticlesAPI {
167
191
  limit
168
192
  };
169
193
  }
194
+ /**
195
+ * 4.1 根据分类ID获取文章列表
196
+ * 支持单个分类ID或分类ID数组
197
+ */
198
+ async getArticlesByCategory_p(categoryId, options) {
199
+ // 获取分类数据
200
+ const categories = await this.getCategories_p();
201
+ // 将单个分类ID转换为数组
202
+ const categoryIds = Array.isArray(categoryId) ? categoryId : [categoryId];
203
+ // 收集所有指定分类下的文章ID
204
+ const allArticleIds = [];
205
+ categoryIds.forEach(id => {
206
+ const targetCategory = categories.find(cat => cat.categoryId === id);
207
+ if (targetCategory) {
208
+ allArticleIds.push(...targetCategory.articleIds);
209
+ }
210
+ });
211
+ // 去重
212
+ const uniqueArticleIds = [...new Set(allArticleIds)];
213
+ if (uniqueArticleIds.length === 0) {
214
+ return {
215
+ articles: [],
216
+ total: 0,
217
+ page: options?.page || 1,
218
+ limit: options?.limit || 10
219
+ };
220
+ }
221
+ // 应用分页
222
+ const page = options?.page || 1;
223
+ const limit = options?.limit || 10;
224
+ const offset = (page - 1) * limit;
225
+ const paginatedArticleIds = uniqueArticleIds.slice(offset, offset + limit);
226
+ // 获取文章详情
227
+ const articles = await Promise.all(paginatedArticleIds.map(articleId => this.getArticle_p(articleId)));
228
+ // 应用状态过滤
229
+ let filteredArticles = articles;
230
+ if (options?.status) {
231
+ filteredArticles = articles.filter(article => article.status === options.status);
232
+ }
233
+ return {
234
+ articles: filteredArticles,
235
+ total: uniqueArticleIds.length,
236
+ page,
237
+ limit
238
+ };
239
+ }
240
+ /**
241
+ * 4.2 根据分类ID获取文章列表
242
+ * 支持单个分类ID或分类ID数组
243
+ */
244
+ async getArticlesByCategory_t(categoryId, options) {
245
+ // 获取分类数据
246
+ const categories = await this.getCategories();
247
+ // 将单个分类ID转换为数组
248
+ const categoryIds = Array.isArray(categoryId) ? categoryId : [categoryId];
249
+ // 收集所有指定分类下的文章ID
250
+ const allArticleIds = [];
251
+ categoryIds.forEach(id => {
252
+ const targetCategory = categories.find(cat => cat.categoryId === id);
253
+ if (targetCategory) {
254
+ allArticleIds.push(...targetCategory.articleIds);
255
+ }
256
+ });
257
+ // 去重
258
+ const uniqueArticleIds = [...new Set(allArticleIds)];
259
+ if (uniqueArticleIds.length === 0) {
260
+ return {
261
+ articles: [],
262
+ total: 0,
263
+ page: options?.page || 1,
264
+ limit: options?.limit || 10
265
+ };
266
+ }
267
+ // 应用分页
268
+ const page = options?.page || 1;
269
+ const limit = options?.limit || 10;
270
+ const offset = (page - 1) * limit;
271
+ const paginatedArticleIds = uniqueArticleIds.slice(offset, offset + limit);
272
+ // 获取文章详情
273
+ const articles = await Promise.all(paginatedArticleIds.map(articleId => this.getArticle_p(articleId)));
274
+ // 应用状态过滤
275
+ let filteredArticles = articles;
276
+ if (options?.status) {
277
+ filteredArticles = articles.filter(article => article.status === options.status);
278
+ }
279
+ return {
280
+ articles: filteredArticles,
281
+ total: uniqueArticleIds.length,
282
+ page,
283
+ limit
284
+ };
285
+ }
170
286
  /**
171
287
  * 5. 根据标签ID获取文章列表
172
288
  * 支持单个标签ID或标签ID数组
@@ -213,6 +329,98 @@ class ArticlesAPI {
213
329
  limit
214
330
  };
215
331
  }
332
+ /**
333
+ * 5.1 根据标签ID获取文章列表
334
+ * 支持单个标签ID或标签ID数组
335
+ */
336
+ async getArticlesByTag_p(tagId, options) {
337
+ // 获取标签数据,传递tagAlias参数
338
+ const tags = await this.getTags_p(options?.tagAlias);
339
+ // 将单个标签ID转换为数组
340
+ const tagIds = Array.isArray(tagId) ? tagId : [tagId];
341
+ // 收集所有指定标签下的文章ID
342
+ const allArticleIds = [];
343
+ tagIds.forEach(id => {
344
+ const targetTag = tags.find(tag => tag.tagId === id);
345
+ if (targetTag) {
346
+ allArticleIds.push(...targetTag.articleIds);
347
+ }
348
+ });
349
+ // 去重
350
+ const uniqueArticleIds = [...new Set(allArticleIds)];
351
+ if (uniqueArticleIds.length === 0) {
352
+ return {
353
+ articles: [],
354
+ total: 0,
355
+ page: options?.page || 1,
356
+ limit: options?.limit || 10
357
+ };
358
+ }
359
+ // 应用分页
360
+ const page = options?.page || 1;
361
+ const limit = options?.limit || 10;
362
+ const offset = (page - 1) * limit;
363
+ const paginatedArticleIds = uniqueArticleIds.slice(offset, offset + limit);
364
+ // 获取文章详情
365
+ const articles = await Promise.all(paginatedArticleIds.map(articleId => this.getArticle_p(articleId)));
366
+ // 应用状态过滤
367
+ let filteredArticles = articles;
368
+ if (options?.status) {
369
+ filteredArticles = articles.filter(article => article.status === options.status);
370
+ }
371
+ return {
372
+ articles: filteredArticles,
373
+ total: uniqueArticleIds.length,
374
+ page,
375
+ limit
376
+ };
377
+ }
378
+ /**
379
+ * 5.2 根据标签ID获取文章列表
380
+ * 支持单个标签ID或标签ID数组
381
+ */
382
+ async getArticlesByTag_t(tagId, options) {
383
+ // 获取标签数据,传递tagAlias参数
384
+ const tags = await this.getTags(options?.tagAlias);
385
+ // 将单个标签ID转换为数组
386
+ const tagIds = Array.isArray(tagId) ? tagId : [tagId];
387
+ // 收集所有指定标签下的文章ID
388
+ const allArticleIds = [];
389
+ tagIds.forEach(id => {
390
+ const targetTag = tags.find(tag => tag.tagId === id);
391
+ if (targetTag) {
392
+ allArticleIds.push(...targetTag.articleIds);
393
+ }
394
+ });
395
+ // 去重
396
+ const uniqueArticleIds = [...new Set(allArticleIds)];
397
+ if (uniqueArticleIds.length === 0) {
398
+ return {
399
+ articles: [],
400
+ total: 0,
401
+ page: options?.page || 1,
402
+ limit: options?.limit || 10
403
+ };
404
+ }
405
+ // 应用分页
406
+ const page = options?.page || 1;
407
+ const limit = options?.limit || 10;
408
+ const offset = (page - 1) * limit;
409
+ const paginatedArticleIds = uniqueArticleIds.slice(offset, offset + limit);
410
+ // 获取文章详情
411
+ const articles = await Promise.all(paginatedArticleIds.map(articleId => this.getArticle_p(articleId)));
412
+ // 应用状态过滤
413
+ let filteredArticles = articles;
414
+ if (options?.status) {
415
+ filteredArticles = articles.filter(article => article.status === options.status);
416
+ }
417
+ return {
418
+ articles: filteredArticles,
419
+ total: uniqueArticleIds.length,
420
+ page,
421
+ limit
422
+ };
423
+ }
216
424
  /**
217
425
  * 6. 根据分类ID获取该分类的层级路径
218
426
  * 用于前端面包屑导航
@@ -372,6 +580,65 @@ class ProductsAPI {
372
580
  }
373
581
  return product;
374
582
  }
583
+ /**
584
+ * 1.1. 根据产品ID获取父平台产品详情
585
+ */
586
+ async getProduct_p(productId) {
587
+ const product = await this.client.request(`/parentproducts/${productId}.json`);
588
+ // 检查产品是否有销售区域和税费模板
589
+ if (product.regions && product.regions.length > 0 &&
590
+ product.taxTemplates && product.taxTemplates.length > 0) {
591
+ try {
592
+ // 获取税费信息
593
+ const taxInfo = await this.getTaxInfo();
594
+ // 为每个税费模板添加规则
595
+ product.taxTemplates = product.taxTemplates.map(template => {
596
+ const matchingTemplate = taxInfo.templates.find(t => t.templateId === template.templateId);
597
+ if (matchingTemplate) {
598
+ // 过滤出产品可销售区域的规则
599
+ const productRegionIds = product.regions.map(r => r.regionId);
600
+ const applicableRules = matchingTemplate.rules.filter(rule => productRegionIds.includes(rule.regionId));
601
+ return {
602
+ ...template,
603
+ rules: applicableRules
604
+ };
605
+ }
606
+ return template;
607
+ });
608
+ }
609
+ catch (error) {
610
+ // 如果获取税费信息失败,不影响产品详情返回
611
+ console.warn('Failed to fetch tax info:', error);
612
+ }
613
+ }
614
+ // 检查产品是否有销售区域和运费模板
615
+ if (product.regions && product.regions.length > 0 &&
616
+ product.shippingTemplates && product.shippingTemplates.length > 0) {
617
+ try {
618
+ // 获取运费信息
619
+ const shippingInfo = await this.getShippingInfo();
620
+ // 为每个运费模板添加规则
621
+ product.shippingTemplates = product.shippingTemplates.map(template => {
622
+ const matchingTemplate = shippingInfo.templates.find(t => t.templateId === template.templateId);
623
+ if (matchingTemplate) {
624
+ // 过滤出产品可销售区域的规则
625
+ const productRegionIds = product.regions.map(r => r.regionId);
626
+ const applicableRules = matchingTemplate.rules.filter(rule => productRegionIds.includes(rule.regionId));
627
+ return {
628
+ ...template,
629
+ rules: applicableRules
630
+ };
631
+ }
632
+ return template;
633
+ });
634
+ }
635
+ catch (error) {
636
+ // 如果获取运费信息失败,不影响产品详情返回
637
+ console.warn('Failed to fetch shipping info:', error);
638
+ }
639
+ }
640
+ return product;
641
+ }
375
642
  /**
376
643
  * 2. 获取产品分类列表
377
644
  */
@@ -381,6 +648,15 @@ class ProductsAPI {
381
648
  const response = await this.client.request(`/product-categories/platform-${config.platformId}-root-${categoryId}.json`);
382
649
  return response.categories;
383
650
  }
651
+ /**
652
+ * 2.1. 获取平台产品分类列表
653
+ */
654
+ async getCategories_p(productRootCategoryId_p) {
655
+ const config = this.client.getConfig();
656
+ const categoryId = productRootCategoryId_p || config.productRootCategoryId_p;
657
+ const response = await this.client.request(`/product-categories/platform-${config.platformId_p}-root-${categoryId}.json`);
658
+ return response.categories;
659
+ }
384
660
  /**
385
661
  * 3. 获取产品标签列表
386
662
  */
@@ -390,6 +666,15 @@ class ProductsAPI {
390
666
  const response = await this.client.request(`/product-tags/platform-${config.platformId}-${alias}.json`);
391
667
  return response.tags;
392
668
  }
669
+ /**
670
+ * 3.1. 获取平台产品标签列表
671
+ */
672
+ async getTags_p(productTagAlias_p) {
673
+ const config = this.client.getConfig();
674
+ const alias = productTagAlias_p || config.productTagAlias_p;
675
+ const response = await this.client.request(`/product-tags/platform-${config.platformId_p}-${alias}.json`);
676
+ return response.tags;
677
+ }
393
678
  /**
394
679
  * 4. 根据分类ID获取产品列表
395
680
  * 支持单个分类ID或分类ID数组
@@ -450,6 +735,124 @@ class ProductsAPI {
450
735
  limit
451
736
  };
452
737
  }
738
+ /**
739
+ * 4.1. 根据分类ID获取平台产品列表
740
+ */
741
+ async getProductsByCategory_p(categoryId, options) {
742
+ // 获取分类数据
743
+ const categories = await this.getCategories_p();
744
+ // 递归查找分类的函数
745
+ const findCategoryById = (cats, targetId) => {
746
+ for (const cat of cats) {
747
+ if (cat.categoryId === targetId) {
748
+ return cat;
749
+ }
750
+ if (cat.children && cat.children.length > 0) {
751
+ const found = findCategoryById(cat.children, targetId);
752
+ if (found)
753
+ return found;
754
+ }
755
+ }
756
+ return null;
757
+ };
758
+ // 将单个分类ID转换为数组
759
+ const categoryIds = Array.isArray(categoryId) ? categoryId : [categoryId];
760
+ // 收集所有指定分类下的产品ID
761
+ const allProductIds = [];
762
+ categoryIds.forEach(id => {
763
+ const targetCategory = findCategoryById(categories, id);
764
+ if (targetCategory) {
765
+ allProductIds.push(...targetCategory.productIds);
766
+ }
767
+ });
768
+ // 去重
769
+ const uniqueProductIds = [...new Set(allProductIds)];
770
+ if (uniqueProductIds.length === 0) {
771
+ return {
772
+ products: [],
773
+ total: 0,
774
+ page: options?.page || 1,
775
+ limit: options?.limit || 10
776
+ };
777
+ }
778
+ // 应用分页
779
+ const page = options?.page || 1;
780
+ const limit = options?.limit || 10;
781
+ const offset = (page - 1) * limit;
782
+ const paginatedProductIds = uniqueProductIds.slice(offset, offset + limit);
783
+ // 获取产品详情
784
+ const products = await Promise.all(paginatedProductIds.map(productId => this.getProduct_p(productId)));
785
+ // 应用状态过滤
786
+ let filteredProducts = products;
787
+ if (options?.status !== undefined) {
788
+ filteredProducts = products.filter(product => product.status === options.status);
789
+ }
790
+ return {
791
+ products: filteredProducts,
792
+ total: uniqueProductIds.length,
793
+ page,
794
+ limit
795
+ };
796
+ }
797
+ /**
798
+ * 4.2. 根据分类ID获取平台产品列表
799
+ */
800
+ async getProductsByCategory_t(categoryId, options) {
801
+ // 获取分类数据
802
+ const categories = await this.getCategories();
803
+ // 递归查找分类的函数
804
+ const findCategoryById = (cats, targetId) => {
805
+ for (const cat of cats) {
806
+ if (cat.categoryId === targetId) {
807
+ return cat;
808
+ }
809
+ if (cat.children && cat.children.length > 0) {
810
+ const found = findCategoryById(cat.children, targetId);
811
+ if (found)
812
+ return found;
813
+ }
814
+ }
815
+ return null;
816
+ };
817
+ // 将单个分类ID转换为数组
818
+ const categoryIds = Array.isArray(categoryId) ? categoryId : [categoryId];
819
+ // 收集所有指定分类下的产品ID
820
+ const allProductIds = [];
821
+ categoryIds.forEach(id => {
822
+ const targetCategory = findCategoryById(categories, id);
823
+ if (targetCategory) {
824
+ allProductIds.push(...targetCategory.productIds);
825
+ }
826
+ });
827
+ // 去重
828
+ const uniqueProductIds = [...new Set(allProductIds)];
829
+ if (uniqueProductIds.length === 0) {
830
+ return {
831
+ products: [],
832
+ total: 0,
833
+ page: options?.page || 1,
834
+ limit: options?.limit || 10
835
+ };
836
+ }
837
+ // 应用分页
838
+ const page = options?.page || 1;
839
+ const limit = options?.limit || 10;
840
+ const offset = (page - 1) * limit;
841
+ const paginatedProductIds = uniqueProductIds.slice(offset, offset + limit);
842
+ // 获取产品详情
843
+ const products = await Promise.all(paginatedProductIds.map(productId => this.getProduct_p(productId)));
844
+ // 应用状态过滤
845
+ let filteredProducts = products;
846
+ if (options?.status !== undefined) {
847
+ filteredProducts = products.filter(product => product.status === options.status);
848
+ }
849
+ return {
850
+ products: filteredProducts,
851
+ total: uniqueProductIds.length,
852
+ page,
853
+ limit
854
+ };
855
+ }
453
856
  /**
454
857
  * 5. 根据标签ID获取产品列表
455
858
  * 支持单个标签ID或标签ID数组
@@ -496,6 +899,96 @@ class ProductsAPI {
496
899
  limit
497
900
  };
498
901
  }
902
+ /**
903
+ * 5.1. 根据标签ID获取平台产品列表
904
+ */
905
+ async getProductsByTag_p(tagId, options) {
906
+ // 获取标签数据,传递productTagAlias参数
907
+ const tags = await this.getTags_p(options?.productTagAlias);
908
+ // 将单个标签ID转换为数组
909
+ const tagIds = Array.isArray(tagId) ? tagId : [tagId];
910
+ // 收集所有指定标签下的产品ID
911
+ const allProductIds = [];
912
+ tagIds.forEach(id => {
913
+ const targetTag = tags.find(tag => tag.tagId === id);
914
+ if (targetTag) {
915
+ allProductIds.push(...targetTag.productIds);
916
+ }
917
+ });
918
+ // 去重
919
+ const uniqueProductIds = [...new Set(allProductIds)];
920
+ if (uniqueProductIds.length === 0) {
921
+ return {
922
+ products: [],
923
+ total: 0,
924
+ page: options?.page || 1,
925
+ limit: options?.limit || 10
926
+ };
927
+ }
928
+ // 应用分页
929
+ const page = options?.page || 1;
930
+ const limit = options?.limit || 10;
931
+ const offset = (page - 1) * limit;
932
+ const paginatedProductIds = uniqueProductIds.slice(offset, offset + limit);
933
+ // 获取产品详情
934
+ const products = await Promise.all(paginatedProductIds.map(productId => this.getProduct_p(productId)));
935
+ // 应用状态过滤
936
+ let filteredProducts = products;
937
+ if (options?.status !== undefined) {
938
+ filteredProducts = products.filter(product => product.status === options.status);
939
+ }
940
+ return {
941
+ products: filteredProducts,
942
+ total: uniqueProductIds.length,
943
+ page,
944
+ limit
945
+ };
946
+ }
947
+ /**
948
+ * 5.2. 根据标签ID获取平台产品列表
949
+ */
950
+ async getProductsByTag_t(tagId, options) {
951
+ // 获取标签数据,传递productTagAlias参数
952
+ const tags = await this.getTags(options?.productTagAlias);
953
+ // 将单个标签ID转换为数组
954
+ const tagIds = Array.isArray(tagId) ? tagId : [tagId];
955
+ // 收集所有指定标签下的产品ID
956
+ const allProductIds = [];
957
+ tagIds.forEach(id => {
958
+ const targetTag = tags.find(tag => tag.tagId === id);
959
+ if (targetTag) {
960
+ allProductIds.push(...targetTag.productIds);
961
+ }
962
+ });
963
+ // 去重
964
+ const uniqueProductIds = [...new Set(allProductIds)];
965
+ if (uniqueProductIds.length === 0) {
966
+ return {
967
+ products: [],
968
+ total: 0,
969
+ page: options?.page || 1,
970
+ limit: options?.limit || 10
971
+ };
972
+ }
973
+ // 应用分页
974
+ const page = options?.page || 1;
975
+ const limit = options?.limit || 10;
976
+ const offset = (page - 1) * limit;
977
+ const paginatedProductIds = uniqueProductIds.slice(offset, offset + limit);
978
+ // 获取产品详情
979
+ const products = await Promise.all(paginatedProductIds.map(productId => this.getProduct_p(productId)));
980
+ // 应用状态过滤
981
+ let filteredProducts = products;
982
+ if (options?.status !== undefined) {
983
+ filteredProducts = products.filter(product => product.status === options.status);
984
+ }
985
+ return {
986
+ products: filteredProducts,
987
+ total: uniqueProductIds.length,
988
+ page,
989
+ limit
990
+ };
991
+ }
499
992
  /**
500
993
  * 6. 根据分类ID获取该分类的层级路径
501
994
  * 用于前端面包屑导航
@@ -711,6 +1204,16 @@ class SettingsAPI {
711
1204
  const response = await this.client.request(`/settings/platform-${config.platformId}-${alias}.json`);
712
1205
  return response.settings;
713
1206
  }
1207
+ /**
1208
+ * 获取平台全局设置列表
1209
+ * 根据平台ID和别名获取所有全局设置
1210
+ */
1211
+ async getSettings_p(settingAlias_p) {
1212
+ const config = this.client.getConfig();
1213
+ const alias = settingAlias_p || config.settingAlias_p || '01';
1214
+ const response = await this.client.request(`/settings/platform-${config.platformId_p}-${alias}.json`);
1215
+ return response.settings;
1216
+ }
714
1217
  /**
715
1218
  * 获取指定设置
716
1219
  * 根据设置key直接获取单个设置
@@ -726,6 +1229,21 @@ class SettingsAPI {
726
1229
  return null;
727
1230
  }
728
1231
  }
1232
+ /**
1233
+ * 获取平台用户指定设置
1234
+ * 根据设置key直接获取单个设置
1235
+ */
1236
+ async getSetting_p(key) {
1237
+ const config = this.client.getConfig();
1238
+ try {
1239
+ const response = await this.client.request(`/settings/platform-${config.platformId_p}-${key}.json`);
1240
+ return response.setting;
1241
+ }
1242
+ catch (error) {
1243
+ console.warn(`Failed to fetch setting ${key}:`, error);
1244
+ return null;
1245
+ }
1246
+ }
729
1247
  }
730
1248
 
731
1249
  class FormsAPI {
@@ -2019,30 +2537,72 @@ class GT6SDK {
2019
2537
  async getArticle(articleId) {
2020
2538
  return this.articles.getArticle(articleId);
2021
2539
  }
2540
+ /**
2541
+ * 1.1. 便捷方法:根据文章ID获取文章详情(使用上级平台ID)
2542
+ */
2543
+ async getArticle_p(articleId) {
2544
+ return this.articles.getArticle_p(articleId);
2545
+ }
2022
2546
  /**
2023
2547
  * 2. 便捷方法:获取文章分类列表
2024
2548
  */
2025
2549
  async getCategories(rootCategoryId) {
2026
2550
  return this.articles.getCategories(rootCategoryId);
2027
2551
  }
2552
+ /**
2553
+ * 2.1. 便捷方法:获取文章分类列表(使用下级平台ID)
2554
+ */
2555
+ async getCategories_p(rootCategoryId_p) {
2556
+ return this.articles.getCategories_p(rootCategoryId_p);
2557
+ }
2028
2558
  /**
2029
2559
  * 3. 便捷方法:获取文章标签列表
2030
2560
  */
2031
2561
  async getTags(tagAlias) {
2032
2562
  return this.articles.getTags(tagAlias);
2033
2563
  }
2564
+ /**
2565
+ * 3.1. 便捷方法:获取文章标签列表(使用下级平台ID)
2566
+ */
2567
+ async getTags_p(tagAlias_p) {
2568
+ return this.articles.getTags_p(tagAlias_p);
2569
+ }
2034
2570
  /**
2035
2571
  * 4. 便捷方法:根据分类ID获取文章列表
2036
2572
  */
2037
2573
  async getArticlesByCategory(categoryId, options) {
2038
2574
  return this.articles.getArticlesByCategory(categoryId, options);
2039
2575
  }
2576
+ /**
2577
+ * 4.1. 便捷方法:根据分类ID获取文章列表(使用下级平台ID)
2578
+ */
2579
+ async getArticlesByCategory_p(categoryId, options) {
2580
+ return this.articles.getArticlesByCategory_p(categoryId, options);
2581
+ }
2582
+ /**
2583
+ * 4.2. 便捷方法:根据分类ID获取文章列表(使用当前分类数据)
2584
+ */
2585
+ async getArticlesByCategory_t(categoryId, options) {
2586
+ return this.articles.getArticlesByCategory_t(categoryId, options);
2587
+ }
2040
2588
  /**
2041
2589
  * 5. 便捷方法:根据标签ID获取文章列表
2042
2590
  */
2043
2591
  async getArticlesByTag(tagId, options) {
2044
2592
  return this.articles.getArticlesByTag(tagId, options);
2045
2593
  }
2594
+ /**
2595
+ * 5.1. 便捷方法:根据标签ID获取文章列表(使用下级平台ID)
2596
+ */
2597
+ async getArticlesByTag_p(tagId, options) {
2598
+ return this.articles.getArticlesByTag_p(tagId, options);
2599
+ }
2600
+ /**
2601
+ * 5.2. 便捷方法:根据标签ID获取文章列表(使用当前标签数据)
2602
+ */
2603
+ async getArticlesByTag_t(tagId, options) {
2604
+ return this.articles.getArticlesByTag_t(tagId, options);
2605
+ }
2046
2606
  /**
2047
2607
  * 6. 便捷方法:根据分类ID获取该分类的层级路径
2048
2608
  */
@@ -2061,30 +2621,72 @@ class GT6SDK {
2061
2621
  async getProduct(productId) {
2062
2622
  return this.products.getProduct(productId);
2063
2623
  }
2624
+ /**
2625
+ * 8.1. 便捷方法:根据产品ID获取父平台产品详情
2626
+ */
2627
+ async getProduct_p(productId) {
2628
+ return this.products.getProduct_p(productId);
2629
+ }
2064
2630
  /**
2065
2631
  * 9. 便捷方法:获取产品分类列表
2066
2632
  */
2067
2633
  async getProductCategories(productRootCategoryId) {
2068
2634
  return this.products.getCategories(productRootCategoryId);
2069
2635
  }
2636
+ /**
2637
+ * 9.1. 便捷方法:获取父平台产品分类列表
2638
+ */
2639
+ async getProductCategories_p(productRootCategoryId_p) {
2640
+ return this.products.getCategories_p(productRootCategoryId_p);
2641
+ }
2070
2642
  /**
2071
2643
  * 10. 便捷方法:获取产品标签列表
2072
2644
  */
2073
2645
  async getProductTags(productTagAlias) {
2074
2646
  return this.products.getTags(productTagAlias);
2075
2647
  }
2648
+ /**
2649
+ * 10.1. 便捷方法:获取父平台产品标签列表
2650
+ */
2651
+ async getProductTags_p(productTagAlias_p) {
2652
+ return this.products.getTags_p(productTagAlias_p);
2653
+ }
2076
2654
  /**
2077
2655
  * 11. 便捷方法:根据分类ID获取产品列表
2078
2656
  */
2079
2657
  async getProductsByCategory(categoryId, options) {
2080
2658
  return this.products.getProductsByCategory(categoryId, options);
2081
2659
  }
2660
+ /**
2661
+ * 11.1. 便捷方法:根据分类ID获取父平台产品列表
2662
+ */
2663
+ async getProductsByCategory_p(categoryId, options) {
2664
+ return this.products.getProductsByCategory_p(categoryId, options);
2665
+ }
2666
+ /**
2667
+ * 11.2. 便捷方法:根据分类ID获取父平台产品列表(使用当前分类数据)
2668
+ */
2669
+ async getProductsByCategory_t(categoryId, options) {
2670
+ return this.products.getProductsByCategory_t(categoryId, options);
2671
+ }
2082
2672
  /**
2083
2673
  * 12. 便捷方法:根据标签ID获取产品列表
2084
2674
  */
2085
2675
  async getProductsByTag(tagId, options) {
2086
2676
  return this.products.getProductsByTag(tagId, options);
2087
2677
  }
2678
+ /**
2679
+ * 12.1. 便捷方法:根据标签ID获取父平台产品列表
2680
+ */
2681
+ async getProductsByTag_p(tagId, options) {
2682
+ return this.products.getProductsByTag_p(tagId, options);
2683
+ }
2684
+ /**
2685
+ * 12.2. 便捷方法:根据标签ID获取父平台产品列表(使用当前标签数据)
2686
+ */
2687
+ async getProductsByTag_t(tagId, options) {
2688
+ return this.products.getProductsByTag_t(tagId, options);
2689
+ }
2088
2690
  /**
2089
2691
  * 13. 便捷方法:根据分类ID获取该分类的层级路径
2090
2692
  */
@@ -2121,12 +2723,24 @@ class GT6SDK {
2121
2723
  async getSettings(settingAlias) {
2122
2724
  return this.settings.getSettings(settingAlias);
2123
2725
  }
2726
+ /**
2727
+ * 18.1. 便捷方法:获取父平台全局设置列表
2728
+ */
2729
+ async getSettings_p(settingAlias_p) {
2730
+ return this.settings.getSettings_p(settingAlias_p);
2731
+ }
2124
2732
  /**
2125
2733
  * 19. 便捷方法:获取指定设置
2126
2734
  */
2127
2735
  async getSetting(key) {
2128
2736
  return this.settings.getSetting(key);
2129
2737
  }
2738
+ /**
2739
+ * 19.1. 便捷方法:获取父平台指定设置
2740
+ */
2741
+ async getSetting_p(key) {
2742
+ return this.settings.getSetting_p(key);
2743
+ }
2130
2744
  /**
2131
2745
  * 20. 便捷方法:获取支付方式列表
2132
2746
  */