init
This commit is contained in:
@@ -0,0 +1,96 @@
|
|||||||
|
package com.ruoyi.cai.controller;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.ruoyi.cai.domain.CaiReportCate;
|
||||||
|
import com.ruoyi.cai.service.CaiReportCateService;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 举报分类
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2023-12-24
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/cai/reportCate")
|
||||||
|
public class CaiReportCateController extends BaseController {
|
||||||
|
|
||||||
|
private final CaiReportCateService caiReportCateService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询举报分类列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:reportCate:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<CaiReportCate> list(CaiReportCate bo, PageQuery pageQuery) {
|
||||||
|
Page<CaiReportCate> page = caiReportCateService.page(pageQuery.build(), Wrappers.lambdaQuery(bo));
|
||||||
|
return TableDataInfo.build(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取举报分类详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:reportCate:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<CaiReportCate> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Integer id) {
|
||||||
|
return R.ok(caiReportCateService.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增举报分类
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:reportCate:add")
|
||||||
|
@Log(title = "举报分类", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody CaiReportCate bo) {
|
||||||
|
return toAjax(caiReportCateService.save(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改举报分类
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:reportCate:edit")
|
||||||
|
@Log(title = "举报分类", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CaiReportCate bo) {
|
||||||
|
return toAjax(caiReportCateService.updateById(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除举报分类
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:reportCate:remove")
|
||||||
|
@Log(title = "举报分类", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Integer[] ids) {
|
||||||
|
return toAjax(caiReportCateService.removeBatchByIds(Arrays.asList(ids), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
package com.ruoyi.cai.controller;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.ruoyi.cai.domain.CaiReport;
|
||||||
|
import com.ruoyi.cai.service.CaiReportService;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 举报
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2023-12-24
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/cai/report")
|
||||||
|
public class CaiReportController extends BaseController {
|
||||||
|
|
||||||
|
private final CaiReportService caiReportService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询举报列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:report:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<CaiReport> list(CaiReport bo, PageQuery pageQuery) {
|
||||||
|
Page<CaiReport> page = caiReportService.page(pageQuery.build(), Wrappers.lambdaQuery(bo));
|
||||||
|
return TableDataInfo.build(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取举报详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:report:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<CaiReport> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long id) {
|
||||||
|
return R.ok(caiReportService.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增举报
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:report:add")
|
||||||
|
@Log(title = "举报", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody CaiReport bo) {
|
||||||
|
return toAjax(caiReportService.save(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改举报
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:report:edit")
|
||||||
|
@Log(title = "举报", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CaiReport bo) {
|
||||||
|
return toAjax(caiReportService.updateById(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除举报
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:report:remove")
|
||||||
|
@Log(title = "举报", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] ids) {
|
||||||
|
return toAjax(caiReportService.removeBatchByIds(Arrays.asList(ids), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
58
ruoyi-cai/src/main/java/com/ruoyi/cai/domain/CaiReport.java
Normal file
58
ruoyi-cai/src/main/java/com/ruoyi/cai/domain/CaiReport.java
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
package com.ruoyi.cai.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 举报对象 cai_report
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2023-12-24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("cai_report")
|
||||||
|
public class CaiReport implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 举报类型 1 个人详情页 2 视频结束 3 动态 4.IM页面
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
/**
|
||||||
|
* 举报分类名称
|
||||||
|
*/
|
||||||
|
private String cateName;
|
||||||
|
/**
|
||||||
|
* 举报分类
|
||||||
|
*/
|
||||||
|
private Long cateId;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 举报对象
|
||||||
|
*/
|
||||||
|
private Long reportUid;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 状态 0 未处理 1 已经处理
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.ruoyi.cai.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 举报分类对象 cai_report_cate
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2023-12-24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("cai_report_cate")
|
||||||
|
public class CaiReportCate implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Integer id;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.ruoyi.cai.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.ruoyi.cai.domain.CaiReportCate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 举报分类Mapper接口
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2023-12-24
|
||||||
|
*/
|
||||||
|
public interface CaiReportCateMapper extends BaseMapper<CaiReportCate> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.ruoyi.cai.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.ruoyi.cai.domain.CaiReport;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 举报Mapper接口
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2023-12-24
|
||||||
|
*/
|
||||||
|
public interface CaiReportMapper extends BaseMapper<CaiReport> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.ruoyi.cai.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.ruoyi.cai.domain.CaiReportCate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 举报分类Service接口
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2023-12-24
|
||||||
|
*/
|
||||||
|
public interface CaiReportCateService extends IService<CaiReportCate> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.ruoyi.cai.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.ruoyi.cai.domain.CaiReport;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 举报Service接口
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2023-12-24
|
||||||
|
*/
|
||||||
|
public interface CaiReportService extends IService<CaiReport> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.ruoyi.cai.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.ruoyi.cai.domain.CaiReportCate;
|
||||||
|
import com.ruoyi.cai.mapper.CaiReportCateMapper;
|
||||||
|
import com.ruoyi.cai.service.CaiReportCateService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 举报分类Service业务层处理
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2023-12-24
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class CaiReportCateServiceImpl extends ServiceImpl<CaiReportCateMapper,CaiReportCate> implements CaiReportCateService {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.ruoyi.cai.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.ruoyi.cai.domain.CaiReport;
|
||||||
|
import com.ruoyi.cai.mapper.CaiReportMapper;
|
||||||
|
import com.ruoyi.cai.service.CaiReportService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 举报Service业务层处理
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2023-12-24
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class CaiReportServiceImpl extends ServiceImpl<CaiReportMapper,CaiReport> implements CaiReportService {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<?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.ruoyi.cai.mapper.CaiReportCateMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.ruoyi.cai.domain.CaiReportCate" id="CaiReportCateResult">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="name" column="name"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
20
ruoyi-cai/src/main/resources/mapper/cai/CaiReportMapper.xml
Normal file
20
ruoyi-cai/src/main/resources/mapper/cai/CaiReportMapper.xml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?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.ruoyi.cai.mapper.CaiReportMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.ruoyi.cai.domain.CaiReport" id="CaiReportResult">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="type" column="type"/>
|
||||||
|
<result property="cateName" column="cate_name"/>
|
||||||
|
<result property="cateId" column="cate_id"/>
|
||||||
|
<result property="userId" column="user_id"/>
|
||||||
|
<result property="reportUid" column="report_uid"/>
|
||||||
|
<result property="content" column="content"/>
|
||||||
|
<result property="status" column="status"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user