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
255ace71
Commit
255ace71
authored
May 20, 2024
by
guojx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-2024-05-data-hook' into 'master'
Feature 2024 05 data hook See merge request
!125
parents
5b55e0a4
cb1f960c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
145 additions
and
30 deletions
+145
-30
FreeQueryRecordDao.xml
...-service/src/main/resources/mapper/FreeQueryRecordDao.xml
+5
-2
FreeQueryRecord.java
...main/java/com/gic/cloud/data/hook/vo/FreeQueryRecord.java
+110
-0
FreeQueryController.java
...java/com/gic/cloud/data/hook/web/FreeQueryController.java
+17
-15
spring-servlet.xml
...loud-data-hook/src/main/webapp/WEB-INF/spring-servlet.xml
+13
-13
No files found.
gic-cloud-data-hook-service/src/main/resources/mapper/FreeQueryRecordDao.xml
View file @
255ace71
...
...
@@ -65,8 +65,11 @@
<include
refid=
"queryTables"
/>
<include
refid=
"queryJoins"
/>
WHERE
q.user_id = #{userId}
<if
test=
"fuzzy != '' "
>
1=1
<if
test=
"userId != null and userId != ''"
>
and q.user_id = #{userId}
</if>
<if
test=
"fuzzy != null and fuzzy != '' "
>
<bind
name=
"pattern"
value=
"'%' + fuzzy + '%'"
/>
AND (
q.name LIKE #{pattern}
...
...
gic-cloud-data-hook/src/main/java/com/gic/cloud/data/hook/vo/FreeQueryRecord.java
0 → 100644
View file @
255ace71
package
com
.
gic
.
cloud
.
data
.
hook
.
vo
;
import
org.apache.commons.lang3.StringUtils
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @Author guojx
* @Date 2024/5/17 15:33
*/
public
class
FreeQueryRecord
implements
Serializable
{
/** 查询定义编号(timestamp) */
protected
String
id
=
""
;
/** 查询定义编号(timestamp)
* @return
*/
public
String
getId
()
{
return
id
;
}
/** 查询定义编号(timestamp)
* @param id
*/
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
/** 更新时间 */
protected
Date
updateTime
=
null
;
/** 更新时间
* @return
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
/** 更新时间
* @param updateTime
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
/** 用户编号 */
protected
String
userId
=
""
;
/** 用户编号
* @return
*/
public
String
getUserId
()
{
return
userId
;
}
/** 用户编号
* @param userId
*/
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
/** 查询定义名称 */
protected
String
name
=
""
;
/** 查询定义名称
* @return
*/
public
String
getName
()
{
return
name
;
}
/** 查询定义名称
* @param name
*/
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
/** 查询内容 */
protected
String
content
=
""
;
/** 查询内容
* @return
*/
public
String
getContent
()
{
return
content
;
}
/** 查询内容
* @param content
*/
public
void
setContent
(
String
content
)
{
this
.
content
=
content
;
}
/**
* 是否否有旧的表extract开头的表,1:有 需要提示:老版取数平台extract表将停止更新并下线,请根据映射关系表调整查询语句
*/
private
Integer
hasOldTable
;
public
Integer
getHasOldTable
()
{
if
(
StringUtils
.
isNotBlank
(
content
)
&&
content
.
contains
(
"extract_"
))
{
return
1
;
}
return
0
;
}
}
gic-cloud-data-hook/src/main/java/com/gic/cloud/data/hook/web/FreeQueryController.java
View file @
255ace71
...
...
@@ -3,19 +3,16 @@ package com.gic.cloud.data.hook.web;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.clerk.api.dto.AuthorizedUser
;
import
com.gic.cloud.common.api.base.Page
;
import
com.gic.cloud.data.hook.api.dto.*
;
import
com.gic.cloud.data.hook.api.entity.FlatQueryExecuteRequest
;
import
com.gic.cloud.data.hook.api.entity.GeneralResult
;
import
com.gic.cloud.data.hook.api.service.IFlatQueryResultService
;
import
com.gic.cloud.data.hook.api.service.IFreeQueryService
;
import
com.gic.cloud.data.hook.api.service.SearchLogService
;
import
com.gic.enterprise.api.dto.EnterpriseDTO
;
import
com.gic.cloud.data.hook.vo.FreeQueryRecord
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.web.common.utils.SessionContextUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -57,7 +54,8 @@ public class FreeQueryController {
*/
@RequestMapping
(
"/free-query-record-list"
)
public
List
<
FreeQueryRecord
>
freeQueryRecordList
(
String
userId
,
String
fuzzy
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
return
this
.
freeQueryService
.
getFreeQueryRecordListByUserId
(
userId
,
fuzzy
);
// 限定 10 个/分页
List
<
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
.
FreeQueryRecord
>
list
=
this
.
freeQueryService
.
getFreeQueryRecordListByUserId
(
userId
,
fuzzy
);
// 限定 10 个/分页
return
EntityUtil
.
changeEntityListNew
(
FreeQueryRecord
.
class
,
list
);
}
/** 创建自定义查询记录
...
...
@@ -69,8 +67,8 @@ public class FreeQueryController {
* @return
*/
@RequestMapping
(
"/create-free-query-record"
)
public
List
<
FreeQueryRecord
>
createFreeQueryRecord
(
String
recordId
,
String
userId
,
String
name
,
String
content
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
FreeQueryRecord
record
=
new
FreeQueryRecord
();
public
List
<
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
.
FreeQueryRecord
>
createFreeQueryRecord
(
String
recordId
,
String
userId
,
String
name
,
String
content
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
.
FreeQueryRecord
record
=
new
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
.
FreeQueryRecord
();
record
.
setId
(
recordId
);
record
.
setUserId
(
userId
);
record
.
setName
(
name
);
...
...
@@ -90,8 +88,8 @@ public class FreeQueryController {
* @return
*/
@RequestMapping
(
"/update-free-query-record"
)
public
List
<
FreeQueryRecord
>
updateFreeQueryRecord
(
String
userId
,
String
recordId
,
String
name
,
String
content
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
FreeQueryRecord
preRecord
=
this
.
freeQueryService
.
getFreeQueryRecordByUserIdAndRecordId
(
userId
,
recordId
);
public
List
<
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
.
FreeQueryRecord
>
updateFreeQueryRecord
(
String
userId
,
String
recordId
,
String
name
,
String
content
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
.
FreeQueryRecord
preRecord
=
this
.
freeQueryService
.
getFreeQueryRecordByUserIdAndRecordId
(
userId
,
recordId
);
if
(
preRecord
!=
null
)
{
preRecord
.
setName
(
name
);
preRecord
.
setContent
(
content
);
...
...
@@ -109,8 +107,8 @@ public class FreeQueryController {
* @return
*/
@RequestMapping
(
"/delete-free-query-record"
)
public
List
<
FreeQueryRecord
>
deleteFreeQueryRecord
(
String
userId
,
String
recordId
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
FreeQueryRecord
preRecord
=
this
.
freeQueryService
.
getFreeQueryRecordByUserIdAndRecordId
(
userId
,
recordId
);
public
List
<
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
.
FreeQueryRecord
>
deleteFreeQueryRecord
(
String
userId
,
String
recordId
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
.
FreeQueryRecord
preRecord
=
this
.
freeQueryService
.
getFreeQueryRecordByUserIdAndRecordId
(
userId
,
recordId
);
if
(
preRecord
!=
null
)
{
this
.
freeQueryService
.
deleteFreeQueryRecord
(
recordId
);
}
// IF OVER
...
...
@@ -238,12 +236,16 @@ public class FreeQueryController {
@RequestMapping
(
"/get-custom-database"
)
public
FreeQuerySource
getCustomDatabase
(){
FreeQuerySource
freeQuerySource
=
this
.
freeQueryService
.
getFreeQuerySource
(
SessionContextUtils
.
getLoginUserEnterpriseId
());
System
.
out
.
println
(
JSON
.
toJSONString
(
freeQuerySource
));
if
(
freeQuerySource
==
null
){
freeQuerySource
=
new
FreeQuerySource
();
freeQuerySource
.
setDatabase
(
this
.
enterpriseService
.
getEnterpriseById
(
SessionContextUtils
.
getLoginUserEnterpriseId
()).
getFactoryCode
());
}
return
freeQuerySource
;
if
(
freeQuerySource
!=
null
)
{
freeQuerySource
.
setUrl
(
null
);
freeQuerySource
.
setUsername
(
null
);
freeQuerySource
.
setPassword
(
null
);
}
return
EntityUtil
.
changeEntityNew
(
FreeQuerySource
.
class
,
freeQuerySource
);
}
/**
...
...
@@ -253,7 +255,7 @@ public class FreeQueryController {
* @return
*/
@RequestMapping
(
"/get-db-cache"
)
public
FreeQuerySource
cache
(
String
a
,
String
b
){
public
FreeQuerySource
cache
(
String
a
,
String
b
){
ServiceResponse
<
String
>
stringServiceResponse
=
this
.
freeQueryService
.
testCacheDb
(
a
,
b
);
System
.
out
.
println
(
JSON
.
toJSONString
(
stringServiceResponse
));
return
new
FreeQuerySource
();
...
...
gic-cloud-data-hook/src/main/webapp/WEB-INF/spring-servlet.xml
View file @
255ace71
...
...
@@ -15,7 +15,7 @@
<context:component-scan
base-package=
"com.gic.cloud.data.hook"
/>
<!-- 启动对@AspectJ注解的支持 -->
<
!--<aop:aspectj-autoproxy />--
>
<
aop:aspectj-autoproxy
/
>
<mvc:resources
location=
"/images/"
mapping=
"/images/**"
/>
<mvc:resources
location=
"/js/"
mapping=
"/js/**"
/>
...
...
@@ -110,18 +110,18 @@
</bean>
<!-- 视图解析器配置 -->
<bean
class=
"org.springframework.web.servlet.view.BeanNameViewResolver"
/
>
<!-- If no extension matched, use JSP view
-->
<bean
class=
"org.springframework.web.servlet.view.InternalResourceViewResolver"
>
<property
name=
"order"
value=
"2"
/
>
<property
name=
"prefix"
>
<value>
/WEB-INF/view/
</value
>
</property
>
<property
name=
"suffix"
>
<value>
.jsp
</value
>
</property
>
</bean
>
<!-- <bean class="org.springframework.web.servlet.view.BeanNameViewResolver" />--
>
<!-- <!– If no extension matched, use JSP view –>
-->
<!-- <bean-->
<!-- class="org.springframework.web.servlet.view.InternalResourceViewResolver">--
>
<!-- <property name="order" value="2" />--
>
<!-- <property name="prefix">--
>
<!-- <value>/WEB-INF/view/</value>--
>
<!-- </property>--
>
<!-- <property name="suffix">--
>
<!-- <value>.jsp</value>--
>
<!-- </property>--
>
<!-- </bean>--
>
<mvc:interceptors>
<bean
class=
"com.gic.commons.interceptor.RequestLimitInterceptor"
></bean>
</mvc:interceptors>
...
...
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