From 34df247b6002b7362970a3e3dab764b79bc114dc Mon Sep 17 00:00:00 2001 From: zhoumingxiu Date: Tue, 11 Jun 2024 14:02:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=BF=90=E5=8A=A8=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vlog/VlogVideoManageController.java | 159 ++++++ .../com/god/vlog/domain/VlogVideoManage.java | 164 ++++++ .../vlog/mapper/VlogVideoManageMapper.java | 61 +++ .../vlog/service/IVlogVideoManageService.java | 61 +++ .../impl/VlogVideoManageServiceImpl.java | 99 ++++ .../mapper/vlog/VlogVideoManageMapper.xml | 102 ++++ god-ui/src/api/vlog/video.js | 44 ++ god-ui/src/views/vlog/video/index.vue | 476 ++++++++++++++++++ 8 files changed, 1166 insertions(+) create mode 100644 God-Vue-master/god-admin/src/main/java/com/god/web/controller/vlog/VlogVideoManageController.java create mode 100644 God-Vue-master/god-system/src/main/java/com/god/vlog/domain/VlogVideoManage.java create mode 100644 God-Vue-master/god-system/src/main/java/com/god/vlog/mapper/VlogVideoManageMapper.java create mode 100644 God-Vue-master/god-system/src/main/java/com/god/vlog/service/IVlogVideoManageService.java create mode 100644 God-Vue-master/god-system/src/main/java/com/god/vlog/service/impl/VlogVideoManageServiceImpl.java create mode 100644 God-Vue-master/god-system/src/main/resources/mapper/vlog/VlogVideoManageMapper.xml create mode 100644 god-ui/src/api/vlog/video.js create mode 100644 god-ui/src/views/vlog/video/index.vue diff --git a/God-Vue-master/god-admin/src/main/java/com/god/web/controller/vlog/VlogVideoManageController.java b/God-Vue-master/god-admin/src/main/java/com/god/web/controller/vlog/VlogVideoManageController.java new file mode 100644 index 00000000..39d73c78 --- /dev/null +++ b/God-Vue-master/god-admin/src/main/java/com/god/web/controller/vlog/VlogVideoManageController.java @@ -0,0 +1,159 @@ +package com.god.web.controller.vlog; + +import java.io.IOException; +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.alibaba.fastjson2.JSONObject; +import com.god.common.config.GodConfig; +import com.god.common.utils.file.FileUploadUtils; +import com.god.framework.config.ServerConfig; +import com.god.passenger.species.domain.BjdfVideoManage; +import com.god.web.controller.species.BjdfVideoManageController; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.god.common.annotation.Log; +import com.god.common.core.controller.BaseController; +import com.god.common.core.domain.AjaxResult; +import com.god.common.enums.BusinessType; +import com.god.vlog.domain.VlogVideoManage; +import com.god.vlog.service.IVlogVideoManageService; +import com.god.common.utils.poi.ExcelUtil; +import com.god.common.core.page.TableDataInfo; +import org.springframework.web.multipart.MultipartFile; + +/** + * 运动视频管理Controller + * + * @author god + * @date 2024-06-11 + */ +@RestController +@RequestMapping("/vlog/video") +public class VlogVideoManageController extends BaseController +{ + private static final Logger LOGGER = LoggerFactory.getLogger(VlogVideoManageController.class); + + @Autowired + private IVlogVideoManageService vlogVideoManageService; + @Autowired + private ServerConfig serverConfig; + + /** + * 查询运动视频管理列表 + */ + @PreAuthorize("@ss.hasPermi('vlog:video:list')") + @GetMapping("/list") + public TableDataInfo list(VlogVideoManage vlogVideoManage) + { + startPage(); + List list = vlogVideoManageService.selectVlogVideoManageList(vlogVideoManage); + return getDataTable(list); + } + + /** + * 导出运动视频管理列表 + */ + @PreAuthorize("@ss.hasPermi('vlog:video:export')") + @Log(title = "运动视频管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, VlogVideoManage vlogVideoManage) + { + List list = vlogVideoManageService.selectVlogVideoManageList(vlogVideoManage); + ExcelUtil util = new ExcelUtil(VlogVideoManage.class); + util.exportExcel(response, list, "运动视频管理数据"); + } + + /** + * 获取运动视频管理详细信息 + */ + @PreAuthorize("@ss.hasPermi('vlog:video:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) + { + return success(vlogVideoManageService.selectVlogVideoManageById(id)); + } + + /** + * 新增运动视频管理 + */ + @PreAuthorize("@ss.hasPermi('vlog:video:add')") + @Log(title = "运动视频管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody VlogVideoManage vlogVideoManage) + { + return toAjax(vlogVideoManageService.insertVlogVideoManage(vlogVideoManage)); + } + + /** + * 修改运动视频管理 + */ + @PreAuthorize("@ss.hasPermi('vlog:video:edit')") + @Log(title = "运动视频管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody VlogVideoManage vlogVideoManage) + { + return toAjax(vlogVideoManageService.updateVlogVideoManage(vlogVideoManage)); + } + + /** + * 删除运动视频管理 + */ + @PreAuthorize("@ss.hasPermi('vlog:video:remove')") + @Log(title = "运动视频管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) + { + return toAjax(vlogVideoManageService.deleteVlogVideoManageByIds(ids)); + } + + /** + * 上传文件和维修的基本信息 + * + * @param files + */ + @PostMapping("/upload/file") + public AjaxResult upload(List files, VlogVideoManage dryadFileInfo) { + String id = dryadFileInfo.getId(); + // 上传文件路径 + String filePath = GodConfig.getUploadPath(); + String fileUrl = ""; +// List urls = new ArrayList(); +// List fileNames = new ArrayList(); +// List newFileNames = new ArrayList(); +// List originalFilenames = new ArrayList(); + LOGGER.info("--->>查看url的地址:{},配置地址{}", filePath, serverConfig.getUrl()); + if (files != null && files.size() > 0) { + LOGGER.info("--->>开始上传文件"); + for (MultipartFile file1 : files) { + // 上传并返回新文件名称 + String fileName = null; + try { + //上传文件 + fileName = FileUploadUtils.upload(filePath, file1); + } catch (IOException e) { + e.printStackTrace(); + } + LOGGER.info("---->>查看第一次路径" + fileName); + String url = serverConfig.getUrl() + fileName; + LOGGER.info("---->>查看第二次路径" + url); + fileUrl = fileName; + } + } + JSONObject jsonObject = new JSONObject(); + jsonObject.put("file_id", id); + jsonObject.put("fileUrl", fileUrl); + return AjaxResult.success(jsonObject); + } + +} diff --git a/God-Vue-master/god-system/src/main/java/com/god/vlog/domain/VlogVideoManage.java b/God-Vue-master/god-system/src/main/java/com/god/vlog/domain/VlogVideoManage.java new file mode 100644 index 00000000..58adb85b --- /dev/null +++ b/God-Vue-master/god-system/src/main/java/com/god/vlog/domain/VlogVideoManage.java @@ -0,0 +1,164 @@ +package com.god.vlog.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.god.common.annotation.Excel; +import com.god.common.core.domain.BaseEntity; + +/** + * 运动视频管理对象 vlog_video_manage + * + * @author god + * @date 2024-06-11 + */ +public class VlogVideoManage extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private String id; + + /** 设备名称 */ + @Excel(name = "设备名称") + private String equipName; + + /** 设备id */ + @Excel(name = "设备id") + private String equipId; + + /** 用户名 */ + @Excel(name = "用户名") + private String userName; + + /** 用户id */ + @Excel(name = "用户id") + private String userId; + + /** 视频名称 */ + @Excel(name = "视频名称") + private String videoName; + + /** 视频时间 */ + @Excel(name = "视频时间") + private String videoTime; + + /** 视频地址 */ + @Excel(name = "视频地址") + private String fileUrl; + + /** 图片 */ + @Excel(name = "图片") + private String phoneInfo; + + /** 数据类型 */ + @Excel(name = "数据类型") + private String dataType; + + public void setId(String id) + { + this.id = id; + } + + public String getId() + { + return id; + } + public void setEquipName(String equipName) + { + this.equipName = equipName; + } + + public String getEquipName() + { + return equipName; + } + public void setEquipId(String equipId) + { + this.equipId = equipId; + } + + public String getEquipId() + { + return equipId; + } + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getUserName() + { + return userName; + } + public void setUserId(String userId) + { + this.userId = userId; + } + + public String getUserId() + { + return userId; + } + public void setVideoName(String videoName) + { + this.videoName = videoName; + } + + public String getVideoName() + { + return videoName; + } + public void setVideoTime(String videoTime) + { + this.videoTime = videoTime; + } + + public String getVideoTime() + { + return videoTime; + } + public void setFileUrl(String fileUrl) + { + this.fileUrl = fileUrl; + } + + public String getFileUrl() + { + return fileUrl; + } + public void setPhoneInfo(String phoneInfo) + { + this.phoneInfo = phoneInfo; + } + + public String getPhoneInfo() + { + return phoneInfo; + } + public void setDataType(String dataType) + { + this.dataType = dataType; + } + + public String getDataType() + { + return dataType; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("equipName", getEquipName()) + .append("equipId", getEquipId()) + .append("userName", getUserName()) + .append("userId", getUserId()) + .append("videoName", getVideoName()) + .append("videoTime", getVideoTime()) + .append("fileUrl", getFileUrl()) + .append("phoneInfo", getPhoneInfo()) + .append("dataType", getDataType()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/God-Vue-master/god-system/src/main/java/com/god/vlog/mapper/VlogVideoManageMapper.java b/God-Vue-master/god-system/src/main/java/com/god/vlog/mapper/VlogVideoManageMapper.java new file mode 100644 index 00000000..e27b241d --- /dev/null +++ b/God-Vue-master/god-system/src/main/java/com/god/vlog/mapper/VlogVideoManageMapper.java @@ -0,0 +1,61 @@ +package com.god.vlog.mapper; + +import java.util.List; +import com.god.vlog.domain.VlogVideoManage; + +/** + * 运动视频管理Mapper接口 + * + * @author god + * @date 2024-06-11 + */ +public interface VlogVideoManageMapper +{ + /** + * 查询运动视频管理 + * + * @param id 运动视频管理主键 + * @return 运动视频管理 + */ + public VlogVideoManage selectVlogVideoManageById(String id); + + /** + * 查询运动视频管理列表 + * + * @param vlogVideoManage 运动视频管理 + * @return 运动视频管理集合 + */ + public List selectVlogVideoManageList(VlogVideoManage vlogVideoManage); + + /** + * 新增运动视频管理 + * + * @param vlogVideoManage 运动视频管理 + * @return 结果 + */ + public int insertVlogVideoManage(VlogVideoManage vlogVideoManage); + + /** + * 修改运动视频管理 + * + * @param vlogVideoManage 运动视频管理 + * @return 结果 + */ + public int updateVlogVideoManage(VlogVideoManage vlogVideoManage); + + /** + * 删除运动视频管理 + * + * @param id 运动视频管理主键 + * @return 结果 + */ + public int deleteVlogVideoManageById(String id); + + /** + * 批量删除运动视频管理 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteVlogVideoManageByIds(String[] ids); +} diff --git a/God-Vue-master/god-system/src/main/java/com/god/vlog/service/IVlogVideoManageService.java b/God-Vue-master/god-system/src/main/java/com/god/vlog/service/IVlogVideoManageService.java new file mode 100644 index 00000000..ba48a172 --- /dev/null +++ b/God-Vue-master/god-system/src/main/java/com/god/vlog/service/IVlogVideoManageService.java @@ -0,0 +1,61 @@ +package com.god.vlog.service; + +import java.util.List; +import com.god.vlog.domain.VlogVideoManage; + +/** + * 运动视频管理Service接口 + * + * @author god + * @date 2024-06-11 + */ +public interface IVlogVideoManageService +{ + /** + * 查询运动视频管理 + * + * @param id 运动视频管理主键 + * @return 运动视频管理 + */ + public VlogVideoManage selectVlogVideoManageById(String id); + + /** + * 查询运动视频管理列表 + * + * @param vlogVideoManage 运动视频管理 + * @return 运动视频管理集合 + */ + public List selectVlogVideoManageList(VlogVideoManage vlogVideoManage); + + /** + * 新增运动视频管理 + * + * @param vlogVideoManage 运动视频管理 + * @return 结果 + */ + public int insertVlogVideoManage(VlogVideoManage vlogVideoManage); + + /** + * 修改运动视频管理 + * + * @param vlogVideoManage 运动视频管理 + * @return 结果 + */ + public int updateVlogVideoManage(VlogVideoManage vlogVideoManage); + + /** + * 批量删除运动视频管理 + * + * @param ids 需要删除的运动视频管理主键集合 + * @return 结果 + */ + public int deleteVlogVideoManageByIds(String[] ids); + + /** + * 删除运动视频管理信息 + * + * @param id 运动视频管理主键 + * @return 结果 + */ + public int deleteVlogVideoManageById(String id); +} diff --git a/God-Vue-master/god-system/src/main/java/com/god/vlog/service/impl/VlogVideoManageServiceImpl.java b/God-Vue-master/god-system/src/main/java/com/god/vlog/service/impl/VlogVideoManageServiceImpl.java new file mode 100644 index 00000000..1379f4da --- /dev/null +++ b/God-Vue-master/god-system/src/main/java/com/god/vlog/service/impl/VlogVideoManageServiceImpl.java @@ -0,0 +1,99 @@ +package com.god.vlog.service.impl; + +import java.util.List; + +import com.god.common.utils.StringUtils; +import com.god.common.utils.uuid.IdUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.god.vlog.mapper.VlogVideoManageMapper; +import com.god.vlog.domain.VlogVideoManage; +import com.god.vlog.service.IVlogVideoManageService; + +/** + * 运动视频管理Service业务层处理 + * + * @author god + * @date 2024-06-11 + */ +@Service +public class VlogVideoManageServiceImpl implements IVlogVideoManageService +{ + @Autowired + private VlogVideoManageMapper vlogVideoManageMapper; + + /** + * 查询运动视频管理 + * + * @param id 运动视频管理主键 + * @return 运动视频管理 + */ + @Override + public VlogVideoManage selectVlogVideoManageById(String id) + { + return vlogVideoManageMapper.selectVlogVideoManageById(id); + } + + /** + * 查询运动视频管理列表 + * + * @param vlogVideoManage 运动视频管理 + * @return 运动视频管理 + */ + @Override + public List selectVlogVideoManageList(VlogVideoManage vlogVideoManage) + { + return vlogVideoManageMapper.selectVlogVideoManageList(vlogVideoManage); + } + + /** + * 新增运动视频管理 + * + * @param vlogVideoManage 运动视频管理 + * @return 结果 + */ + @Override + public int insertVlogVideoManage(VlogVideoManage vlogVideoManage) + { + if (StringUtils.isBlank(vlogVideoManage.getId())){ + vlogVideoManage.setId(IdUtils.fastSimpleUUID()); + } + return vlogVideoManageMapper.insertVlogVideoManage(vlogVideoManage); + } + + /** + * 修改运动视频管理 + * + * @param vlogVideoManage 运动视频管理 + * @return 结果 + */ + @Override + public int updateVlogVideoManage(VlogVideoManage vlogVideoManage) + { + return vlogVideoManageMapper.updateVlogVideoManage(vlogVideoManage); + } + + /** + * 批量删除运动视频管理 + * + * @param ids 需要删除的运动视频管理主键 + * @return 结果 + */ + @Override + public int deleteVlogVideoManageByIds(String[] ids) + { + return vlogVideoManageMapper.deleteVlogVideoManageByIds(ids); + } + + /** + * 删除运动视频管理信息 + * + * @param id 运动视频管理主键 + * @return 结果 + */ + @Override + public int deleteVlogVideoManageById(String id) + { + return vlogVideoManageMapper.deleteVlogVideoManageById(id); + } +} diff --git a/God-Vue-master/god-system/src/main/resources/mapper/vlog/VlogVideoManageMapper.xml b/God-Vue-master/god-system/src/main/resources/mapper/vlog/VlogVideoManageMapper.xml new file mode 100644 index 00000000..e6a49000 --- /dev/null +++ b/God-Vue-master/god-system/src/main/resources/mapper/vlog/VlogVideoManageMapper.xml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + select id, equip_name, equip_id, user_name, user_id, video_name, video_time, file_url, phone_info, data_type, remark from vlog_video_manage + + + + + + + + insert into vlog_video_manage + + id, + equip_name, + equip_id, + user_name, + user_id, + video_name, + video_time, + file_url, + phone_info, + data_type, + remark, + + + #{id}, + #{equipName}, + #{equipId}, + #{userName}, + #{userId}, + #{videoName}, + #{videoTime}, + #{fileUrl}, + #{phoneInfo}, + #{dataType}, + #{remark}, + + + + + update vlog_video_manage + + equip_name = #{equipName}, + equip_id = #{equipId}, + user_name = #{userName}, + user_id = #{userId}, + video_name = #{videoName}, + video_time = #{videoTime}, + file_url = #{fileUrl}, + phone_info = #{phoneInfo}, + data_type = #{dataType}, + remark = #{remark}, + + where id = #{id} + + + + delete from vlog_video_manage where id = #{id} + + + + delete from vlog_video_manage where id in + + #{id} + + + \ No newline at end of file diff --git a/god-ui/src/api/vlog/video.js b/god-ui/src/api/vlog/video.js new file mode 100644 index 00000000..200d218c --- /dev/null +++ b/god-ui/src/api/vlog/video.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询运动视频管理列表 +export function listVideo(query) { + return request({ + url: '/vlog/video/list', + method: 'get', + params: query + }) +} + +// 查询运动视频管理详细 +export function getVideo(id) { + return request({ + url: '/vlog/video/' + id, + method: 'get' + }) +} + +// 新增运动视频管理 +export function addVideo(data) { + return request({ + url: '/vlog/video', + method: 'post', + data: data + }) +} + +// 修改运动视频管理 +export function updateVideo(data) { + return request({ + url: '/vlog/video', + method: 'put', + data: data + }) +} + +// 删除运动视频管理 +export function delVideo(id) { + return request({ + url: '/vlog/video/' + id, + method: 'delete' + }) +} diff --git a/god-ui/src/views/vlog/video/index.vue b/god-ui/src/views/vlog/video/index.vue new file mode 100644 index 00000000..ee7ff926 --- /dev/null +++ b/god-ui/src/views/vlog/video/index.vue @@ -0,0 +1,476 @@ + + +