Add adult verification and erotic moderation features: Implement new routes and controller methods for managing adult verification requests, status updates, and document retrieval. Introduce erotic moderation actions and reports, enhancing administrative capabilities. Update chat and navigation controllers to support adult content filtering and access control. Enhance user parameter handling for adult verification status and requests, improving overall user experience and compliance.
This commit is contained in:
@@ -18,6 +18,8 @@ import UserParamVisibilityType from './type/user_param_visibility.js';
|
||||
import UserParamVisibility from './community/user_param_visibility.js';
|
||||
import Folder from './community/folder.js';
|
||||
import Image from './community/image.js';
|
||||
import EroticVideo from './community/erotic_video.js';
|
||||
import EroticContentReport from './community/erotic_content_report.js';
|
||||
import ImageVisibilityType from './type/image_visibility.js';
|
||||
import ImageVisibilityUser from './community/image_visibility_user.js';
|
||||
import FolderImageVisibility from './community/folder_image_visibility.js';
|
||||
@@ -209,6 +211,14 @@ export default function setupAssociations() {
|
||||
Image.belongsTo(User, { foreignKey: 'userId' });
|
||||
User.hasMany(Image, { foreignKey: 'userId' });
|
||||
|
||||
EroticVideo.belongsTo(User, { foreignKey: 'userId', as: 'owner' });
|
||||
User.hasMany(EroticVideo, { foreignKey: 'userId', as: 'eroticVideos' });
|
||||
|
||||
EroticContentReport.belongsTo(User, { foreignKey: 'reporterId', as: 'reporter' });
|
||||
User.hasMany(EroticContentReport, { foreignKey: 'reporterId', as: 'eroticContentReports' });
|
||||
EroticContentReport.belongsTo(User, { foreignKey: 'handledBy', as: 'moderator' });
|
||||
User.hasMany(EroticContentReport, { foreignKey: 'handledBy', as: 'handledEroticContentReports' });
|
||||
|
||||
// Image visibility associations
|
||||
Folder.belongsToMany(ImageVisibilityType, {
|
||||
through: FolderImageVisibility,
|
||||
|
||||
@@ -20,6 +20,10 @@ const Room = sequelize.define('Room', {
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: false,
|
||||
defaultValue: true},
|
||||
isAdultOnly: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: false,
|
||||
defaultValue: false},
|
||||
genderRestrictionId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: true},
|
||||
|
||||
64
backend/models/community/erotic_content_report.js
Normal file
64
backend/models/community/erotic_content_report.js
Normal file
@@ -0,0 +1,64 @@
|
||||
import { Model, DataTypes } from 'sequelize';
|
||||
import { sequelize } from '../../utils/sequelize.js';
|
||||
|
||||
class EroticContentReport extends Model {}
|
||||
|
||||
EroticContentReport.init({
|
||||
id: {
|
||||
type: DataTypes.INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true
|
||||
},
|
||||
reporterId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
field: 'reporter_id'
|
||||
},
|
||||
targetType: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
field: 'target_type'
|
||||
},
|
||||
targetId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
field: 'target_id'
|
||||
},
|
||||
reason: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false
|
||||
},
|
||||
note: {
|
||||
type: DataTypes.TEXT,
|
||||
allowNull: true
|
||||
},
|
||||
status: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
defaultValue: 'open'
|
||||
},
|
||||
actionTaken: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: true,
|
||||
field: 'action_taken'
|
||||
},
|
||||
handledBy: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: true,
|
||||
field: 'handled_by'
|
||||
},
|
||||
handledAt: {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: true,
|
||||
field: 'handled_at'
|
||||
}
|
||||
}, {
|
||||
sequelize,
|
||||
modelName: 'EroticContentReport',
|
||||
tableName: 'erotic_content_report',
|
||||
schema: 'community',
|
||||
timestamps: true,
|
||||
underscored: true
|
||||
});
|
||||
|
||||
export default EroticContentReport;
|
||||
55
backend/models/community/erotic_video.js
Normal file
55
backend/models/community/erotic_video.js
Normal file
@@ -0,0 +1,55 @@
|
||||
import { Model, DataTypes } from 'sequelize';
|
||||
import { sequelize } from '../../utils/sequelize.js';
|
||||
|
||||
class EroticVideo extends Model {}
|
||||
|
||||
EroticVideo.init({
|
||||
id: {
|
||||
type: DataTypes.INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true
|
||||
},
|
||||
title: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false
|
||||
},
|
||||
description: {
|
||||
type: DataTypes.TEXT,
|
||||
allowNull: true
|
||||
},
|
||||
originalFileName: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
field: 'original_file_name'
|
||||
},
|
||||
hash: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
unique: true
|
||||
},
|
||||
mimeType: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
field: 'mime_type'
|
||||
},
|
||||
isModeratedHidden: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: false,
|
||||
defaultValue: false,
|
||||
field: 'is_moderated_hidden'
|
||||
},
|
||||
userId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
field: 'user_id'
|
||||
}
|
||||
}, {
|
||||
sequelize,
|
||||
modelName: 'EroticVideo',
|
||||
tableName: 'erotic_video',
|
||||
schema: 'community',
|
||||
timestamps: true,
|
||||
underscored: true
|
||||
});
|
||||
|
||||
export default EroticVideo;
|
||||
@@ -6,6 +6,11 @@ const Folder = sequelize.define('folder', {
|
||||
name: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false},
|
||||
isAdultArea: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: false,
|
||||
defaultValue: false
|
||||
},
|
||||
parentId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: true
|
||||
|
||||
@@ -6,6 +6,16 @@ const Image = sequelize.define('image', {
|
||||
title: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false},
|
||||
isAdultContent: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: false,
|
||||
defaultValue: false
|
||||
},
|
||||
isModeratedHidden: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: false,
|
||||
defaultValue: false
|
||||
},
|
||||
description: {
|
||||
type: DataTypes.TEXT,
|
||||
allowNull: true},
|
||||
|
||||
@@ -18,6 +18,8 @@ import UserParamVisibilityType from './type/user_param_visibility.js';
|
||||
import UserParamVisibility from './community/user_param_visibility.js';
|
||||
import Folder from './community/folder.js';
|
||||
import Image from './community/image.js';
|
||||
import EroticVideo from './community/erotic_video.js';
|
||||
import EroticContentReport from './community/erotic_content_report.js';
|
||||
import ImageVisibilityType from './type/image_visibility.js';
|
||||
import ImageVisibilityUser from './community/image_visibility_user.js';
|
||||
import FolderImageVisibility from './community/folder_image_visibility.js';
|
||||
@@ -170,6 +172,8 @@ const models = {
|
||||
UserParamVisibility,
|
||||
Folder,
|
||||
Image,
|
||||
EroticVideo,
|
||||
EroticContentReport,
|
||||
ImageVisibilityType,
|
||||
ImageVisibilityUser,
|
||||
FolderImageVisibility,
|
||||
|
||||
Reference in New Issue
Block a user