Commit 64e57cf446f66221df729f89889bfc6fb915b7a1
1 parent
29df346782
Exists in
master
删除LinkedWork
Showing 2 changed files with 24 additions and 14 deletions
core.sdk/src/main/java/com/lyms/synch/LinkedWork.java
View file @
64e57cf
core.sdk/src/main/java/com/lyms/synch/SyncnCenter.java
View file @
64e57cf
| ... | ... | @@ -10,6 +10,7 @@ |
| 10 | 10 | import com.lyms.synch.entity.SyncnModel; |
| 11 | 11 | import com.lyms.synch.queue.SyncnQueue; |
| 12 | 12 | import com.lyms.util.HttpUtils; |
| 13 | +import com.lyms.util.StrUtils; | |
| 13 | 14 | |
| 14 | 15 | /** |
| 15 | 16 | * <li>@ClassName: SyncnCenter |
| ... | ... | @@ -130,6 +131,29 @@ |
| 130 | 131 | } |
| 131 | 132 | } |
| 132 | 133 | }); |
| 134 | + } | |
| 135 | + | |
| 136 | + /** | |
| 137 | + * <li>@Description:回调方法,调用远端接口 | |
| 138 | + * <p> | |
| 139 | + * 跟 {@link #ackGet(Map)} {@link #ackPost(Map)} 的区别是,后两者需要自己设定callback | |
| 140 | + * 地址跟参数,可以指定任意地址 | |
| 141 | + * <li>@return | |
| 142 | + * <li>创建人:maliang | |
| 143 | + * <li>创建时间:2017年3月14日 | |
| 144 | + * <li>修改人: | |
| 145 | + * <li>修改时间: | |
| 146 | + */ | |
| 147 | + public String ack(Object object) { | |
| 148 | + if (model != null && StringUtils.isNotBlank(model.getRemote())) { | |
| 149 | + model.setId(StrUtils.uuid()); | |
| 150 | + model.setMethod("POST"); | |
| 151 | + model.setTs(System.currentTimeMillis()); | |
| 152 | + model.setData(object); | |
| 153 | + model.setType(ModelType.ACK.name()); | |
| 154 | + return HttpUtils.REMOTE.post(model); | |
| 155 | + } | |
| 156 | + return null; | |
| 133 | 157 | } |
| 134 | 158 | |
| 135 | 159 | /** |