Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-cloud
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data-hook
gic-cloud
Commits
ebc3b69b
Commit
ebc3b69b
authored
May 12, 2021
by
朱瑞泽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
暂定
parent
8009d2d7
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
170 additions
and
7 deletions
+170
-7
TableSyncRecordResult.java
...om/gic/cloud/data/hook/api/dto/TableSyncRecordResult.java
+38
-0
TableSyncRecordService.java
...c/cloud/data/hook/api/service/TableSyncRecordService.java
+19
-0
TableSyncRecordDao.java
...m/gic/cloud/data/hook/service/dao/TableSyncRecordDao.java
+18
-0
TableSyncRecordServiceImpl.java
...ud/data/hook/service/impl/TableSyncRecordServiceImpl.java
+32
-0
data-hook-service-dubbo-config.xml
...ice/src/main/resources/data-hook-service-dubbo-config.xml
+4
-3
TableSyncRecordDao.xml
...-service/src/main/resources/mapper/TableSyncRecordDao.xml
+16
-0
TableSyncRecordController.java
...om/gic/cloud/data/hook/web/TableSyncRecordController.java
+39
-0
data-hook-dubbo-config.xml
...a-hook/src/main/webapp/WEB-INF/data-hook-dubbo-config.xml
+4
-4
No files found.
gic-cloud-data-hook-api/src/main/java/com/gic/cloud/data/hook/api/dto/TableSyncRecordResult.java
0 → 100644
View file @
ebc3b69b
package
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @author zhurz
*/
public
class
TableSyncRecordResult
implements
Serializable
{
private
String
enterpriseId
;
private
String
tableName
;
private
Date
syncTime
;
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
String
getTableName
()
{
return
tableName
;
}
public
void
setTableName
(
String
tableName
)
{
this
.
tableName
=
tableName
;
}
public
Date
getSyncTime
()
{
return
syncTime
;
}
public
void
setSyncTime
(
Date
syncTime
)
{
this
.
syncTime
=
syncTime
;
}
}
gic-cloud-data-hook-api/src/main/java/com/gic/cloud/data/hook/api/service/TableSyncRecordService.java
0 → 100644
View file @
ebc3b69b
package
com
.
gic
.
cloud
.
data
.
hook
.
api
.
service
;
import
java.util.Date
;
/**
* @author zhurz
*/
public
interface
TableSyncRecordService
{
/**
* 获取最近一次同步时间
*
* @param enterpriseId
* @param tableName
* @return
*/
Date
lastSyncDateTime
(
String
enterpriseId
,
String
tableName
);
}
gic-cloud-data-hook-service/src/main/java/com/gic/cloud/data/hook/service/dao/TableSyncRecordDao.java
0 → 100644
View file @
ebc3b69b
package
com
.
gic
.
cloud
.
data
.
hook
.
service
.
dao
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Date
;
/**
* hive表同步记录
*
* @author zhurz
*/
@Mapper
public
interface
TableSyncRecordDao
{
Date
lastSyncDateTime
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"tableName"
)
String
tableName
);
}
gic-cloud-data-hook-service/src/main/java/com/gic/cloud/data/hook/service/impl/TableSyncRecordServiceImpl.java
0 → 100644
View file @
ebc3b69b
package
com
.
gic
.
cloud
.
data
.
hook
.
service
.
impl
;
import
com.gic.cloud.data.hook.api.service.TableSyncRecordService
;
import
com.gic.cloud.data.hook.service.dao.TableSyncRecordDao
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
/**
* @author zhurz
*/
@Service
(
"tableSyncRecordServiceImpl"
)
public
class
TableSyncRecordServiceImpl
implements
TableSyncRecordService
{
@Autowired
private
TableSyncRecordDao
tableSyncRecordDao
;
/**
* 获取最近一次同步时间
*
* @param enterpriseId
* @param tableName
* @return
*/
@Override
public
Date
lastSyncDateTime
(
String
enterpriseId
,
String
tableName
)
{
return
tableSyncRecordDao
.
lastSyncDateTime
(
enterpriseId
,
tableName
);
}
}
gic-cloud-data-hook-service/src/main/resources/data-hook-service-dubbo-config.xml
View file @
ebc3b69b
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:dubbo=
"http://code.alibabatech.com/schema/dubbo"
xmlns:dubbo=
"http://code.alibabatech.com/schema/dubbo"
xmlns:context=
"http://www.springframework.org/schema/context"
xmlns:context=
"http://www.springframework.org/schema/context"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/context/spring-context.xsd
...
@@ -33,6 +33,8 @@
...
@@ -33,6 +33,8 @@
<dubbo:service
interface=
"com.gic.cloud.data.hook.api.service.SearchLogService"
ref=
"searchLogService"
timeout=
"120000"
/>
<dubbo:service
interface=
"com.gic.cloud.data.hook.api.service.SearchLogService"
ref=
"searchLogService"
timeout=
"120000"
/>
<dubbo:service
interface=
"com.gic.cloud.data.hook.api.service.TableSyncRecordService"
ref=
"tableSyncRecordServiceImpl"
/>
<!-- 引用的 Dubbo 服务 -->
<!-- 引用的 Dubbo 服务 -->
<!--<dubbo:reference interface="com.gic.dict.api.service.ManagerDictService" id="managerDictService" timeout="10000" />
<!--<dubbo:reference interface="com.gic.dict.api.service.ManagerDictService" id="managerDictService" timeout="10000" />
<dubbo:reference interface="com.gic.cloud.communicate.api.service.member.MemberTagFieldService" id="memberTagFieldService" timeout="10000" />
<dubbo:reference interface="com.gic.cloud.communicate.api.service.member.MemberTagFieldService" id="memberTagFieldService" timeout="10000" />
...
@@ -44,4 +46,4 @@
...
@@ -44,4 +46,4 @@
<!--<dubbo:registry address="zookeeper://115.159.182.172:2199" protocol="dubbo" id="remoteAdd"/>-->
<!--<dubbo:registry address="zookeeper://115.159.182.172:2199" protocol="dubbo" id="remoteAdd"/>-->
<!--<dubbo:registry address="zookeeper://localhost:2181|zookeeper://115.159.182.172:2199" protocol="dubbo"/>-->
<!--<dubbo:registry address="zookeeper://localhost:2181|zookeeper://115.159.182.172:2199" protocol="dubbo"/>-->
</beans>
</beans>
\ No newline at end of file
gic-cloud-data-hook-service/src/main/resources/mapper/TableSyncRecordDao.xml
0 → 100644
View file @
ebc3b69b
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.gic.cloud.data.hook.service.dao.TableSyncRecordDao"
>
<select
id=
"lastSyncDateTime"
resultType=
"java.util.Date"
>
select sync_time
from dh_table_sync_record
where enterprise_id = #{enterpriseId}
<if
test=
"tableName != null and tableName != ''"
>
and table_name = #{tableName}
</if>
order by sync_time desc
limit 1
</select>
</mapper>
gic-cloud-data-hook/src/main/java/com/gic/cloud/data/hook/web/TableSyncRecordController.java
0 → 100644
View file @
ebc3b69b
package
com
.
gic
.
cloud
.
data
.
hook
.
web
;
import
com.gic.cloud.data.hook.api.dto.TableSyncRecordResult
;
import
com.gic.cloud.data.hook.api.service.TableSyncRecordService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
java.util.Date
;
/**
* hive表同步记录
*
* @author zhurz
*/
@Controller
public
class
TableSyncRecordController
{
@Autowired
private
TableSyncRecordService
tableSyncRecordService
;
/**
* 获取最近一次同步时间
*
* @param enterpriseId
* @param tableName
* @return
*/
@RequestMapping
(
"/last-sync-date-time"
)
public
TableSyncRecordResult
lastSyncDateTime
(
String
enterpriseId
,
String
tableName
)
{
TableSyncRecordResult
result
=
new
TableSyncRecordResult
();
result
.
setEnterpriseId
(
enterpriseId
);
result
.
setTableName
(
tableName
);
Date
date
=
tableSyncRecordService
.
lastSyncDateTime
(
enterpriseId
,
tableName
);
result
.
setSyncTime
(
date
);
return
result
;
}
}
gic-cloud-data-hook/src/main/webapp/WEB-INF/data-hook-dubbo-config.xml
View file @
ebc3b69b
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:dubbo=
"http://code.alibabatech.com/schema/dubbo"
xmlns:dubbo=
"http://code.alibabatech.com/schema/dubbo"
xmlns:context=
"http://www.springframework.org/schema/context"
xmlns:context=
"http://www.springframework.org/schema/context"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/context/spring-context.xsd
...
@@ -31,11 +31,12 @@
...
@@ -31,11 +31,12 @@
<!--<dubbo:reference interface="com.gic.enterprise.api.service.EnterPerformanceService" id="enterPerformanceService" timeout="10000" retries="0" />
<!--<dubbo:reference interface="com.gic.enterprise.api.service.EnterPerformanceService" id="enterPerformanceService" timeout="10000" retries="0" />
<dubbo:reference interface="com.gic.cloud.communicate.api.service.performance.CloudPerformanceService" id="cloudPerformanceService" timeout="10000" retries="0" />
<dubbo:reference interface="com.gic.cloud.communicate.api.service.performance.CloudPerformanceService" id="cloudPerformanceService" timeout="10000" retries="0" />
<dubbo:reference interface="com.gic.cloud.communicate.api.service.store.AreaService" id="areaService" timeout="10000" retries="0" />-->
<dubbo:reference interface="com.gic.cloud.communicate.api.service.store.AreaService" id="areaService" timeout="10000" retries="0" />-->
<dubbo:reference
interface=
"com.gic.cloud.data.hook.api.service.TableSyncRecordService"
id=
"tableSyncRecordService"
retries=
"0"
/>
<!-- 使用zookeeper注册中心暴露服务地址 -->
<!-- 使用zookeeper注册中心暴露服务地址 -->
<!--<dubbo:registry address="zookeeper://localhost:2181" protocol="dubbo" id="localAdd"/>-->
<!--<dubbo:registry address="zookeeper://localhost:2181" protocol="dubbo" id="localAdd"/>-->
<!--<dubbo:registry address="zookeeper://115.159.182.172:2199" protocol="dubbo" id="remoteAdd"/>-->
<!--<dubbo:registry address="zookeeper://115.159.182.172:2199" protocol="dubbo" id="remoteAdd"/>-->
<!--<dubbo:registry address="zookeeper://localhost:2181|zookeeper://115.159.182.172:2199" protocol="dubbo"/>-->
<!--<dubbo:registry address="zookeeper://localhost:2181|zookeeper://115.159.182.172:2199" protocol="dubbo"/>-->
</beans>
</beans>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment