添加直播申请管理
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
package com.ruoyi.cms.controller.cms;
|
||||
|
||||
import com.ruoyi.cms.domain.liveSteam.LiveApply;
|
||||
import com.ruoyi.cms.service.LiveApplyService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "直播申请管理")
|
||||
@RestController
|
||||
@RequestMapping("/live/apply")
|
||||
public class LiveApplyController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private LiveApplyService liveApplyService;
|
||||
|
||||
@ApiOperation("分页查询直播申请列表")
|
||||
@PreAuthorize("@ss.hasPermi('live:apply:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(LiveApply liveApply)
|
||||
{
|
||||
startPage();
|
||||
List<LiveApply> list = liveApplyService.selectLiveApplyList(liveApply);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("获取直播申请详情")
|
||||
@PreAuthorize("@ss.hasPermi('live:apply:query')")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getInfo(@PathVariable Long id)
|
||||
{
|
||||
return success(liveApplyService.selectLiveApplyById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增直播申请")
|
||||
@PreAuthorize("@ss.hasPermi('live:apply:add')")
|
||||
@Log(title = "直播申请", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody LiveApply liveApply)
|
||||
{
|
||||
return toAjax(liveApplyService.insertLiveApply(liveApply));
|
||||
}
|
||||
|
||||
@ApiOperation("修改直播申请")
|
||||
@PreAuthorize("@ss.hasPermi('live:apply:edit')")
|
||||
@Log(title = "直播申请", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody LiveApply liveApply)
|
||||
{
|
||||
return toAjax(liveApplyService.updateLiveApply(liveApply));
|
||||
}
|
||||
|
||||
@ApiOperation("删除直播申请")
|
||||
@PreAuthorize("@ss.hasPermi('live:apply:remove')")
|
||||
@Log(title = "直播申请", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(liveApplyService.deleteLiveApplyByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.ruoyi.cms.domain.liveSteam;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 直播申请表
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("直播申请")
|
||||
@TableName("live_apply")
|
||||
public class LiveApply extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID BIGINT自增 */
|
||||
@TableId(type = IdType.AUTO)
|
||||
@ApiModelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("直播标题")
|
||||
private String liveTitle;
|
||||
|
||||
@ApiModelProperty("直播主持人")
|
||||
private String livePerson;
|
||||
|
||||
@ApiModelProperty("直播描述")
|
||||
private String liveDescribe;
|
||||
|
||||
@ApiModelProperty("开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private String liveStartTime;
|
||||
|
||||
@ApiModelProperty("截至时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private String liveEndTime;
|
||||
|
||||
@ApiModelProperty("状态 1通过,2不通过")
|
||||
private String liveStatus;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.ruoyi.cms.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.cms.domain.liveSteam.LiveApply;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* 直播申请Mapper
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface LiveApplyMapper extends BaseMapper<LiveApply> {
|
||||
|
||||
List<LiveApply> selectLiveApplyList(LiveApply liveApply);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.ruoyi.cms.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.cms.domain.liveSteam.LiveApply;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface LiveApplyService extends IService<LiveApply> {
|
||||
|
||||
List<LiveApply> selectLiveApplyList(LiveApply liveApply);
|
||||
|
||||
LiveApply selectLiveApplyById(Long id);
|
||||
|
||||
int insertLiveApply(LiveApply liveApply);
|
||||
|
||||
int updateLiveApply(LiveApply liveApply);
|
||||
|
||||
int deleteLiveApplyByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.cms.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.cms.domain.liveSteam.LiveApply;
|
||||
import com.ruoyi.cms.mapper.LiveApplyMapper;
|
||||
import com.ruoyi.cms.service.LiveApplyService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class LiveApplyServiceImpl extends ServiceImpl<LiveApplyMapper, LiveApply> implements LiveApplyService {
|
||||
|
||||
@Autowired
|
||||
private LiveApplyMapper liveApplyMapper;
|
||||
|
||||
@Override
|
||||
public LiveApply selectLiveApplyById(Long id)
|
||||
{
|
||||
return liveApplyMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LiveApply> selectLiveApplyList(LiveApply liveApply)
|
||||
{
|
||||
return liveApplyMapper.selectLiveApplyList(liveApply);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertLiveApply(LiveApply liveApply)
|
||||
{
|
||||
return liveApplyMapper.insert(liveApply);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateLiveApply(LiveApply liveApply)
|
||||
{
|
||||
return liveApplyMapper.updateById(liveApply);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteLiveApplyByIds(Long[] ids)
|
||||
{
|
||||
return liveApplyMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user