Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
a1c48261
Commit
a1c48261
authored
Jul 18, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加材料列表根据材料名称去重
parent
984989c0
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
2410 additions
and
240 deletions
+2410
-240
portal-manager/db/add.sql
portal-manager/db/add.sql
+20
-0
portal-manager/src/main/java/com/mortals/xhx/module/product/dao/ProductInterfaceLogDao.java
...ortals/xhx/module/product/dao/ProductInterfaceLogDao.java
+17
-0
portal-manager/src/main/java/com/mortals/xhx/module/product/dao/ibatis/ProductInterfaceLogDaoImpl.java
...module/product/dao/ibatis/ProductInterfaceLogDaoImpl.java
+21
-0
portal-manager/src/main/java/com/mortals/xhx/module/product/model/ProductInterfaceEntity.java
...tals/xhx/module/product/model/ProductInterfaceEntity.java
+33
-3
portal-manager/src/main/java/com/mortals/xhx/module/product/model/ProductInterfaceLogEntity.java
...s/xhx/module/product/model/ProductInterfaceLogEntity.java
+67
-0
portal-manager/src/main/java/com/mortals/xhx/module/product/model/ProductInterfaceLogQuery.java
...ls/xhx/module/product/model/ProductInterfaceLogQuery.java
+954
-0
portal-manager/src/main/java/com/mortals/xhx/module/product/model/ProductInterfaceQuery.java
...rtals/xhx/module/product/model/ProductInterfaceQuery.java
+248
-134
portal-manager/src/main/java/com/mortals/xhx/module/product/model/vo/ProductInterfaceLogVo.java
...ls/xhx/module/product/model/vo/ProductInterfaceLogVo.java
+19
-0
portal-manager/src/main/java/com/mortals/xhx/module/product/service/ProductInterfaceLogService.java
...hx/module/product/service/ProductInterfaceLogService.java
+16
-0
portal-manager/src/main/java/com/mortals/xhx/module/product/service/ProductInterfaceService.java
...s/xhx/module/product/service/ProductInterfaceService.java
+12
-9
portal-manager/src/main/java/com/mortals/xhx/module/product/service/impl/ProductInterfaceLogServiceImpl.java
.../product/service/impl/ProductInterfaceLogServiceImpl.java
+21
-0
portal-manager/src/main/java/com/mortals/xhx/module/product/service/impl/ProductInterfaceServiceImpl.java
...ule/product/service/impl/ProductInterfaceServiceImpl.java
+62
-9
portal-manager/src/main/java/com/mortals/xhx/module/product/web/ProductInterfaceLogController.java
...xhx/module/product/web/ProductInterfaceLogController.java
+49
-0
portal-manager/src/main/resources/sqlmap/module/product/ProductInterfaceLogMapper.xml
...urces/sqlmap/module/product/ProductInterfaceLogMapper.xml
+621
-0
portal-manager/src/main/resources/sqlmap/module/product/ProductInterfaceMapper.xml
...esources/sqlmap/module/product/ProductInterfaceMapper.xml
+191
-85
portal-manager/src/test/java/com/mortals/httpclient/product/ProductInterfaceLogController.http
...als/httpclient/product/ProductInterfaceLogController.http
+59
-0
No files found.
portal-manager/db/add.sql
0 → 100644
View file @
a1c48261
ALTER
TABLE
mortals_xhx_product_interface
ADD
COLUMN
`authInfo`
varchar
(
255
)
COMMENT
'授权信息'
;
ALTER
TABLE
mortals_xhx_product_interface
ADD
COLUMN
`flowInfo`
varchar
(
255
)
COMMENT
'流控信息'
;
-- ----------------------------
-- 产品接口表
-- ----------------------------
DROP
TABLE
IF
EXISTS
`mortals_xhx_product_interface_log`
;
CREATE
TABLE
mortals_xhx_product_interface_log
(
`id`
bigint
(
20
)
AUTO_INCREMENT
COMMENT
'序号,主键,自增长'
,
`interfaceId`
bigint
(
20
)
COMMENT
'接口id'
,
`requestParameters`
text
COMMENT
'请求参数'
,
`version`
varchar
(
255
)
COMMENT
'版本号'
,
`content`
varchar
(
255
)
COMMENT
'内容说明'
,
`remark`
varchar
(
255
)
COMMENT
'备注'
,
`createUserId`
bigint
(
20
)
NOT
NULL
COMMENT
'创建用户'
,
`createTime`
datetime
NOT
NULL
COMMENT
'创建时间'
,
`updateUserId`
bigint
(
20
)
COMMENT
'更新用户'
,
`updateTime`
datetime
COMMENT
'更新时间'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COMMENT
=
'产品接口'
;
portal-manager/src/main/java/com/mortals/xhx/module/product/dao/ProductInterfaceLogDao.java
0 → 100644
View file @
a1c48261
package
com.mortals.xhx.module.product.dao
;
import
com.mortals.framework.dao.ICRUDDao
;
import
com.mortals.xhx.module.product.model.ProductInterfaceLogEntity
;
import
java.util.List
;
/**
* 产品接口Dao
* 产品接口 DAO接口
*
* @author zxfei
* @date 2023-07-18
*/
public
interface
ProductInterfaceLogDao
extends
ICRUDDao
<
ProductInterfaceLogEntity
,
Long
>{
}
portal-manager/src/main/java/com/mortals/xhx/module/product/dao/ibatis/ProductInterfaceLogDaoImpl.java
0 → 100644
View file @
a1c48261
package
com.mortals.xhx.module.product.dao.ibatis
;
import
org.springframework.stereotype.Repository
;
import
com.mortals.xhx.module.product.dao.ProductInterfaceLogDao
;
import
com.mortals.xhx.module.product.model.ProductInterfaceLogEntity
;
import
java.util.Date
;
import
com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis
;
import
java.util.List
;
/**
* 产品接口DaoImpl DAO接口
*
* @author zxfei
* @date 2023-07-18
*/
@Repository
(
"productInterfaceLogDao"
)
public
class
ProductInterfaceLogDaoImpl
extends
BaseCRUDDaoMybatis
<
ProductInterfaceLogEntity
,
Long
>
implements
ProductInterfaceLogDao
{
}
portal-manager/src/main/java/com/mortals/xhx/module/product/model/ProductInterfaceEntity.java
View file @
a1c48261
package
com.mortals.xhx.module.product.model
;
import
java.util.List
;
import
java.util.List
;
import
java.util.ArrayList
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.mortals.framework.annotation.Excel
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.product.model.vo.ProductInterfaceVo
;
import
com.mortals.xhx.module.product.model.ProductInterfaceLogEntity
;
import
lombok.Data
;
/**
* 产品接口实体对象
*
* @author zxfei
* @date 2023-0
5-29
* @date 2023-0
7-18
*/
@Data
public
class
ProductInterfaceEntity
extends
ProductInterfaceVo
{
...
...
@@ -38,7 +45,7 @@ public class ProductInterfaceEntity extends ProductInterfaceVo {
/**
* 超时时间(秒)
*/
private
Long
timeoutValue
;
private
Integer
timeoutValue
;
/**
* 限流策略1:分钟,2:小时
*/
...
...
@@ -91,6 +98,25 @@ public class ProductInterfaceEntity extends ProductInterfaceVo {
* 异常返回示例
*/
private
String
abnormalResponse
;
/**
* 授权信息
*/
private
String
authInfo
;
/**
* 流控信息
*/
private
String
flowInfo
;
/**
* 产品接口信息
*/
private
List
<
ProductInterfaceLogEntity
>
productInterfaceLogList
=
new
ArrayList
<>();;
public
List
<
ProductInterfaceLogEntity
>
getProductInterfaceLogList
(){
return
productInterfaceLogList
;
}
public
void
setProductInterfaceLogList
(
List
<
ProductInterfaceLogEntity
>
productInterfaceLogList
){
this
.
productInterfaceLogList
=
productInterfaceLogList
;
}
@Override
public
int
hashCode
()
{
return
this
.
getId
().
hashCode
();
...
...
@@ -121,7 +147,7 @@ public class ProductInterfaceEntity extends ProductInterfaceVo {
this
.
requestUrl
=
""
;
this
.
timeoutValue
=
-
1
L
;
this
.
timeoutValue
=
-
1
;
this
.
limitStrategy
=
-
1
;
...
...
@@ -148,5 +174,9 @@ public class ProductInterfaceEntity extends ProductInterfaceVo {
this
.
normalResponse
=
""
;
this
.
abnormalResponse
=
""
;
this
.
authInfo
=
""
;
this
.
flowInfo
=
""
;
}
}
\ No newline at end of file
portal-manager/src/main/java/com/mortals/xhx/module/product/model/ProductInterfaceLogEntity.java
0 → 100644
View file @
a1c48261
package
com.mortals.xhx.module.product.model
;
import
java.util.List
;
import
java.util.ArrayList
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.mortals.framework.annotation.Excel
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.product.model.vo.ProductInterfaceLogVo
;
import
lombok.Data
;
/**
* 产品接口实体对象
*
* @author zxfei
* @date 2023-07-18
*/
@Data
public
class
ProductInterfaceLogEntity
extends
ProductInterfaceLogVo
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 接口id
*/
private
Long
interfaceId
;
/**
* 请求参数
*/
private
String
requestParameters
;
/**
* 版本号
*/
private
String
version
;
/**
* 内容说明
*/
private
String
content
;
/**
* 备注
*/
private
String
remark
;
@Override
public
int
hashCode
()
{
return
this
.
getId
().
hashCode
();
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
obj
==
null
)
return
false
;
if
(
obj
instanceof
ProductInterfaceLogEntity
)
{
ProductInterfaceLogEntity
tmp
=
(
ProductInterfaceLogEntity
)
obj
;
if
(
this
.
getId
()
==
tmp
.
getId
())
{
return
true
;
}
}
return
false
;
}
public
void
initAttrValue
(){
this
.
interfaceId
=
-
1L
;
this
.
requestParameters
=
""
;
this
.
version
=
""
;
this
.
content
=
""
;
this
.
remark
=
""
;
}
}
\ No newline at end of file
portal-manager/src/main/java/com/mortals/xhx/module/product/model/ProductInterfaceLogQuery.java
0 → 100644
View file @
a1c48261
This diff is collapsed.
Click to expand it.
portal-manager/src/main/java/com/mortals/xhx/module/product/model/ProductInterfaceQuery.java
View file @
a1c48261
This diff is collapsed.
Click to expand it.
portal-manager/src/main/java/com/mortals/xhx/module/product/model/vo/ProductInterfaceLogVo.java
0 → 100644
View file @
a1c48261
package
com.mortals.xhx.module.product.model.vo
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.product.model.ProductInterfaceLogEntity
;
import
java.util.ArrayList
;
import
java.util.List
;
import
lombok.Data
;
import
com.mortals.framework.annotation.Excel
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 产品接口视图对象
*
* @author zxfei
* @date 2023-07-18
*/
@Data
public
class
ProductInterfaceLogVo
extends
BaseEntityLong
{
}
\ No newline at end of file
portal-manager/src/main/java/com/mortals/xhx/module/product/service/ProductInterfaceLogService.java
0 → 100644
View file @
a1c48261
package
com.mortals.xhx.module.product.service
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.product.model.ProductInterfaceLogEntity
;
import
com.mortals.xhx.module.product.dao.ProductInterfaceLogDao
;
/**
* ProductInterfaceLogService
*
* 产品接口 service接口
*
* @author zxfei
* @date 2023-07-18
*/
public
interface
ProductInterfaceLogService
extends
ICRUDService
<
ProductInterfaceLogEntity
,
Long
>{
ProductInterfaceLogDao
getDao
();
}
\ No newline at end of file
portal-manager/src/main/java/com/mortals/xhx/module/product/service/ProductInterfaceService.java
View file @
a1c48261
package
com.mortals.xhx.module.product.service
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.product.dao.ProductInterfaceDao
;
import
com.mortals.xhx.module.product.model.ProductInterfaceEntity
;
/**
* ProductInterfaceService
*
* 产品接口 service接口
*
* @author zxfei
* @date 2023-02-22
*/
public
interface
ProductInterfaceService
extends
ICRUDService
<
ProductInterfaceEntity
,
Long
>{
/**
* ProductInterfaceService
* <p>
* 产品接口 service接口
*
* @author zxfei
* @date 2023-02-22
*/
public
interface
ProductInterfaceService
extends
ICRUDService
<
ProductInterfaceEntity
,
Long
>
{
ProductInterfaceDao
getDao
();
}
\ No newline at end of file
portal-manager/src/main/java/com/mortals/xhx/module/product/service/impl/ProductInterfaceLogServiceImpl.java
0 → 100644
View file @
a1c48261
package
com.mortals.xhx.module.product.service.impl
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.xhx.module.product.dao.ProductInterfaceLogDao
;
import
com.mortals.xhx.module.product.model.ProductInterfaceLogEntity
;
import
com.mortals.xhx.module.product.service.ProductInterfaceLogService
;
import
lombok.extern.slf4j.Slf4j
;
/**
* ProductInterfaceLogService
* 产品接口 service实现
*
* @author zxfei
* @date 2023-07-18
*/
@Service
(
"productInterfaceLogService"
)
@Slf4j
public
class
ProductInterfaceLogServiceImpl
extends
AbstractCRUDServiceImpl
<
ProductInterfaceLogDao
,
ProductInterfaceLogEntity
,
Long
>
implements
ProductInterfaceLogService
{
}
\ No newline at end of file
portal-manager/src/main/java/com/mortals/xhx/module/product/service/impl/ProductInterfaceServiceImpl.java
View file @
a1c48261
package
com.mortals.xhx.module.product.service.impl
;
import
com.mortals.framework.util.StringUtils
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
...
...
@@ -7,25 +8,77 @@ import com.mortals.framework.model.Context;
import
com.mortals.xhx.module.product.dao.ProductInterfaceDao
;
import
com.mortals.xhx.module.product.model.ProductInterfaceEntity
;
import
com.mortals.xhx.module.product.service.ProductInterfaceService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
com.mortals.xhx.module.product.model.ProductInterfaceLogEntity
;
import
com.mortals.xhx.module.product.model.ProductInterfaceLogQuery
;
import
com.mortals.xhx.module.product.service.ProductInterfaceLogService
;
import
org.springframework.util.ObjectUtils
;
import
java.util.Date
;
import
java.util.Arrays
;
import
java.util.List
;
import
lombok.extern.slf4j.Slf4j
;
/**
* ProductInterfaceService
* 产品接口 service实现
*
* @author zxfei
* @date 2023-02-22
*/
* ProductInterfaceService
* 产品接口 service实现
*
* @author zxfei
* @date 2023-07-18
*/
@Service
(
"productInterfaceService"
)
@Slf4j
public
class
ProductInterfaceServiceImpl
extends
AbstractCRUDServiceImpl
<
ProductInterfaceDao
,
ProductInterfaceEntity
,
Long
>
implements
ProductInterfaceService
{
@Autowired
private
ProductInterfaceLogService
productInterfaceLogService
;
@Override
protected
void
saveAfter
(
ProductInterfaceEntity
entity
,
Context
context
)
throws
AppException
{
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getProductInterfaceLogList
()))
{
entity
.
getProductInterfaceLogList
().
stream
().
peek
(
item
->
{
item
.
setInterfaceId
(
entity
.
getId
());
item
.
setCreateUserId
(
this
.
getContextUserId
(
context
));
item
.
setCreateTime
(
new
Date
());
}).
count
();
productInterfaceLogService
.
save
(
entity
.
getProductInterfaceLogList
());
}
super
.
saveAfter
(
entity
,
context
);
}
@Override
protected
void
updateAfter
(
ProductInterfaceEntity
entity
,
Context
context
)
throws
AppException
{
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getProductInterfaceLogList
()))
{
// Long[] productInterfaceLogIds = productInterfaceLogService.find(new ProductInterfaceLogQuery().interfaceId(entity.getId())).stream().map(ProductInterfaceLogEntity::getId).toArray(Long[]::new);
// productInterfaceLogService.remove(productInterfaceLogIds, context);
entity
.
getProductInterfaceLogList
().
stream
().
peek
(
item
->
{
item
.
setInterfaceId
(
entity
.
getId
());
item
.
setCreateUserId
(
this
.
getContextUserId
(
context
));
item
.
setCreateTime
(
new
Date
());
item
.
setUpdateUserId
(
this
.
getContextUserId
(
context
));
item
.
setUpdateTime
(
new
Date
());
}).
count
();
productInterfaceLogService
.
save
(
entity
.
getProductInterfaceLogList
());
}
super
.
updateAfter
(
entity
,
context
);
}
@Override
protected
void
removeAfter
(
Long
[]
ids
,
Context
context
,
int
result
)
throws
AppException
{
List
<
ProductInterfaceLogEntity
>
productInterfaceLoglist
=
productInterfaceLogService
.
find
(
new
ProductInterfaceLogQuery
().
interfaceIdList
(
Arrays
.
asList
(
ids
)));
productInterfaceLogService
.
removeList
(
productInterfaceLoglist
,
context
);
super
.
removeAfter
(
ids
,
context
,
result
);
}
@Override
protected
void
validData
(
ProductInterfaceEntity
entity
,
Context
context
)
throws
AppException
{
if
(
entity
.
getProductId
()==
null
)
{
if
(
entity
.
getProductId
()
==
null
)
{
throw
new
AppException
(
"产品id不能为空"
);
}
if
(
StringUtils
.
isEmpty
(
entity
.
getInterfaceName
()))
{
if
(
StringUtils
.
isEmpty
(
entity
.
getInterfaceName
()))
{
throw
new
AppException
(
"接口名称不能为空"
);
}
if
(
StringUtils
.
isEmpty
(
entity
.
getVersionNumber
()))
{
if
(
StringUtils
.
isEmpty
(
entity
.
getVersionNumber
()))
{
throw
new
AppException
(
"版本号不能为空"
);
}
}
...
...
portal-manager/src/main/java/com/mortals/xhx/module/product/web/ProductInterfaceLogController.java
0 → 100644
View file @
a1c48261
package
com.mortals.xhx.module.product.web
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
com.mortals.framework.model.Context
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.module.product.model.ProductInterfaceLogEntity
;
import
com.mortals.xhx.module.product.service.ProductInterfaceLogService
;
import
org.apache.commons.lang3.ArrayUtils
;
import
com.mortals.framework.util.StringUtils
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.JSONObject
;
import
java.util.Arrays
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
static
com
.
mortals
.
framework
.
ap
.
SysConstains
.*;
/**
*
* 产品接口
*
* @author zxfei
* @date 2023-07-18
*/
@RestController
@RequestMapping
(
"product/interface/log"
)
public
class
ProductInterfaceLogController
extends
BaseCRUDJsonBodyMappingController
<
ProductInterfaceLogService
,
ProductInterfaceLogEntity
,
Long
>
{
@Autowired
private
ParamService
paramService
;
public
ProductInterfaceLogController
(){
super
.
setModuleDesc
(
"产品接口"
);
}
@Override
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
super
.
init
(
model
,
context
);
}
}
\ No newline at end of file
portal-manager/src/main/resources/sqlmap/module/product/ProductInterfaceLogMapper.xml
0 → 100644
View file @
a1c48261
This diff is collapsed.
Click to expand it.
portal-manager/src/main/resources/sqlmap/module/product/ProductInterfaceMapper.xml
View file @
a1c48261
This diff is collapsed.
Click to expand it.
portal-manager/src/test/java/com/mortals/httpclient/product/ProductInterfaceLogController.http
0 → 100644
View file @
a1c48261
###登录
POST {{baseUrl}}/login/login
Content-Type: application/json
{
"loginName":"admin",
"password":"admin",
"securityCode":"8888"
}
> {%
client.global.set("SmsSet_id", JSON.parse(response.body).data.id);
client.global.set("authToken", JSON.parse(response.body).data.token);
%}
###产品接口列表
POST {{baseUrl}}/product/interface/log/list
Content-Type: application/json
{
"page":1,
"size":10
}
###产品接口更新与保存
POST {{baseUrl}}/product/interface/log/save
Authorization: {{authToken}}
Content-Type: application/json
{
"interfaceId":62,
"requestParameters":"pb92dy",
"version":"8lkpuh",
"content":"e7kwqt",
"remark":"riyuuu",
}
> {%
client.global.set("ProductInterfaceLog_id", JSON.parse(response.body).data.id);
%}
###产品接口查看
GET {{baseUrl}}/product/interface/log/info?id={{ProductInterfaceLog_id}}
Accept: application/json
###产品接口编辑
GET {{baseUrl}}/product/interface/log/edit?id={{ProductInterfaceLog_id}}
Accept: application/json
###产品接口删除
GET {{baseUrl}}/product/interface/log/delete?id={{ProductInterfaceLog_id}}
Authorization: {{authToken}}
Accept: application/json
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