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
1fd11f80
Commit
1fd11f80
authored
May 17, 2024
by
guojx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
老板接口优化,删除数据库连接
parent
69dd9110
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
25 deletions
+20
-25
FreeQueryRecord.java
...main/java/com/gic/cloud/data/hook/vo/FreeQueryRecord.java
+1
-1
FreeQuerySource.java
...main/java/com/gic/cloud/data/hook/vo/FreeQuerySource.java
+1
-1
FreeQueryController.java
...java/com/gic/cloud/data/hook/web/FreeQueryController.java
+18
-23
No files found.
gic-cloud-data-hook/src/main/java/com/gic/cloud/data/hook/vo/FreeQueryRecord
VO
.java
→
gic-cloud-data-hook/src/main/java/com/gic/cloud/data/hook/vo/FreeQueryRecord.java
View file @
1fd11f80
...
@@ -9,7 +9,7 @@ import java.util.Date;
...
@@ -9,7 +9,7 @@ import java.util.Date;
* @Author guojx
* @Author guojx
* @Date 2024/5/17 15:33
* @Date 2024/5/17 15:33
*/
*/
public
class
FreeQueryRecord
VO
implements
Serializable
{
public
class
FreeQueryRecord
implements
Serializable
{
/** 查询定义编号(timestamp) */
/** 查询定义编号(timestamp) */
protected
String
id
=
""
;
protected
String
id
=
""
;
...
...
gic-cloud-data-hook/src/main/java/com/gic/cloud/data/hook/vo/FreeQuerySource
VO
.java
→
gic-cloud-data-hook/src/main/java/com/gic/cloud/data/hook/vo/FreeQuerySource.java
View file @
1fd11f80
...
@@ -7,7 +7,7 @@ import java.util.Date;
...
@@ -7,7 +7,7 @@ import java.util.Date;
* @Author guojx
* @Author guojx
* @Date 2024/5/17 15:36
* @Date 2024/5/17 15:36
*/
*/
public
class
FreeQuerySource
VO
implements
Serializable
{
public
class
FreeQuerySource
implements
Serializable
{
/** 自定义查询编号 */
/** 自定义查询编号 */
protected
String
id
=
""
;
protected
String
id
=
""
;
...
...
gic-cloud-data-hook/src/main/java/com/gic/cloud/data/hook/web/FreeQueryController.java
View file @
1fd11f80
...
@@ -3,22 +3,17 @@ package com.gic.cloud.data.hook.web;
...
@@ -3,22 +3,17 @@ package com.gic.cloud.data.hook.web;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.clerk.api.dto.AuthorizedUser
;
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.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.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.IFreeQueryService
;
import
com.gic.cloud.data.hook.api.service.SearchLogService
;
import
com.gic.cloud.data.hook.api.service.SearchLogService
;
import
com.gic.cloud.data.hook.vo.FreeQueryRecord
VO
;
import
com.gic.cloud.data.hook.vo.FreeQueryRecord
;
import
com.gic.cloud.data.hook.vo.FreeQuerySource
VO
;
import
com.gic.cloud.data.hook.vo.FreeQuerySource
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.api.dto.EnterpriseDTO
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.web.common.utils.SessionContextUtils
;
import
com.gic.web.common.utils.SessionContextUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
...
@@ -59,9 +54,9 @@ public class FreeQueryController {
...
@@ -59,9 +54,9 @@ public class FreeQueryController {
* @return
* @return
*/
*/
@RequestMapping
(
"/free-query-record-list"
)
@RequestMapping
(
"/free-query-record-list"
)
public
List
<
FreeQueryRecord
VO
>
freeQueryRecordList
(
String
userId
,
String
fuzzy
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
List
<
FreeQueryRecord
>
freeQueryRecordList
(
String
userId
,
String
fuzzy
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
List
<
FreeQueryRecord
>
list
=
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
VO
.
class
,
list
);
return
EntityUtil
.
changeEntityListNew
(
FreeQueryRecord
.
class
,
list
);
}
}
/** 创建自定义查询记录
/** 创建自定义查询记录
...
@@ -73,8 +68,8 @@ public class FreeQueryController {
...
@@ -73,8 +68,8 @@ public class FreeQueryController {
* @return
* @return
*/
*/
@RequestMapping
(
"/create-free-query-record"
)
@RequestMapping
(
"/create-free-query-record"
)
public
List
<
FreeQueryRecord
>
createFreeQueryRecord
(
String
recordId
,
String
userId
,
String
name
,
String
content
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
List
<
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
.
FreeQueryRecord
>
createFreeQueryRecord
(
String
recordId
,
String
userId
,
String
name
,
String
content
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
FreeQueryRecord
record
=
new
FreeQueryRecord
();
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
.
FreeQueryRecord
record
=
new
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
.
FreeQueryRecord
();
record
.
setId
(
recordId
);
record
.
setId
(
recordId
);
record
.
setUserId
(
userId
);
record
.
setUserId
(
userId
);
record
.
setName
(
name
);
record
.
setName
(
name
);
...
@@ -94,8 +89,8 @@ public class FreeQueryController {
...
@@ -94,8 +89,8 @@ public class FreeQueryController {
* @return
* @return
*/
*/
@RequestMapping
(
"/update-free-query-record"
)
@RequestMapping
(
"/update-free-query-record"
)
public
List
<
FreeQueryRecord
>
updateFreeQueryRecord
(
String
userId
,
String
recordId
,
String
name
,
String
content
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
List
<
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
.
FreeQueryRecord
>
updateFreeQueryRecord
(
String
userId
,
String
recordId
,
String
name
,
String
content
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
FreeQueryRecord
preRecord
=
this
.
freeQueryService
.
getFreeQueryRecordByUserIdAndRecordId
(
userId
,
recordId
);
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
.
FreeQueryRecord
preRecord
=
this
.
freeQueryService
.
getFreeQueryRecordByUserIdAndRecordId
(
userId
,
recordId
);
if
(
preRecord
!=
null
)
{
if
(
preRecord
!=
null
)
{
preRecord
.
setName
(
name
);
preRecord
.
setName
(
name
);
preRecord
.
setContent
(
content
);
preRecord
.
setContent
(
content
);
...
@@ -113,8 +108,8 @@ public class FreeQueryController {
...
@@ -113,8 +108,8 @@ public class FreeQueryController {
* @return
* @return
*/
*/
@RequestMapping
(
"/delete-free-query-record"
)
@RequestMapping
(
"/delete-free-query-record"
)
public
List
<
FreeQueryRecord
>
deleteFreeQueryRecord
(
String
userId
,
String
recordId
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
List
<
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
.
FreeQueryRecord
>
deleteFreeQueryRecord
(
String
userId
,
String
recordId
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
FreeQueryRecord
preRecord
=
this
.
freeQueryService
.
getFreeQueryRecordByUserIdAndRecordId
(
userId
,
recordId
);
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
.
FreeQueryRecord
preRecord
=
this
.
freeQueryService
.
getFreeQueryRecordByUserIdAndRecordId
(
userId
,
recordId
);
if
(
preRecord
!=
null
)
{
if
(
preRecord
!=
null
)
{
this
.
freeQueryService
.
deleteFreeQueryRecord
(
recordId
);
this
.
freeQueryService
.
deleteFreeQueryRecord
(
recordId
);
}
// IF OVER
}
// IF OVER
...
@@ -130,7 +125,7 @@ public class FreeQueryController {
...
@@ -130,7 +125,7 @@ public class FreeQueryController {
@RequestMapping
(
"/get-free-query-count"
)
@RequestMapping
(
"/get-free-query-count"
)
public
GeneralResult
getFreeQueryCount
(
String
sql
,
String
enterpriseId
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
GeneralResult
getFreeQueryCount
(
String
sql
,
String
enterpriseId
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
GeneralResult
result
=
new
GeneralResult
();
GeneralResult
result
=
new
GeneralResult
();
FreeQuerySource
freeQuerySource
=
this
.
freeQueryService
.
getFreeQuerySource
(
SessionContextUtils
.
getLoginUserEnterpriseId
());
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
.
FreeQuerySource
freeQuerySource
=
this
.
freeQueryService
.
getFreeQuerySource
(
SessionContextUtils
.
getLoginUserEnterpriseId
());
if
(
freeQuerySource
!=
null
){
if
(
freeQuerySource
!=
null
){
Date
expireTime
=
freeQuerySource
.
getDbExpiration
();
Date
expireTime
=
freeQuerySource
.
getDbExpiration
();
Integer
isPrivate
=
freeQuerySource
.
getIsPrivate
();
Integer
isPrivate
=
freeQuerySource
.
getIsPrivate
();
...
@@ -240,13 +235,13 @@ public class FreeQueryController {
...
@@ -240,13 +235,13 @@ public class FreeQueryController {
@RequestMapping
(
"/get-custom-database"
)
@RequestMapping
(
"/get-custom-database"
)
public
FreeQuerySource
VO
getCustomDatabase
(){
public
FreeQuerySource
getCustomDatabase
(){
FreeQuerySource
freeQuerySource
=
this
.
freeQueryService
.
getFreeQuerySource
(
SessionContextUtils
.
getLoginUserEnterpriseId
());
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
.
FreeQuerySource
freeQuerySource
=
this
.
freeQueryService
.
getFreeQuerySource
(
SessionContextUtils
.
getLoginUserEnterpriseId
());
if
(
freeQuerySource
==
null
){
if
(
freeQuerySource
==
null
){
freeQuerySource
=
new
FreeQuerySource
();
freeQuerySource
=
new
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
.
FreeQuerySource
();
freeQuerySource
.
setDatabase
(
this
.
enterpriseService
.
getEnterpriseById
(
SessionContextUtils
.
getLoginUserEnterpriseId
()).
getFactoryCode
());
freeQuerySource
.
setDatabase
(
this
.
enterpriseService
.
getEnterpriseById
(
SessionContextUtils
.
getLoginUserEnterpriseId
()).
getFactoryCode
());
}
}
return
EntityUtil
.
changeEntityNew
(
FreeQuerySource
VO
.
class
,
freeQuerySource
);
return
EntityUtil
.
changeEntityNew
(
FreeQuerySource
.
class
,
freeQuerySource
);
}
}
/**
/**
...
@@ -256,10 +251,10 @@ public class FreeQueryController {
...
@@ -256,10 +251,10 @@ public class FreeQueryController {
* @return
* @return
*/
*/
@RequestMapping
(
"/get-db-cache"
)
@RequestMapping
(
"/get-db-cache"
)
public
FreeQuerySource
cache
(
String
a
,
String
b
){
public
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
.
FreeQuerySource
cache
(
String
a
,
String
b
){
ServiceResponse
<
String
>
stringServiceResponse
=
this
.
freeQueryService
.
testCacheDb
(
a
,
b
);
ServiceResponse
<
String
>
stringServiceResponse
=
this
.
freeQueryService
.
testCacheDb
(
a
,
b
);
System
.
out
.
println
(
JSON
.
toJSONString
(
stringServiceResponse
));
System
.
out
.
println
(
JSON
.
toJSONString
(
stringServiceResponse
));
return
new
FreeQuerySource
();
return
new
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
.
FreeQuerySource
();
}
}
...
...
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