init base info

于相涌/Lark
YXY 2 years ago
parent 41f90db888
commit eab191d9af

@ -0,0 +1,8 @@
package com.ruoyi.common.base;
/**
* @author yuxiangyong
* @create 2023-03-12 16:00
*/
public class LarkRequest {
}

@ -0,0 +1,48 @@
package com.ruoyi.common.service;
import com.ruoyi.common.base.LarkRequest;
import lombok.extern.slf4j.Slf4j;
/**
* @author yuxiangyong
* @create 2023-03-12 15:58
*/
@Slf4j
public abstract class LarkOperateAbstract{
public void execute(LarkRequest request){
try {
if (!check(request)){
return;
}
businessProcessing(request);
endHandle(request);
}catch (Exception e){
log.error("{} execute error: {}",getName(),e);
}
}
/**
*
*
*/
protected Boolean check(LarkRequest request){
return Boolean.TRUE;
}
/**
*
* @param request
*/
protected abstract void businessProcessing(LarkRequest request);
/**
*
*/
protected void endHandle(LarkRequest request){
}
protected abstract String getName();
}

@ -0,0 +1,11 @@
package com.ruoyi.system.domain;
import com.ruoyi.common.base.LarkRequest;
/**
* @author yuxiangyong
* @create 2023-03-12 16:00
*/
public class LarkCallbackRequest extends LarkRequest {
}

@ -0,0 +1,41 @@
package com.ruoyi.system.lark.strategy;
import com.ruoyi.common.base.LarkRequest;
import com.ruoyi.common.service.LarkOperateAbstract;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author yuxiangyong
* @create 2023-03-12 15:58
*/
@Slf4j
@Component("approvalCallback")
public class ApprovalCallback extends CallbackAbstract {
@Override
protected Boolean check(LarkRequest request) {
Boolean result = Boolean.FALSE;
return result;
}
@Override
protected void businessProcessing(LarkRequest request) {
}
@Override
protected void endHandle(LarkRequest request) {
super.endHandle(request);
}
@Override
protected String getName() {
return this.getClass().getSimpleName();
}
}

@ -0,0 +1,14 @@
package com.ruoyi.system.lark.strategy;
import com.ruoyi.common.service.LarkOperateAbstract;
import lombok.extern.slf4j.Slf4j;
/**
* @author yuxiangyong
* @create 2023-03-12 15:58
*/
@Slf4j
public abstract class CallbackAbstract extends LarkOperateAbstract {
}

@ -0,0 +1,69 @@
-- 飞书-公司关联表
CREATE TABLE `lark_company_relation`
(
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '唯一主键',
`company_id` bigint DEFAULT NULL COMMENT '公司id',
`company_name` varchar(255) DEFAULT NULL COMMENT '公司名称',
`app_id` varchar(255) NOT NULL COMMENT '飞书的appId',
`secret` varchar(255) NOT NULL COMMENT '公司+appId对应的唯一密钥',
`create_by` varchar(255) NOT NULL,
`create_time` datetime NOT NULL,
`update_by` varchar(255) DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
`flag` tinyint NOT NULL DEFAULT '0' COMMENT '删除标记0未删除、1已删除',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
-- AppId-table关联表
CREATE TABLE `lark_table_relation`
(
`id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '唯一主键',
`lark_company_relation_id` BIGINT DEFAULT NULL COMMENT '公司与飞书关联表id',
`from_table_id` VARCHAR(255) DEFAULT NULL COMMENT '来源表',
`to_table_id` VARCHAR(255) DEFAULT NULL COMMENT '对应更新表',
`url` BIGINT DEFAULT NULL COMMENT 'url地址',
`create_by` VARCHAR(255) NOT NULL,
`create_time` datetime NOT NULL,
`update_by` VARCHAR(255) DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
`flag` TINYINT NOT NULL DEFAULT '0' COMMENT '删除标记0未删除、1已删除',
`remark` VARCHAR(255) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`)
) ENGINE = INNODB;
-- 事务操作日志
CREATE TABLE `event_log` (
`id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '唯一主键',
`table_id` VARCHAR (255) DEFAULT NULL COMMENT '多维表格id',
`record_id` VARCHAR (255) DEFAULT NULL COMMENT '实际行id',
`event_id` VARCHAR (255) DEFAULT NULL COMMENT '实际事务id',
`operate_type` VARCHAR (255) DEFAULT NULL COMMENT '操作类型',
`operate_status` VARCHAR (255) DEFAULT NULL COMMENT '操作编码',
`error_code` VARCHAR (255) DEFAULT NULL COMMENT '错误编码',
`error_message` VARCHAR (255) DEFAULT NULL COMMENT '错误信息',
`create_by` VARCHAR (255) NOT NULL,
`create_time` datetime NOT NULL,
`update_by` VARCHAR (255) DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
`flag` TINYINT NOT NULL DEFAULT '0' COMMENT '删除标记0未删除、1已删除',
`remark` VARCHAR (255) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`)
) ENGINE = INNODB;
-- 事务详情
CREATE TABLE `event` (
`id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '唯一主键',
`message` text DEFAULT NULL COMMENT '回调信息',
`create_by` VARCHAR (255) NOT NULL,
`create_time` datetime NOT NULL,
`update_by` VARCHAR (255) DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
`flag` VARCHAR (20) NOT NULL COMMENT '状态标记pending处理中、success成功、faild失败',
`remark` VARCHAR (255) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`)
) ENGINE = INNODB;
Loading…
Cancel
Save