首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏Linyb极客之路

    如何在代码中应用设计模式

    也不用去想那么多,挽起袖子就是一通操作: public class OrderPromotion { public BigDecimal promotion(Order order, int[] promotions public class OrderPromotion { public BigDecimal promotion(Order order, int[] promotions){ for(int promotion:promotions){ switch (promotion){ case 1: OrderPromotion public class OrderPromotion { public BigDecimal promotion(Order order, int[] promotions ){ for(int promotion:promotions){ PromotionFactory.getPromotionCalculate(promotion

    1.4K20发布于 2019-11-22
  • 来自专栏Java技术栈

    设计模式都没用过,好意思出去面试?

    也不用去想那么多,挽起袖子就是一通操作: public class OrderPromotion { public BigDecimal promotion(Order order, int[] promotions public class OrderPromotion { public BigDecimal promotion(Order order, int[] promotions){ for(int promotion:promotions){ switch (promotion){ case 1: OrderPromotion public class OrderPromotion { public BigDecimal promotion(Order order, int[] promotions ){ for(int promotion:promotions){ PromotionFactory.getPromotionCalculate(promotion

    63320发布于 2019-10-14
  • 来自专栏Java架构筑基

    如何在代码中应用设计模式

    也不用去想那么多,挽起袖子就是一通操作: public class OrderPromotion { public BigDecimal promotion(Order order, int[] promotions 所以这里我们将对折扣类型的判断和计算价格分开: public class OrderPromotion { public BigDecimal promotion(Order order, int[] promotions public class OrderPromotion { public BigDecimal promotion(Order order, int[] promotions){ OrderPromotion public class OrderPromotion { public BigDecimal promotion(Order order, int[] promotions ){ for (int promotion:promotions){ PromotionFactory.getPromotionCalculate(promotion

    1.5K20发布于 2019-04-24
  • 来自专栏Tom弹架构

    使用策略模式重构电商折扣和支付场景

    public class PromotionStrategyFacory { private static Map<String,IPromotionStrategy> PROMOTIONS = new HashMap<String, IPromotionStrategy>(); static { PROMOTIONS.put(PromotionKey.COUPON ,new CouponStrategy()); PROMOTIONS.put(PromotionKey.CASHBACK,new CashbackStrategy()); PROMOTIONS.put(PromotionKey.GROUPBUY,new GroupbuyStrategy()); } private static final IPromotionStrategy IPromotionStrategy getPromotionStrategy(String promotionKey){ IPromotionStrategy strategy = PROMOTIONS.get

    61710编辑于 2021-12-21
  • 来自专栏sktj

    python global()函数

    = 'best_promo'] 找出当前以_promo结尾的函数 从模块中导入所有函数 import promotions import inspect promos = [func for name , func in inspect.getmembers(promotions, inspect.isfunction)]

    84040发布于 2019-08-02
  • 来自专栏Tom弹架构

    使用策略模式重构电商折扣和支付场景

    public class PromotionStrategyFacory { private static Map<String,IPromotionStrategy> PROMOTIONS = new HashMap<String, IPromotionStrategy>(); static { PROMOTIONS.put(PromotionKey.COUPON ,new CouponStrategy()); PROMOTIONS.put(PromotionKey.CASHBACK,new CashbackStrategy()); PROMOTIONS.put(PromotionKey.GROUPBUY,new GroupbuyStrategy()); } private static final IPromotionStrategy IPromotionStrategy getPromotionStrategy(String promotionKey){ IPromotionStrategy strategy = PROMOTIONS.get

    89620发布于 2021-11-05
  • 京东商品详情接口实战解析:从调用优化到商业价值挖掘(附避坑代码)

    促销信息(解析最优方案) promotions = self._parse_promotions(raw_data.get("promotion", {})) # 3. = product["promotions"] strategies = [] # 1. 仅用优惠券 if promotions["best_coupon"]: coupon_val = Decimal(str(promotions["best_coupon 仅用满减 if promotions["best_full_reduction"]: fr = promotions["best_full_reduction"] (str(promotions["best_coupon"].get("discount", 0))) fr = promotions["best_full_reduction"]

    53910编辑于 2025-10-10
  • 来自专栏沃趣科技

    MySQL 8.0 新特性之统计直方图

    ->        total, ->        CAST(promotions AS DECIMAL(15, 4)) / CAST(total AS DECIMAL(15, 4)) * 100 - > FROM   (SELECT SUM(ss_ext_sales_price) promotions ->         FROM   store_sales, ->                 | total      | CAST(promotions AS DECIMAL(15, 4)) / CAST(total AS DECIMAL(15, 4)) * 100 | +--------- | total      | CAST(promotions AS DECIMAL(15, 4)) / CAST(total AS DECIMAL(15, 4)) * 100 | +--------- | total      | CAST(promotions AS DECIMAL(15, 4)) / CAST(total AS DECIMAL(15, 4)) * 100 | +---------

    2.4K40发布于 2018-07-02
  • 来自专栏新零售项目实践

    多端开发实战 | 基于 Taro 的多端智能补货预测系统实战指南

    tf from '@tensorflow/tfjs';/** * LSTM需求预测组件 * @param {Array} salesData - 历史销售数据数组 * @param {Array} promotions promotions:促销活动时间表(标记促销影响区间)。holidays:节假日日历(特殊日期影响因子)。slidingWindow(30,1):用30天数据预测下1天销量。 ) { return data.map((point, idx) => { // 检查当前数据点是否处于任意一个促销活动期间 const isPromoDay = promotions.some 2), 0) / windowData.length, ); return { mean, std };}功能解析:主函数 removePromotionOutliers(data, promotions promotions: 促销活动数组,每个元素包含 startDate 和 endDate。流程:遍历每个数据点 point,检查其日期是否在任意促销期内(isPromoDay)。

    87620编辑于 2025-07-23
  • 来自专栏爬虫资料

    捕捉页面的关键元素:用CSS选择器与Puppeteer自动抓取

    使用CSS选择器获取特价机票信息 const flightData = await page.evaluate(() => { // 查找特价机票列表元素 const promotions document.querySelectorAll('.promotion-list .promotion-item'); // 提取特价机票信息 const data = []; promotions.forEach const promotions = document.querySelectorAll('.promotion-list .promotion-item');4.

    67010编辑于 2024-11-19
  • 来自专栏沉浸式AI

    做定时任务,一定要用这个神库!!

    this.shouldSendNotification("promotions")) return; const promotions = awaitthis.fetchActivePromotions (); if (promotions.length > 0) { sendNotification("限时优惠 ", "有新的限时优惠活动,点击查看详情!")

    44510编辑于 2025-03-27
  • 来自专栏沉浸式AI

    做定时任务,一定要用这个神库!!

    this.shouldSendNotification('promotions')) return; const promotions = await this.fetchActivePromotions (); if (promotions.length > 0) { sendNotification('限时优惠', '

    40810编辑于 2025-03-28
  • 来自专栏DevOps持续集成

    使用python-jenkins管理Jenkins

    get_plugin_info', 'get_plugins', 'get_plugins_info', 'get_promotion_config', 'get_promotion_name', 'get_promotions ', 'get_promotions_info', 'get_queue_info', 'get_queue_item', 'get_running_builds', 'get_version', 'get_view_config 获取插件信息 get_plugin_info get_plugins get_plugins_info 获取晋级信息 get_promotion_config get_promotion_name get_promotions get_promotions_info 获取队列信息 get_queue_info get_queue_item 获取运行中构建 get_running_builds 获取版本 get_version

    1.5K20编辑于 2022-12-29
  • 来自专栏dongfanger

    Python设计模式知多少

    方法二 通过函数内省自动查找promotions模块中的所有函数作为策略函数(要求promotions模块中只能包含策略函数,不能包含其他函数): promos = [func for name, func in inspect.getmembers(promotions, inspect.isfunction)] def best_promo(order): " available """ return max(promo(order) for promo in promos) inspect.getmembers()的第一个参数是目标模块(promotions

    71920发布于 2021-05-24
  • 来自专栏全栈程序员必看

    E-commerce 中促销系统的设计

    这样设计最大好处是 rule与action相互独立且高度抽象, 运营人员与开发人员可以自由组合rule和action来达到最大灵活性与可扩展性 数据库设计 Promotion Schema::create('promotions 因此 promotion_variants 实际上是promotions表和variants表中间的一张中间表, 并且这张中间表携带了其他信息, 来看看迁移文件 Schema::create('promotion_variants 代码逻辑 订单对促销的判断的逻辑的laravel伪代码 // 获取平台所有有效的促销 $promotions = Promotion::active()->get(); // 通过rule过滤promotion $promotions = $promotions->filter(function ($promotion) { $rules = $promotion->rules $order

    5.1K50编辑于 2022-07-08
  • 来自专栏bisal的个人杂货铺

    创建主键的三种方式对指定索引表空间操作的纠正

    Oracle的官方手册,就提到了创建主键约束/唯一约束时,可以指定表空间,如下是11g的《SQL Language Reference》, 但是有些限制, 并给出了示例, CREATE TABLE promotions_var3 promo_id_u UNIQUE (promo_id, promo_cost) USING INDEX (CREATE UNIQUE INDEX promo_ix1 ON promotions_var3

    64010发布于 2021-09-06
  • 来自专栏SAP供应链

    SAP SD基础知识之促销计划 (Agreements)

    销售信息系统能使用一个用户定义的信息结构来获取和报告sales deals和promotions的统计数据。

    2.6K40发布于 2021-01-11
  • 来自专栏用户5892232的专栏

    【2019年8月】OCP 071认证考试最新版本的考试原题-第21题

    choose two In the PROMOTIONS table, the PROMO_BEGTN_DATE columm is of datatype DATE and the default date

    44520发布于 2019-11-04
  • 来自专栏Java开发

    Java 抽象类与接口在 Java17 及以上版本中的现代应用实践解析

    ShoppingCart { private final List<Product> items = new ArrayList<>(); private final List<Promotion> promotions items.add(product); } public void applyPromotion(Promotion promotion) { promotions.add (product -> { // 查找适用的促销并应用最大折扣 Optional<Promotion> bestPromotion = promotions.stream

    20700编辑于 2025-06-22
  • 来自专栏腾讯社交用户体验设计

    WEE &SEE角色设定

    02_Character Identity 角色身份 The personality definition of a character is very important in developing promotions In the future, we can continue to create video contents through promotions such as dancing and taking

    1K30发布于 2018-06-29
领券