短剧基础相关代码更新。
This commit is contained in:
parent
a2460ded07
commit
4328f5c369
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.playlet.web.controller.app;
|
||||||
|
|
||||||
|
import com.playlet.common.core.controller.BaseController;
|
||||||
|
import com.playlet.common.core.page.TableDataInfo;
|
||||||
|
import com.playlet.system.service.IPlayletItemService;
|
||||||
|
import com.playlet.web.resp.PlayletItemSearchRequestResp;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
/**
|
||||||
|
* @Date: 2024-03-14-22:59
|
||||||
|
* @Author: 但星霖
|
||||||
|
* @Version: v1.0
|
||||||
|
* @Description: 短剧基础app Controller Controller
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "短剧基础app控制层")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "/app/playlet/item")
|
||||||
|
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||||
|
public class PlayletItemAppController extends BaseController {
|
||||||
|
|
||||||
|
private final IPlayletItemService playletItemService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询短剧基础列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:item:list")
|
||||||
|
@PostMapping("/search")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo search(@RequestBody PlayletItemSearchRequestResp requestResp) {
|
||||||
|
return getDataTableInPage(playletItemService.search(PlayletItemSearchRequestResp.toDto(requestResp)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,127 @@
|
||||||
|
package com.playlet.web.controller.system;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import com.playlet.common.annotation.Log;
|
||||||
|
import com.playlet.common.enums.BusinessType;
|
||||||
|
import com.playlet.system.domain.PlayletItem;
|
||||||
|
import com.playlet.system.service.IPlayletItemService;
|
||||||
|
import com.playlet.common.core.controller.BaseController;
|
||||||
|
import com.playlet.common.core.domain.AjaxResult;
|
||||||
|
import com.playlet.common.utils.poi.ExcelUtil;
|
||||||
|
import com.playlet.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Date: 2024-03-14-22:57
|
||||||
|
* @Author: 但星霖
|
||||||
|
* @Version: v1.0
|
||||||
|
* @Description: 短剧基础Controller
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/system/playlet/item")
|
||||||
|
public class PlayletItemController extends BaseController {
|
||||||
|
private String prefix = "system/playlet/item";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPlayletItemService playletItemService;
|
||||||
|
|
||||||
|
@RequiresPermissions("system:playlet:item:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String item()
|
||||||
|
{
|
||||||
|
return prefix + "/item";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询短剧基础列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:item:list")
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(PlayletItem playletItem)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<PlayletItem> list = playletItemService.selectPlayletItemList(playletItem);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出短剧基础列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:item:export")
|
||||||
|
@Log(title = "短剧基础", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(PlayletItem playletItem)
|
||||||
|
{
|
||||||
|
List<PlayletItem> list = playletItemService.selectPlayletItemList(playletItem);
|
||||||
|
ExcelUtil<PlayletItem> util = new ExcelUtil<PlayletItem>(PlayletItem.class);
|
||||||
|
return util.exportExcel(list, "短剧基础数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增短剧基础
|
||||||
|
*/
|
||||||
|
@GetMapping("/add")
|
||||||
|
public String add()
|
||||||
|
{
|
||||||
|
return prefix + "/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存短剧基础
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:item:add")
|
||||||
|
@Log(title = "短剧基础", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addSave(PlayletItem playletItem)
|
||||||
|
{
|
||||||
|
return toAjax(playletItemService.insertPlayletItem(playletItem));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改短剧基础
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:item:edit")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
||||||
|
{
|
||||||
|
PlayletItem playletItem = playletItemService.selectPlayletItemById(id);
|
||||||
|
mmap.put("playletItem", playletItem);
|
||||||
|
return prefix + "/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存短剧基础
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:item:edit")
|
||||||
|
@Log(title = "短剧基础", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(PlayletItem playletItem)
|
||||||
|
{
|
||||||
|
return toAjax(playletItemService.updatePlayletItem(playletItem));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除短剧基础
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:item:remove")
|
||||||
|
@Log(title = "短剧基础", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping( "/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids)
|
||||||
|
{
|
||||||
|
return toAjax(playletItemService.deletePlayletItemByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
package com.playlet.web.resp;
|
||||||
|
|
||||||
|
import com.playlet.common.annotation.Excel;
|
||||||
|
import com.playlet.system.pojo.dto.PlayletItemSearchRequestDTO;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Date: 2024-03-14-23:49
|
||||||
|
* @Author: 但星霖
|
||||||
|
* @Version: v1.0
|
||||||
|
* @Description: 短剧基础对象 查询相应对象
|
||||||
|
*/
|
||||||
|
public class PlayletItemSearchRequestResp {
|
||||||
|
|
||||||
|
@Schema(description = "主键id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "视频名称")
|
||||||
|
private String videoName;
|
||||||
|
|
||||||
|
@Schema(description = "上映年份")
|
||||||
|
private String releaseDate;
|
||||||
|
|
||||||
|
@Excel(name = "地区")
|
||||||
|
private String region;
|
||||||
|
|
||||||
|
@Schema(description = "视频类型1 科幻 2 爱情 3 恐怖 4 悬疑..")
|
||||||
|
private Long videoType;
|
||||||
|
|
||||||
|
@Schema(description = "评分 大于等于")
|
||||||
|
private Long score;
|
||||||
|
|
||||||
|
@Schema(description = "集数 大于等于")
|
||||||
|
private Long numberEpisode;
|
||||||
|
|
||||||
|
@Schema(description = "上映时间")
|
||||||
|
private Date releaseTime;
|
||||||
|
|
||||||
|
@Schema(description = "页条数")
|
||||||
|
private Integer pageSize = 10;
|
||||||
|
|
||||||
|
@Schema(description = "当前页")
|
||||||
|
private Integer current = 1;
|
||||||
|
|
||||||
|
public static PlayletItemSearchRequestDTO toDto(PlayletItemSearchRequestResp vo){
|
||||||
|
PlayletItemSearchRequestDTO dto = new PlayletItemSearchRequestDTO();
|
||||||
|
BeanUtils.copyProperties(vo, dto);
|
||||||
|
return dto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -6,6 +6,8 @@ import java.util.List;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.web.bind.WebDataBinder;
|
import org.springframework.web.bind.WebDataBinder;
|
||||||
|
|
@ -117,6 +119,19 @@ public class BaseController
|
||||||
return rspData;
|
return rspData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 响应请求分页数据
|
||||||
|
*/
|
||||||
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
|
protected TableDataInfo getDataTableInPage(IPage<?> page)
|
||||||
|
{
|
||||||
|
TableDataInfo rspData = new TableDataInfo();
|
||||||
|
rspData.setCode(0);
|
||||||
|
rspData.setRows(page.getRecords());
|
||||||
|
rspData.setTotal(page.getTotal());
|
||||||
|
return rspData;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 响应返回结果
|
* 响应返回结果
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,75 @@
|
||||||
|
package com.playlet.system.domain;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.playlet.common.core.domain.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import com.playlet.common.annotation.Excel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Date: 2024-03-14-22:50
|
||||||
|
* @Author: 但星霖
|
||||||
|
* @Version: v1.0
|
||||||
|
* @Description: 短剧基础对象 playlet_item
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName(value = "playlet_item")
|
||||||
|
public class PlayletItem extends BaseEntity{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键id */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 来源类型 1.抖音 2.快手 3.视频号 */
|
||||||
|
@Excel(name = "来源类型 1.抖音 2.快手 3.视频号")
|
||||||
|
private Long sourceType;
|
||||||
|
|
||||||
|
/** 视频名称 */
|
||||||
|
@Excel(name = "视频名称")
|
||||||
|
private String videoName;
|
||||||
|
|
||||||
|
/** 视频是否完结 0 未完结 1 完结 */
|
||||||
|
@Excel(name = "视频是否完结 0 未完结 1 完结 ")
|
||||||
|
private Long completeNot;
|
||||||
|
|
||||||
|
/** 视频封面图 */
|
||||||
|
@Excel(name = "视频封面图")
|
||||||
|
private String coverPic;
|
||||||
|
|
||||||
|
/** 连接地址 */
|
||||||
|
@Excel(name = "连接地址")
|
||||||
|
private String connectSite;
|
||||||
|
|
||||||
|
/** 上映年份 */
|
||||||
|
@Excel(name = "上映年份")
|
||||||
|
private String releaseDate;
|
||||||
|
|
||||||
|
/** 地区 */
|
||||||
|
@Excel(name = "地区")
|
||||||
|
private String region;
|
||||||
|
|
||||||
|
/** 视频类型1 科幻 2 爱情 3 恐怖 4 悬疑.. */
|
||||||
|
@Excel(name = "视频类型1 科幻 2 爱情 3 恐怖 4 悬疑..")
|
||||||
|
private Long videoType;
|
||||||
|
|
||||||
|
/** 评分 */
|
||||||
|
@Excel(name = "评分")
|
||||||
|
private Long score;
|
||||||
|
|
||||||
|
/** 集数 */
|
||||||
|
@Excel(name = "集数")
|
||||||
|
private Long numberEpisode;
|
||||||
|
|
||||||
|
/** 是否删除 1 正常 0 删除 */
|
||||||
|
@Excel(name = "是否删除 1 正常 0 删除")
|
||||||
|
private Long isDelete;
|
||||||
|
|
||||||
|
/** 上映时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "上映时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date releaseTime;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.playlet.system.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.playlet.system.domain.PlayletItem;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Date: 2024-03-14-22:51
|
||||||
|
* @Author: 但星霖
|
||||||
|
* @Version: v1.0
|
||||||
|
* @Description: 短剧基础Mapper接口
|
||||||
|
*/
|
||||||
|
public interface PlayletItemMapper extends BaseMapper<PlayletItem> {
|
||||||
|
/**
|
||||||
|
* 查询短剧基础
|
||||||
|
*
|
||||||
|
* @param id 短剧基础主键
|
||||||
|
* @return 短剧基础
|
||||||
|
*/
|
||||||
|
public PlayletItem selectPlayletItemById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询短剧基础列表
|
||||||
|
*
|
||||||
|
* @param playletItem 短剧基础
|
||||||
|
* @return 短剧基础集合
|
||||||
|
*/
|
||||||
|
public List<PlayletItem> selectPlayletItemList(PlayletItem playletItem);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增短剧基础
|
||||||
|
*
|
||||||
|
* @param playletItem 短剧基础
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertPlayletItem(PlayletItem playletItem);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改短剧基础
|
||||||
|
*
|
||||||
|
* @param playletItem 短剧基础
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updatePlayletItem(PlayletItem playletItem);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除短剧基础
|
||||||
|
*
|
||||||
|
* @param id 短剧基础主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deletePlayletItemById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除短剧基础
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deletePlayletItemByIds(String[] ids);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
package com.playlet.system.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Date: 2024-03-14-23:56
|
||||||
|
* @Author: 但星霖
|
||||||
|
* @Version: v1.0
|
||||||
|
* @Description: 短剧基础对象 查询相应对象DTO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PlayletItemSearchRequestDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频名称
|
||||||
|
*/
|
||||||
|
private String videoName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上映年份
|
||||||
|
*/
|
||||||
|
private String releaseDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地区
|
||||||
|
*/
|
||||||
|
private String region;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频类型1 科幻 2 爱情 3 恐怖 4 悬疑..
|
||||||
|
*/
|
||||||
|
private Long videoType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 评分 大于等于
|
||||||
|
*/
|
||||||
|
private Long score;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 集数 大于等于
|
||||||
|
*/
|
||||||
|
private Long numberEpisode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上映时间
|
||||||
|
*/
|
||||||
|
private Date releaseTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页条数
|
||||||
|
*/
|
||||||
|
private Integer pageSize;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前页
|
||||||
|
*/
|
||||||
|
private Integer current;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,73 @@
|
||||||
|
package com.playlet.system.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.playlet.system.domain.PlayletItem;
|
||||||
|
import com.playlet.system.pojo.dto.PlayletItemSearchRequestDTO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Date: 2024-03-14-22:52
|
||||||
|
* @Author: 但星霖
|
||||||
|
* @Version: v1.0
|
||||||
|
* @Description: 短剧基础Service接口
|
||||||
|
*/
|
||||||
|
public interface IPlayletItemService extends IService<PlayletItem> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询短剧基础
|
||||||
|
*
|
||||||
|
* @param id 短剧基础主键
|
||||||
|
* @return 短剧基础
|
||||||
|
*/
|
||||||
|
public PlayletItem selectPlayletItemById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询短剧基础列表
|
||||||
|
*
|
||||||
|
* @param playletItem 短剧基础
|
||||||
|
* @return 短剧基础集合
|
||||||
|
*/
|
||||||
|
public List<PlayletItem> selectPlayletItemList(PlayletItem playletItem);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增短剧基础
|
||||||
|
*
|
||||||
|
* @param playletItem 短剧基础
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertPlayletItem(PlayletItem playletItem);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改短剧基础
|
||||||
|
*
|
||||||
|
* @param playletItem 短剧基础
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updatePlayletItem(PlayletItem playletItem);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除短剧基础
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的短剧基础主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deletePlayletItemByIds(String ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除短剧基础信息
|
||||||
|
*
|
||||||
|
* @param id 短剧基础主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deletePlayletItemById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 短剧分也数据查询
|
||||||
|
*
|
||||||
|
* @param requestResp 分页请求dto
|
||||||
|
* @return 分页数据实体
|
||||||
|
*/
|
||||||
|
public IPage<PlayletItem> search(PlayletItemSearchRequestDTO requestResp);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,124 @@
|
||||||
|
package com.playlet.system.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.playlet.common.utils.DateUtils;
|
||||||
|
import com.playlet.system.pojo.dto.PlayletItemSearchRequestDTO;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.playlet.system.mapper.PlayletItemMapper;
|
||||||
|
import com.playlet.system.domain.PlayletItem;
|
||||||
|
import com.playlet.system.service.IPlayletItemService;
|
||||||
|
import com.playlet.common.core.text.Convert;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Date: 2024-03-14-22:53
|
||||||
|
* @Author: 但星霖
|
||||||
|
* @Version: v1.0
|
||||||
|
* @Description: 短剧基础Service业务层处理
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PlayletItemServiceImpl extends ServiceImpl<PlayletItemMapper, PlayletItem> implements IPlayletItemService {
|
||||||
|
@Autowired
|
||||||
|
private PlayletItemMapper playletItemMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询短剧基础
|
||||||
|
*
|
||||||
|
* @param id 短剧基础主键
|
||||||
|
* @return 短剧基础
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PlayletItem selectPlayletItemById(Long id) {
|
||||||
|
return playletItemMapper.selectPlayletItemById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询短剧基础列表
|
||||||
|
*
|
||||||
|
* @param playletItem 短剧基础
|
||||||
|
* @return 短剧基础
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<PlayletItem> selectPlayletItemList(PlayletItem playletItem) {
|
||||||
|
return playletItemMapper.selectPlayletItemList(playletItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增短剧基础
|
||||||
|
*
|
||||||
|
* @param playletItem 短剧基础
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertPlayletItem(PlayletItem playletItem) {
|
||||||
|
playletItem.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return playletItemMapper.insertPlayletItem(playletItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改短剧基础
|
||||||
|
*
|
||||||
|
* @param playletItem 短剧基础
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updatePlayletItem(PlayletItem playletItem) {
|
||||||
|
playletItem.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return playletItemMapper.updatePlayletItem(playletItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除短剧基础
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的短剧基础主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deletePlayletItemByIds(String ids) {
|
||||||
|
return playletItemMapper.deletePlayletItemByIds(Convert.toStrArray(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除短剧基础信息
|
||||||
|
*
|
||||||
|
* @param id 短剧基础主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deletePlayletItemById(Long id) {
|
||||||
|
return playletItemMapper.deletePlayletItemById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<PlayletItem> search(PlayletItemSearchRequestDTO requestResp) {
|
||||||
|
QueryWrapper<PlayletItem> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.select()
|
||||||
|
.lambda()
|
||||||
|
// id 精准
|
||||||
|
.eq(ObjectUtils.isNotNull(requestResp.getId()), PlayletItem::getId, requestResp.getId())
|
||||||
|
// 视频名称
|
||||||
|
.like(ObjectUtils.isNotNull(requestResp.getVideoName()), PlayletItem::getVideoName, requestResp.getVideoName())
|
||||||
|
// 上映年份
|
||||||
|
.eq(ObjectUtils.isNotNull(requestResp.getReleaseDate()), PlayletItem::getReleaseDate, requestResp.getReleaseDate())
|
||||||
|
// 地区
|
||||||
|
.eq(ObjectUtils.isNotNull(requestResp.getRegion()), PlayletItem::getRegion, requestResp.getRegion())
|
||||||
|
// 视频类型1 科幻 2 爱情 3 恐怖 4 悬疑..
|
||||||
|
.eq(ObjectUtils.isNotNull(requestResp.getVideoType()), PlayletItem::getVideoType, requestResp.getVideoType())
|
||||||
|
|
||||||
|
// 评分 大于等于
|
||||||
|
.ge(ObjectUtils.isNotNull(requestResp.getScore()), PlayletItem::getScore, requestResp.getScore())
|
||||||
|
// 集数 大于等于
|
||||||
|
.like(ObjectUtils.isNotNull(requestResp.getNumberEpisode()), PlayletItem::getNumberEpisode, requestResp.getNumberEpisode())
|
||||||
|
// 上映时间
|
||||||
|
.like(ObjectUtils.isNotNull(requestResp.getReleaseTime()), PlayletItem::getReleaseTime, requestResp.getReleaseTime());
|
||||||
|
return baseMapper.selectPage(new Page<>(requestResp.getCurrent(), requestResp.getPageSize()), wrapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,132 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.playlet.system.mapper.PlayletItemMapper">
|
||||||
|
|
||||||
|
<resultMap type="PlayletItem" id="PlayletItemResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="sourceType" column="source_type" />
|
||||||
|
<result property="videoName" column="video_name" />
|
||||||
|
<result property="completeNot" column="complete_not" />
|
||||||
|
<result property="coverPic" column="cover_pic" />
|
||||||
|
<result property="connectSite" column="connect_site" />
|
||||||
|
<result property="releaseDate" column="release_date" />
|
||||||
|
<result property="region" column="region" />
|
||||||
|
<result property="videoType" column="video_type" />
|
||||||
|
<result property="score" column="score" />
|
||||||
|
<result property="numberEpisode" column="number_episode" />
|
||||||
|
<result property="isDelete" column="is_delete" />
|
||||||
|
<result property="releaseTime" column="release_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectPlayletItemVo">
|
||||||
|
select id, create_by, create_time, update_by, update_time, remark, source_type, video_name, complete_not, cover_pic, connect_site, release_date, region, video_type, score, number_episode, is_delete, release_time from playlet_item
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectPlayletItemList" parameterType="PlayletItem" resultMap="PlayletItemResult">
|
||||||
|
<include refid="selectPlayletItemVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="sourceType != null "> and source_type = #{sourceType}</if>
|
||||||
|
<if test="videoName != null and videoName != ''"> and video_name like concat('%', #{videoName}, '%')</if>
|
||||||
|
<if test="completeNot != null "> and complete_not = #{completeNot}</if>
|
||||||
|
<if test="coverPic != null and coverPic != ''"> and cover_pic = #{coverPic}</if>
|
||||||
|
<if test="connectSite != null and connectSite != ''"> and connect_site = #{connectSite}</if>
|
||||||
|
<if test="releaseDate != null and releaseDate != ''"> and release_date = #{releaseDate}</if>
|
||||||
|
<if test="region != null and region != ''"> and region = #{region}</if>
|
||||||
|
<if test="videoType != null "> and video_type = #{videoType}</if>
|
||||||
|
<if test="score != null "> and score = #{score}</if>
|
||||||
|
<if test="numberEpisode != null "> and number_episode = #{numberEpisode}</if>
|
||||||
|
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
|
||||||
|
<if test="releaseTime != null "> and release_time = #{releaseTime}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectPlayletItemById" parameterType="Long" resultMap="PlayletItemResult">
|
||||||
|
<include refid="selectPlayletItemVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertPlayletItem" parameterType="PlayletItem" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into playlet_item
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="sourceType != null">source_type,</if>
|
||||||
|
<if test="videoName != null and videoName != ''">video_name,</if>
|
||||||
|
<if test="completeNot != null">complete_not,</if>
|
||||||
|
<if test="coverPic != null">cover_pic,</if>
|
||||||
|
<if test="connectSite != null and connectSite != ''">connect_site,</if>
|
||||||
|
<if test="releaseDate != null and releaseDate != ''">release_date,</if>
|
||||||
|
<if test="region != null and region != ''">region,</if>
|
||||||
|
<if test="videoType != null">video_type,</if>
|
||||||
|
<if test="score != null">score,</if>
|
||||||
|
<if test="numberEpisode != null">number_episode,</if>
|
||||||
|
<if test="isDelete != null">is_delete,</if>
|
||||||
|
<if test="releaseTime != null">release_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="sourceType != null">#{sourceType},</if>
|
||||||
|
<if test="videoName != null and videoName != ''">#{videoName},</if>
|
||||||
|
<if test="completeNot != null">#{completeNot},</if>
|
||||||
|
<if test="coverPic != null">#{coverPic},</if>
|
||||||
|
<if test="connectSite != null and connectSite != ''">#{connectSite},</if>
|
||||||
|
<if test="releaseDate != null and releaseDate != ''">#{releaseDate},</if>
|
||||||
|
<if test="region != null and region != ''">#{region},</if>
|
||||||
|
<if test="videoType != null">#{videoType},</if>
|
||||||
|
<if test="score != null">#{score},</if>
|
||||||
|
<if test="numberEpisode != null">#{numberEpisode},</if>
|
||||||
|
<if test="isDelete != null">#{isDelete},</if>
|
||||||
|
<if test="releaseTime != null">#{releaseTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updatePlayletItem" parameterType="PlayletItem">
|
||||||
|
update playlet_item
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="sourceType != null">source_type = #{sourceType},</if>
|
||||||
|
<if test="videoName != null and videoName != ''">video_name = #{videoName},</if>
|
||||||
|
<if test="completeNot != null">complete_not = #{completeNot},</if>
|
||||||
|
<if test="coverPic != null">cover_pic = #{coverPic},</if>
|
||||||
|
<if test="connectSite != null and connectSite != ''">connect_site = #{connectSite},</if>
|
||||||
|
<if test="releaseDate != null and releaseDate != ''">release_date = #{releaseDate},</if>
|
||||||
|
<if test="region != null and region != ''">region = #{region},</if>
|
||||||
|
<if test="videoType != null">video_type = #{videoType},</if>
|
||||||
|
<if test="score != null">score = #{score},</if>
|
||||||
|
<if test="numberEpisode != null">number_episode = #{numberEpisode},</if>
|
||||||
|
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||||
|
<if test="releaseTime != null">release_time = #{releaseTime},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deletePlayletItemById" parameterType="Long">
|
||||||
|
delete from playlet_item where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deletePlayletItemByIds" parameterType="String">
|
||||||
|
delete from playlet_item where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue