⚡ 修改终端提示.
This commit is contained in:
@@ -63,7 +63,7 @@ public class AssetAuthorizedDataServiceController {
|
||||
@IgnoreLog(IgnoreLogMode.RET)
|
||||
@GetMapping("/current-host")
|
||||
@Operation(summary = "查询当前用户已授权的主机")
|
||||
public AuthorizedHostWrapperVO getCurrentAuthorizedHost(@RequestParam("type") String type) {
|
||||
public AuthorizedHostWrapperVO getCurrentAuthorizedHost(@RequestParam(value = "type", required = false) String type) {
|
||||
return assetAuthorizedDataService.getUserAuthorizedHost(SecurityUtils.getLoginUserId(), type);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,17 @@ public interface TerminalConnectLogDAO extends IMapper<TerminalConnectLogDO> {
|
||||
* @param limit limit
|
||||
* @return hostId
|
||||
*/
|
||||
List<Long> selectLatestConnectHostId(@Param("userId") Long userId, @Param("type") String type, @Param("limit") Integer limit);
|
||||
default List<Long> selectLatestConnectHostId(Long userId, String type, Integer limit) {
|
||||
return this.of()
|
||||
.createWrapper(true)
|
||||
.select(TerminalConnectLogDO::getHostId)
|
||||
.eq(TerminalConnectLogDO::getUserId, userId)
|
||||
.eq(TerminalConnectLogDO::getType, type)
|
||||
.orderByDesc(TerminalConnectLogDO::getId)
|
||||
.then()
|
||||
.limit(limit)
|
||||
.list(TerminalConnectLogDO::getHostId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询终端连接日志用户数量
|
||||
|
||||
@@ -33,16 +33,6 @@
|
||||
id, user_id, username, host_id, host_name, host_address, type, session_id, status, start_time, end_time, extra_info, create_time, update_time, deleted
|
||||
</sql>
|
||||
|
||||
<select id="selectLatestConnectHostId" resultType="java.lang.Long">
|
||||
SELECT host_id
|
||||
FROM terminal_connect_log
|
||||
WHERE deleted = 0
|
||||
AND type = #{type}
|
||||
AND user_id = #{userId}
|
||||
ORDER BY id DESC
|
||||
LIMIT #{limit}
|
||||
</select>
|
||||
|
||||
<select id="selectConnectLogUserCount" resultMap="CountResultMap">
|
||||
SELECT DATE(create_time) connect_date, COUNT(1) total_count
|
||||
FROM terminal_connect_log
|
||||
|
||||
Reference in New Issue
Block a user