kerry
5 years ago
12 changed files with 145 additions and 74 deletions
@ -0,0 +1,20 @@
|
||||
package com.fr.design.mainframe.template.info; |
||||
|
||||
import com.fr.json.JSONObject; |
||||
|
||||
/** |
||||
* Created by kerry on 2020-05-08 |
||||
*/ |
||||
public interface TemplateOperate { |
||||
/** |
||||
* 获取模板操作类型 |
||||
* @return 操作类型 |
||||
*/ |
||||
String getOperateType(); |
||||
|
||||
/** |
||||
* 将模板操作信息转换成json格式 |
||||
* @return jsonObject |
||||
*/ |
||||
JSONObject toJSONObject(); |
||||
} |
@ -0,0 +1,36 @@
|
||||
package com.fr.design.mainframe.template.info; |
||||
|
||||
import com.fr.form.ui.Widget; |
||||
import com.fr.json.JSONObject; |
||||
|
||||
import java.util.UUID; |
||||
|
||||
/** |
||||
* Created by kerry on 2020-05-08 |
||||
*/ |
||||
public class ComponentCreateOperate extends ComponentOperate { |
||||
public static final String OPERATE_TYPE = "componentCreate"; |
||||
private static final String ATTR_CREATE_TIME = "createTime"; |
||||
private long createTime = 0L; |
||||
|
||||
|
||||
public ComponentCreateOperate(Widget widget) { |
||||
super(widget); |
||||
widget.setWidgetID(UUID.randomUUID().toString()); |
||||
this.createTime = System.currentTimeMillis(); |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public String getOperateType() { |
||||
return OPERATE_TYPE; |
||||
} |
||||
|
||||
@Override |
||||
public JSONObject toJSONObject() { |
||||
JSONObject jo = super.toJSONObject(); |
||||
jo.put(ATTR_CREATE_TIME, createTime); |
||||
return jo; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,29 @@
|
||||
package com.fr.design.mainframe.template.info; |
||||
|
||||
import com.fr.form.ui.Widget; |
||||
import com.fr.json.JSONObject; |
||||
|
||||
/** |
||||
* Created by kerry on 2020-05-08 |
||||
*/ |
||||
public class ComponentDeleteOperate extends ComponentOperate { |
||||
public static final String OPERATE_TYPE = "componentDelete"; |
||||
private long deleteTime = 0L; |
||||
|
||||
public ComponentDeleteOperate(Widget widget) { |
||||
super(widget); |
||||
this.deleteTime = System.currentTimeMillis(); |
||||
} |
||||
|
||||
@Override |
||||
public String getOperateType() { |
||||
return OPERATE_TYPE; |
||||
} |
||||
|
||||
@Override |
||||
public JSONObject toJSONObject() { |
||||
JSONObject jo = super.toJSONObject(); |
||||
jo.put(ATTR_DELETE_TIME, deleteTime); |
||||
return jo; |
||||
} |
||||
} |
Loading…
Reference in new issue