ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# 组件源码 ``` /** * <b>方法描述:</b> 获取日历字段 <br/> * <b>创建者:</b> admin <br/> * <b>创建时间:</b> 2018-05-08 17:09:08 <br/> * * @param date * 入参|日期|{@link java.util.Date} * @param field * 入参|日历字段(Calendar类常量)|{@link int} * @param value * 出参|值|{@link int} * @return 1 成功<br/> */ @Component(label = "获取日历字段", style = "判断型", type = "同步组件", comment = "日历字段取值由Calendar类常量指定", version = "1.0.0", deprecated = false, author = "admin", date = "2018-05-08 05:09:08") @InParams(param = { @Param(name = "date", comment = "日期", type = java.util.Date.class), @Param(name = "field", comment = "日历字段(Calendar类常量)", type = int.class) }) @OutParams(param = { @Param(name = "value", comment = "值", type = int.class) }) @Returns(returns = { @Return(id = "1", desp = "成功") }) public static ResultBase P_getField(Date date, int field) { Calendar c = Calendar.getInstance(); c.setTime(date); return ResultBase.newSuccessResult(c.get(field)); } ``` # 交易中组件使用方式 ![](https://img.kancloud.cn/a3/c1/a3c1a27c908e06ae1483ed30ed2e5c7d_1869x892.png) # 参数说明及示例 ## 入口参数 日期:输入一个 date 类型的日期,示例: `__INNER__["date"]` 日历字段(Calendar类常量):输入 Calendar 类常量对应的 int 值,示例: `1` ## 出口参数 值:根据输入参数返回日历字段对应的 int 值,示例: `__INNER__["result"]`