资源模块
Project description
模块介绍
1.资源上传
1.文件上传
2.图片上传
SQL
CREATE TABLE `resource_file` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID',
`title` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`url` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '保存路径',
`filename` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '文件名称',
`format` varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT '文件后缀',
`thumb` varchar(255) COLLATE utf8_unicode_ci DEFAULT '' COMMENT '缩略图位置',
`md5` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`snapshot` json DEFAULT NULL COMMENT '文件快照',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='文件上传表';
CREATE TABLE `resource_file_map` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`file_id` int(11) NOT NULL COMMENT '图片ID',
`source_id` int(11) NOT NULL COMMENT '来源表 关联ID',
`source_table` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '来源表表明',
`price` int(10) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `image_id` (`file_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `resource_image` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID',
`title` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`url` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '保存路径',
`filename` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '文件名称',
`format` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '文件后缀',
`thumb` varchar(255) COLLATE utf8_unicode_ci DEFAULT '' COMMENT '缩略图位置',
`md5` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`snapshot` json DEFAULT NULL COMMENT '文件快照',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='文件上传表';
CREATE TABLE `resource_image_map` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`image_id` int(11) NOT NULL COMMENT '图片ID',
`source_id` int(11) NOT NULL COMMENT '来源表 关联ID',
`source_table` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '来源表表明',
`price` int(10) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `image_id` (`image_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
配置
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
xj_resource-1.0.0.tar.gz
(11.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xj_resource-1.0.0.tar.gz.
File metadata
- Download URL: xj_resource-1.0.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c35089eb69f46dad4d5b2e5a995b052e10527cef05f4fc22042626baa90c0e9
|
|
| MD5 |
ed0bb7e1fdbe9a39d65f74c7d7c11c79
|
|
| BLAKE2b-256 |
b19f879e70f010603c8df85f0fac57b5a9ca2bed1e3be6171a841b72b4dbb48d
|
File details
Details for the file xj_resource-1.0.0-py3-none-any.whl.
File metadata
- Download URL: xj_resource-1.0.0-py3-none-any.whl
- Upload date:
- Size: 20.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a75a3d5ee495fad5f29bd50bf3e1b6ec3f415a16da41da3144789cdac8105eed
|
|
| MD5 |
34345cefc4c773a0a7159d55cc224bc9
|
|
| BLAKE2b-256 |
571f7762cb7b17f848c5b5eaf4942eeb853d9a435828dc1b6e95df69374ed829
|