Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
Nse
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
吴超
Nse
Commits
3ba59f4c
Commit
3ba59f4c
authored
Aug 19, 2025
by
wuchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新版本
parent
f1dd4197
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
267 行增加
和
0 行删除
+267
-0
src/main/java/com/chenyang/nse/bussiness/controller/restfulapi/ApiInfoLogController.java
+37
-0
src/main/java/com/chenyang/nse/bussiness/dao/table/core/api/ApiInfoDao.java
+21
-0
src/main/java/com/chenyang/nse/bussiness/dao/table/core/api/ApiInfoLogDao.java
+9
-0
src/main/java/com/chenyang/nse/bussiness/entity/orm/table/core/api/ApiInfoLog.java
+110
-0
src/main/java/com/chenyang/nse/bussiness/service/core/api/ApiInfoLogService.java
+13
-0
src/main/java/com/chenyang/nse/bussiness/service/core/api/impl/ApiInfoLogServiceImpl.java
+61
-0
src/main/resources/sql/apiinfo.xml
+16
-0
没有找到文件。
src/main/java/com/chenyang/nse/bussiness/controller/restfulapi/ApiInfoLogController.java
0 → 100644
View file @
3ba59f4c
package
com
.
chenyang
.
nse
.
bussiness
.
controller
.
restfulapi
;
import
com.chenyang.nse.bussiness.entity.orm.table.core.api.ApiInfoLog
;
import
com.chenyang.nse.bussiness.service.core.api.ApiInfoLogService
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
@Controller
@RequestMapping
({
"/core/apiinfolog"
})
public
class
ApiInfoLogController
{
@Autowired
private
ApiInfoLogService
apiInfoLogService
;
@RequestMapping
public
String
index
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
return
"core/api/apiinfolog"
;
}
@RequestMapping
({
"/query"
})
@ResponseBody
public
List
<
ApiInfoLog
>
query
(
String
username
,
String
apitype
,
String
calldatetime
,
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
Map
<
String
,
String
>
condMap
=
new
HashMap
();
condMap
.
put
(
"username"
,
username
);
condMap
.
put
(
"apitype"
,
apitype
);
condMap
.
put
(
"calldatetime"
,
calldatetime
);
List
<
ApiInfoLog
>
list
=
this
.
apiInfoLogService
.
queryInfoByConditon
(
condMap
);
return
list
;
}
}
src/main/java/com/chenyang/nse/bussiness/dao/table/core/api/ApiInfoDao.java
0 → 100644
View file @
3ba59f4c
package
com
.
chenyang
.
nse
.
bussiness
.
dao
.
table
.
core
.
api
;
import
com.chenyang.nse.bussiness.dao.BaseDao
;
import
com.chenyang.nse.bussiness.entity.orm.table.core.api.ApiInfo
;
import
com.chenyang.nse.bussiness.tools.xml.XmlTool
;
import
org.springframework.stereotype.Repository
;
@Repository
public
class
ApiInfoDao
extends
BaseDao
<
ApiInfo
,
String
>
{
public
int
releaseByTreeId
(
String
treeid
)
{
String
sql
=
XmlTool
.
getSql
(
"apiinfo"
,
"releasebytreeId"
);
int
i
=
this
.
getSession
().
createNativeQuery
(
sql
).
setParameter
(
"treeid"
,
treeid
).
executeUpdate
();
return
i
;
}
public
int
releaseAll
()
{
String
sql
=
XmlTool
.
getSql
(
"apiinfo"
,
"releaseall"
);
int
i
=
this
.
getSession
().
createNativeQuery
(
sql
).
executeUpdate
();
return
i
;
}
}
src/main/java/com/chenyang/nse/bussiness/dao/table/core/api/ApiInfoLogDao.java
0 → 100644
View file @
3ba59f4c
package
com
.
chenyang
.
nse
.
bussiness
.
dao
.
table
.
core
.
api
;
import
com.chenyang.nse.bussiness.dao.BaseDao
;
import
com.chenyang.nse.bussiness.entity.orm.table.core.api.ApiInfoLog
;
import
org.springframework.stereotype.Repository
;
@Repository
public
class
ApiInfoLogDao
extends
BaseDao
<
ApiInfoLog
,
String
>
{
}
src/main/java/com/chenyang/nse/bussiness/entity/orm/table/core/api/ApiInfoLog.java
0 → 100644
View file @
3ba59f4c
package
com
.
chenyang
.
nse
.
bussiness
.
entity
.
orm
.
table
.
core
.
api
;
import
com.chenyang.nse.bussiness.entity.orm.table.TBaseEntity
;
import
java.util.Date
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
@Entity
@Table
(
name
=
"api_info_log"
)
public
class
ApiInfoLog
extends
TBaseEntity
{
private
String
username
;
private
String
url
;
private
Date
calldatetime
;
private
String
apitype
;
@Column
(
length
=
32
)
private
String
restatus
;
private
String
authorization
;
@Column
(
length
=
512
)
private
String
remsg
;
private
String
apiinfoid
;
private
Date
createtime
;
private
String
cilentip
;
public
String
getUsername
()
{
return
this
.
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
Date
getCalldatetime
()
{
return
this
.
calldatetime
;
}
public
void
setCalldatetime
(
Date
calldatetime
)
{
this
.
calldatetime
=
calldatetime
;
}
public
String
getApitype
()
{
return
this
.
apitype
;
}
public
void
setApitype
(
String
apitype
)
{
this
.
apitype
=
apitype
;
}
public
String
getRestatus
()
{
return
this
.
restatus
;
}
public
void
setRestatus
(
String
restatus
)
{
this
.
restatus
=
restatus
;
}
public
String
getAuthorization
()
{
return
this
.
authorization
;
}
public
void
setAuthorization
(
String
authorization
)
{
this
.
authorization
=
authorization
;
}
public
String
getRemsg
()
{
return
this
.
remsg
;
}
public
void
setRemsg
(
String
remsg
)
{
this
.
remsg
=
remsg
;
}
public
String
getApiinfoid
()
{
return
this
.
apiinfoid
;
}
public
void
setApiinfoid
(
String
apiinfoid
)
{
this
.
apiinfoid
=
apiinfoid
;
}
public
Date
getCreatetime
()
{
return
this
.
createtime
;
}
public
void
setCreatetime
(
Date
createtime
)
{
this
.
createtime
=
createtime
;
}
public
String
getUrl
()
{
return
this
.
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getCilentip
()
{
return
this
.
cilentip
;
}
public
void
setCilentip
(
String
cilentip
)
{
this
.
cilentip
=
cilentip
;
}
}
src/main/java/com/chenyang/nse/bussiness/service/core/api/ApiInfoLogService.java
0 → 100644
View file @
3ba59f4c
package
com
.
chenyang
.
nse
.
bussiness
.
service
.
core
.
api
;
import
com.chenyang.nse.bussiness.entity.orm.table.core.api.ApiInfoLog
;
import
java.util.List
;
import
java.util.Map
;
public
interface
ApiInfoLogService
{
List
<
ApiInfoLog
>
querylist
();
List
<
ApiInfoLog
>
queryInfoByConditon
(
Map
<
String
,
String
>
condMap
);
void
save
(
ApiInfoLog
info
);
}
src/main/java/com/chenyang/nse/bussiness/service/core/api/impl/ApiInfoLogServiceImpl.java
0 → 100644
View file @
3ba59f4c
package
com
.
chenyang
.
nse
.
bussiness
.
service
.
core
.
api
.
impl
;
import
com.chenyang.nse.bussiness.dao.table.core.api.ApiInfoLogDao
;
import
com.chenyang.nse.bussiness.entity.orm.table.core.api.ApiInfoLog
;
import
com.chenyang.nse.bussiness.service.core.api.ApiInfoLogService
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.lang.StringUtils
;
import
org.hibernate.Criteria
;
import
org.hibernate.criterion.Order
;
import
org.hibernate.criterion.Restrictions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
@Service
@Transactional
public
class
ApiInfoLogServiceImpl
implements
ApiInfoLogService
{
@Autowired
private
ApiInfoLogDao
apiInfoLogDao
;
public
List
<
ApiInfoLog
>
querylist
()
{
List
<
ApiInfoLog
>
list
=
this
.
apiInfoLogDao
.
queryAll
();
return
list
;
}
public
List
<
ApiInfoLog
>
queryInfoByConditon
(
Map
<
String
,
String
>
condMap
)
{
Criteria
criteria
=
this
.
apiInfoLogDao
.
createCriteria
();
if
(
condMap
.
containsKey
(
"username"
)
&&
StringUtils
.
isNotBlank
((
String
)
condMap
.
get
(
"username"
)))
{
criteria
.
add
(
Restrictions
.
like
(
"username"
,
"%"
+
(
String
)
condMap
.
get
(
"username"
)
+
"%"
));
}
if
(
condMap
.
containsKey
(
"apitype"
)
&&
StringUtils
.
isNotBlank
((
String
)
condMap
.
get
(
"apitype"
)))
{
criteria
.
add
(
Restrictions
.
eq
(
"apitype"
,
condMap
.
get
(
"apitype"
)));
}
criteria
.
addOrder
(
Order
.
desc
(
"calldatetime"
));
List
<
ApiInfoLog
>
list
=
this
.
apiInfoLogDao
.
queryAll
(
criteria
);
if
(
condMap
.
containsKey
(
"calldatetime"
)
&&
StringUtils
.
isNotBlank
((
String
)
condMap
.
get
(
"calldatetime"
)))
{
List
<
ApiInfoLog
>
querylist
=
new
ArrayList
();
for
(
ApiInfoLog
record
:
list
)
{
SimpleDateFormat
fmt
=
new
SimpleDateFormat
(
"yyyy-MM-dd hh:mm:ss"
);
String
date
=
fmt
.
format
(
record
.
getCalldatetime
()).
substring
(
0
,
10
);
if
(((
String
)
condMap
.
get
(
"calldatetime"
)).
contains
(
date
))
{
querylist
.
add
(
record
);
}
}
return
querylist
;
}
else
{
return
list
;
}
}
public
void
save
(
ApiInfoLog
info
)
{
this
.
apiInfoLogDao
.
save
(
info
);
}
}
src/main/resources/sql/apiinfo.xml
0 → 100644
View file @
3ba59f4c
<?xml version="1.0" encoding="UTF-8"?>
<sqls>
<select
id=
"releasebytreeId"
>
UPDATE api_info
SET state = '1'
WHERE
taskId = :treeid
</select>
<select
id=
"releaseall"
>
UPDATE api_info
SET state = '1'
</select>
</sqls>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论