【新增】获取飞行记录接口
This commit is contained in:
64
src/main/java/com/corewing/app/entity/ReplaySession.java
Normal file
64
src/main/java/com/corewing/app/entity/ReplaySession.java
Normal file
@@ -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;
|
||||
}
|
||||
@@ -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<ReplaySession> {
|
||||
}
|
||||
@@ -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<List<ReplaySession>> getReplayList() {
|
||||
return Result.success(replaySessionService.getReplayList(StpUtil.getLoginId()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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<ReplaySession> {
|
||||
List<ReplaySession> getReplayList(Object loginId);
|
||||
}
|
||||
@@ -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<ReplaySessionMapper, ReplaySession> implements ReplaySessionService {
|
||||
@Override
|
||||
public List<ReplaySession> getReplayList(Object loginId) {
|
||||
LambdaQueryWrapper<ReplaySession> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ReplaySession::getUserId, loginId);
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user