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
87a150a7
Commit
87a150a7
authored
May 12, 2022
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
字段限制
parent
d0077ff7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
0 deletions
+79
-0
FieldSizeQuery.java
.../java/com/gic/cloud/data/hook/api/dto/FieldSizeQuery.java
+15
-0
FlatQueryController.java
...java/com/gic/cloud/data/hook/web/FlatQueryController.java
+64
-0
No files found.
gic-cloud-data-hook-api/src/main/java/com/gic/cloud/data/hook/api/dto/FieldSizeQuery.java
0 → 100644
View file @
87a150a7
package
com
.
gic
.
cloud
.
data
.
hook
.
api
.
dto
;
import
java.io.Serializable
;
public
class
FieldSizeQuery
implements
Serializable
{
private
int
size
;
public
int
getSize
()
{
return
size
;
}
public
void
setSize
(
int
size
)
{
this
.
size
=
size
;
}
}
gic-cloud-data-hook/src/main/java/com/gic/cloud/data/hook/web/FlatQueryController.java
View file @
87a150a7
package
com
.
gic
.
cloud
.
data
.
hook
.
web
;
import
com.alibaba.fastjson.JSONObject
;
import
com.ctrip.framework.apollo.Config
;
import
com.ctrip.framework.apollo.ConfigService
;
import
com.gic.clerk.api.constant.ThirdProjectEnum
;
import
com.gic.clerk.api.dto.AuthorizedUser
;
import
com.gic.clerk.api.dto.PowerClerkDTO
;
...
...
@@ -24,6 +27,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
...
@@ -43,6 +47,8 @@ public class FlatQueryController {
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
FlatQueryController
.
class
);
private
static
final
int
FIELD_SIZE
=
100
;
/** 脱敏字段 */
public
static
final
List
<
String
>
FILTERS_PHONE_ONLY
=
Arrays
.
asList
(
"mobile"
,
"phone"
,
"enterprise_name"
,
"phone_number"
,
"receive_phone_number"
,
"use_phone_number"
,
"friend_phone_num"
,
"from_phone_num"
);
...
...
@@ -207,6 +213,64 @@ public class FlatQueryController {
return
result
;
}
/** 获取自助查询下载量评估
* @param tableId
* @param request
* @param response
* @return
*/
@RequestMapping
(
"/get-query-field-size"
)
public
FieldSizeQuery
getQueryFieldSize
(
String
tableId
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
FieldSizeQuery
result
=
new
FieldSizeQuery
();
if
(
StringUtils
.
isEmpty
(
tableId
))
{
logger
.
info
(
"参数缺失tableID"
);
result
.
setSize
(
FIELD_SIZE
);
return
result
;
}
String
enterpriseId
=
SessionContextUtils
.
getLoginUserEnterpriseId
();
int
fieldSize
=
getFieldSize
(
enterpriseId
,
tableId
);
result
.
setSize
(
fieldSize
);
return
result
;
}
private
int
getFieldSize
(
String
enterpriseId
,
String
tableId
)
{
Config
appConfig
=
ConfigService
.
getAppConfig
();
String
fieldSizeConfig
=
appConfig
.
getProperty
(
"field.size"
,
""
);
if
(
StringUtils
.
isEmpty
(
fieldSizeConfig
))
{
logger
.
info
(
"没有在apoll配置"
);
return
FIELD_SIZE
;
}
JSONObject
config
=
JSONObject
.
parseObject
(
fieldSizeConfig
);
JSONObject
defaultConfig
=
config
.
getJSONObject
(
"default"
);
JSONObject
tableConfig
=
config
.
getJSONObject
(
tableId
);
if
(
null
==
tableConfig
&&
defaultConfig
==
null
)
{
return
FIELD_SIZE
;
}
Integer
num
=
null
;
if
(
tableConfig
!=
null
){
num
=
tableConfig
.
getInteger
(
enterpriseId
);
if
(
num
!=
null
)
{
return
num
;
}
num
=
tableConfig
.
getInteger
(
"common"
);
if
(
num
!=
null
)
{
return
num
;
}
}
if
(
defaultConfig
!=
null
)
{
num
=
defaultConfig
.
getInteger
(
enterpriseId
);
if
(
num
!=
null
)
{
return
num
;
}
num
=
defaultConfig
.
getInteger
(
"common"
);
if
(
num
!=
null
)
{
return
num
;
}
}
return
FIELD_SIZE
;
}
/** 生成自助查询下载任务
* @param executeRequest
* @param request
...
...
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