应急大屏开屏动画接口
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
|||||||
|
package com.renkang.emergency.entity.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(title = "应急大屏开屏动画vo", description = "应急大屏开屏动画vo")
|
||||||
|
public class ScreenAnimationVO {
|
||||||
|
@Schema(title = "主键")
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 动画名称
|
||||||
|
*/
|
||||||
|
@Schema(title = "动画名称")
|
||||||
|
private String title;
|
||||||
|
/**
|
||||||
|
* 动画地址
|
||||||
|
*/
|
||||||
|
@Schema(title = "动画地址")
|
||||||
|
private String videoUrl;
|
||||||
|
/**
|
||||||
|
* 简介
|
||||||
|
*/
|
||||||
|
@Schema(title = "简介")
|
||||||
|
private String description;
|
||||||
|
}
|
||||||
+34
@@ -0,0 +1,34 @@
|
|||||||
|
package com.renkang.emergency.controller;
|
||||||
|
|
||||||
|
import com.renkang.emergency.entity.vo.ScreenAnimationVO;
|
||||||
|
import com.renkang.emergency.service.ScreenAnimationService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RequestMapping("/screen/animation")
|
||||||
|
public class ScreenAnimationController {
|
||||||
|
private final ScreenAnimationService screenAnimationService;
|
||||||
|
|
||||||
|
@Operation(summary = "查询大屏开屏动画", description = "查询大屏开屏动画")
|
||||||
|
@GetMapping(value = "/query")
|
||||||
|
public Result<ScreenAnimationVO> queryScreenAnimation() {
|
||||||
|
return Result.OK(screenAnimationService.queryScreenAnimation());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除开屏动画", description = "删除开屏动画")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<ScreenAnimationVO> deleteScreenAnimation(@RequestParam("id") String id) {
|
||||||
|
screenAnimationService.deleteScreenAnimation(id);
|
||||||
|
return Result.OK("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "新增或编辑开屏动画", description = "新增或编辑开屏动画")
|
||||||
|
@PostMapping(value = "/saveOrUpdate")
|
||||||
|
public Result<String> saveOrUpdateScreenAnimation(@RequestBody ScreenAnimationVO screenAnimationVO) {
|
||||||
|
return Result.OK(screenAnimationService.saveOrUpdateScreenAnimation(screenAnimationVO));
|
||||||
|
}
|
||||||
|
}
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
package com.renkang.emergency.mapper;
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.renkang.emergency.entity.ScreenAnimation;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface ScreenAnimationMapper extends MPJBaseMapper<ScreenAnimation> {
|
||||||
|
}
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
package com.renkang.emergency.service;
|
||||||
|
|
||||||
|
import com.renkang.emergency.entity.vo.ScreenAnimationVO;
|
||||||
|
|
||||||
|
public interface ScreenAnimationService {
|
||||||
|
/**
|
||||||
|
* 查询大屏开屏动画
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ScreenAnimationVO queryScreenAnimation();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除开屏动画
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
void deleteScreenAnimation(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增或编辑开屏动画
|
||||||
|
* @param screenAnimationVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String saveOrUpdateScreenAnimation(ScreenAnimationVO screenAnimationVO);
|
||||||
|
}
|
||||||
+52
@@ -0,0 +1,52 @@
|
|||||||
|
package com.renkang.emergency.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
|
import com.renkang.emergency.entity.ScreenAnimation;
|
||||||
|
import com.renkang.emergency.entity.vo.ScreenAnimationVO;
|
||||||
|
import com.renkang.emergency.mapper.ScreenAnimationMapper;
|
||||||
|
import com.renkang.emergency.service.ScreenAnimationService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.jeecg.global.GlobalUtils;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class ScreenAnimationServiceImpl extends ServiceImpl<ScreenAnimationMapper, ScreenAnimation> implements ScreenAnimationService {
|
||||||
|
private final ScreenAnimationMapper screenAnimationMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ScreenAnimationVO queryScreenAnimation() {
|
||||||
|
MPJLambdaWrapper<ScreenAnimation> wrapper = new MPJLambdaWrapper<>();
|
||||||
|
wrapper.selectAs(ScreenAnimation::getId, ScreenAnimationVO::getId);
|
||||||
|
wrapper.selectAs(ScreenAnimation::getTitle, ScreenAnimationVO::getTitle);
|
||||||
|
wrapper.selectAs(ScreenAnimation::getVideoUrl, ScreenAnimationVO::getVideoUrl);
|
||||||
|
wrapper.selectAs(ScreenAnimation::getDescription, ScreenAnimationVO::getDescription);
|
||||||
|
wrapper.orderByAsc(ScreenAnimation::getCreateTime);
|
||||||
|
return screenAnimationMapper.selectJoinOne(ScreenAnimationVO.class,wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteScreenAnimation(String id) {
|
||||||
|
screenAnimationMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String saveOrUpdateScreenAnimation(ScreenAnimationVO screenAnimationVO) {
|
||||||
|
ScreenAnimation screenAnimation = new ScreenAnimation();
|
||||||
|
BeanUtils.copyProperties(screenAnimationVO, screenAnimation);
|
||||||
|
if(StrUtil.isNotEmpty(screenAnimationVO.getId())){
|
||||||
|
screenAnimation.setUpdateBy(GlobalUtils.getLoginUser().getId());
|
||||||
|
screenAnimation.setUpdateTime(new Date());
|
||||||
|
}else {
|
||||||
|
screenAnimation.setCreateBy(GlobalUtils.getLoginUser().getId());
|
||||||
|
screenAnimation.setCreateTime(new Date());
|
||||||
|
}
|
||||||
|
saveOrUpdate(screenAnimation);
|
||||||
|
return "操作成功";
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user