From 8bbb3ac38f230d56e3d607a5d1ef2b1e091c9fc3 Mon Sep 17 00:00:00 2001 From: MichaelWin Date: Mon, 17 Nov 2025 18:28:20 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E9=A3=9E=E8=A1=8C=E8=AE=B0=E5=BD=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../corewing/app/entity/ReplaySession.java | 64 +++++++++++++++++++ .../app/mapper/ReplaySessionMapper.java | 9 +++ .../app/AppReplaySessionController.java | 26 ++++++++ .../app/service/ReplaySessionService.java | 11 ++++ .../impl/ReplaySessionServiceImpl.java | 20 ++++++ 5 files changed, 130 insertions(+) create mode 100644 src/main/java/com/corewing/app/entity/ReplaySession.java create mode 100644 src/main/java/com/corewing/app/mapper/ReplaySessionMapper.java create mode 100644 src/main/java/com/corewing/app/modules/app/AppReplaySessionController.java create mode 100644 src/main/java/com/corewing/app/service/ReplaySessionService.java create mode 100644 src/main/java/com/corewing/app/service/impl/ReplaySessionServiceImpl.java diff --git a/src/main/java/com/corewing/app/entity/ReplaySession.java b/src/main/java/com/corewing/app/entity/ReplaySession.java new file mode 100644 index 0000000..514020b --- /dev/null +++ b/src/main/java/com/corewing/app/entity/ReplaySession.java @@ -0,0 +1,64 @@ +package com.corewing.app.entity; + +import lombok.Data; + +import java.util.Date; + +@Data +public class ReplaySession { + + /** + * id + */ + private Long id; + + /** + * 用户id + */ + private Long userId; + + /** + * 名称 + */ + private String name; + + /** + * oss地址 + */ + private String ossPath; + + /** + * 描述 + */ + private String description; + + /** + * 开始时间戳 + */ + private Long startTime; + + /** + * 结束时间戳 + */ + private Long endTime; + + /** + * 持续时间 + */ + private Long duration; + + /** + * 数据点 + */ + private Long dataCount; + + /** + * 创建时间 + */ + private Date createdAt; + + /** + * 更新时间 + */ + private Date updatedAt; +} diff --git a/src/main/java/com/corewing/app/mapper/ReplaySessionMapper.java b/src/main/java/com/corewing/app/mapper/ReplaySessionMapper.java new file mode 100644 index 0000000..b509a57 --- /dev/null +++ b/src/main/java/com/corewing/app/mapper/ReplaySessionMapper.java @@ -0,0 +1,9 @@ +package com.corewing.app.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.corewing.app.entity.ReplaySession; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface ReplaySessionMapper extends BaseMapper { +} diff --git a/src/main/java/com/corewing/app/modules/app/AppReplaySessionController.java b/src/main/java/com/corewing/app/modules/app/AppReplaySessionController.java new file mode 100644 index 0000000..f079c43 --- /dev/null +++ b/src/main/java/com/corewing/app/modules/app/AppReplaySessionController.java @@ -0,0 +1,26 @@ +package com.corewing.app.modules.app; + +import cn.dev33.satoken.stp.StpUtil; +import com.corewing.app.common.Result; +import com.corewing.app.entity.ReplaySession; +import com.corewing.app.service.ReplaySessionService; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.List; + +@RestController +@RequestMapping("/replay-session") +public class AppReplaySessionController { + + @Resource + private ReplaySessionService replaySessionService; + + @GetMapping("/getReplayList") + public Result> getReplayList() { + return Result.success(replaySessionService.getReplayList(StpUtil.getLoginId())); + } + +} diff --git a/src/main/java/com/corewing/app/service/ReplaySessionService.java b/src/main/java/com/corewing/app/service/ReplaySessionService.java new file mode 100644 index 0000000..adfdf73 --- /dev/null +++ b/src/main/java/com/corewing/app/service/ReplaySessionService.java @@ -0,0 +1,11 @@ +package com.corewing.app.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.corewing.app.entity.ReplaySession; + +import java.util.List; + + +public interface ReplaySessionService extends IService { + List getReplayList(Object loginId); +} diff --git a/src/main/java/com/corewing/app/service/impl/ReplaySessionServiceImpl.java b/src/main/java/com/corewing/app/service/impl/ReplaySessionServiceImpl.java new file mode 100644 index 0000000..5dbba4c --- /dev/null +++ b/src/main/java/com/corewing/app/service/impl/ReplaySessionServiceImpl.java @@ -0,0 +1,20 @@ +package com.corewing.app.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.corewing.app.entity.ReplaySession; +import com.corewing.app.mapper.ReplaySessionMapper; +import com.corewing.app.service.ReplaySessionService; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class ReplaySessionServiceImpl extends ServiceImpl implements ReplaySessionService { + @Override + public List getReplayList(Object loginId) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ReplaySession::getUserId, loginId); + return this.list(queryWrapper); + } +}