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); + } +}