mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-12-22 18:29:51 +08:00
资源video的时长记录
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package xyz.playedu.api.service;
|
||||
|
||||
import xyz.playedu.api.domain.ResourceVideo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【resource_videos】的数据库操作Service
|
||||
* @createDate 2023-03-02 15:13:03
|
||||
*/
|
||||
public interface ResourceVideoService extends IService<ResourceVideo> {
|
||||
|
||||
void create(Integer resourceId, Integer duration);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package xyz.playedu.api.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import xyz.playedu.api.domain.ResourceVideo;
|
||||
import xyz.playedu.api.service.ResourceVideoService;
|
||||
import xyz.playedu.api.mapper.ResourceVideoMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【resource_videos】的数据库操作Service实现
|
||||
* @createDate 2023-03-02 15:13:03
|
||||
*/
|
||||
@Service
|
||||
public class ResourceVideoServiceImpl extends ServiceImpl<ResourceVideoMapper, ResourceVideo>
|
||||
implements ResourceVideoService{
|
||||
@Override
|
||||
public void create(Integer resourceId, Integer duration) {
|
||||
ResourceVideo video = new ResourceVideo();
|
||||
video.setRid(resourceId);
|
||||
video.setDuration(duration);
|
||||
video.setCreatedAt(new Date());
|
||||
save(video);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user