Skip to content

Commit

Permalink
modify: 修改 ossc 模块名称为 oss
Browse files Browse the repository at this point in the history
  • Loading branch information
kangood committed Feb 24, 2024
1 parent 9fde6f9 commit 4b0b534
Show file tree
Hide file tree
Showing 12 changed files with 88 additions and 88 deletions.
30 changes: 15 additions & 15 deletions prune.sql
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ INSERT INTO `c_menu` (`id`, `name`, `label`, `resource_type`, `tree_grade`, `des
INSERT INTO `c_menu` (`id`, `name`, `label`, `resource_type`, `tree_grade`, `describe_`, `is_general`, `path`, `component`, `state`, `sort_value`, `icon`, `group_`, `data_scope`, `custom_class`, `is_def`, `parentId`, `mpath`, `readonly_`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('512095515308101', '权限管理', 'sys.menu2.authority.index', '10', NULL, NULL, b'0', 'authority', NULL, b'1', 4, 'ic2-authority', NULL, NULL, NULL, b'0', NULL, '512095515308101.', b'0', NULL, NULL, '2023-12-18 08:41:59', NULL, '2023-12-18 08:41:59');
INSERT INTO `c_menu` (`id`, `name`, `label`, `resource_type`, `tree_grade`, `describe_`, `is_general`, `path`, `component`, `state`, `sort_value`, `icon`, `group_`, `data_scope`, `custom_class`, `is_def`, `parentId`, `mpath`, `readonly_`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('512103019884613', '基础配置', 'sys.menu2.base.index', '10', NULL, NULL, b'0', 'base', NULL, b'1', 5, 'ic2-base', NULL, NULL, NULL, b'0', NULL, '512103019884613.', b'0', NULL, NULL, '2023-12-18 09:12:31', NULL, '2023-12-18 09:12:31');
INSERT INTO `c_menu` (`id`, `name`, `label`, `resource_type`, `tree_grade`, `describe_`, `is_general`, `path`, `component`, `state`, `sort_value`, `icon`, `group_`, `data_scope`, `custom_class`, `is_def`, `parentId`, `mpath`, `readonly_`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('512216121036869', '资源管理', 'sys.menu2.resource.index', '10', NULL, NULL, b'0', 'resource', NULL, b'1', 6, 'ic2-resource', NULL, NULL, NULL, b'0', NULL, '512216121036869.', b'0', NULL, NULL, '2023-12-18 16:52:44', NULL, '2023-12-18 16:52:44');
INSERT INTO `c_menu` (`id`, `name`, `label`, `resource_type`, `tree_grade`, `describe_`, `is_general`, `path`, `component`, `state`, `sort_value`, `icon`, `group_`, `data_scope`, `custom_class`, `is_def`, `parentId`, `mpath`, `readonly_`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('512216970563653', '对象存储', 'sys.menu2.resource.ossc', '20', NULL, NULL, b'0', 'osscs', '/resource/osscs/list.page.tsx', b'1', 1, '', NULL, NULL, NULL, b'0', '512216121036869', '512216121036869.512216970563653.', b'0', NULL, NULL, '2023-12-18 16:56:11', NULL, '2023-12-18 16:56:11');
INSERT INTO `c_menu` (`id`, `name`, `label`, `resource_type`, `tree_grade`, `describe_`, `is_general`, `path`, `component`, `state`, `sort_value`, `icon`, `group_`, `data_scope`, `custom_class`, `is_def`, `parentId`, `mpath`, `readonly_`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('512216970563653', '对象存储', 'sys.menu2.resource.oss', '20', NULL, NULL, b'0', 'osss', '/resource/osss/list.page.tsx', b'1', 1, '', NULL, NULL, NULL, b'0', '512216121036869', '512216121036869.512216970563653.', b'0', NULL, NULL, '2023-12-18 16:56:11', NULL, '2023-12-18 16:56:11');
COMMIT;

-- ----------------------------
Expand Down Expand Up @@ -282,10 +282,10 @@ INSERT INTO `c_org` (`id`, `label`, `type_`, `abbreviation`, `parentId`, `mpath`
COMMIT;

-- ----------------------------
-- Table structure for c_ossc
-- Table structure for c_oss
-- ----------------------------
DROP TABLE IF EXISTS `c_ossc`;
CREATE TABLE `c_ossc` (
DROP TABLE IF EXISTS `c_oss`;
CREATE TABLE `c_oss` (
`id` varchar(20) NOT NULL COMMENT '主键',
`code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '资源编码',
`category` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '种类',
Expand All @@ -304,16 +304,16 @@ CREATE TABLE `c_ossc` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of c_ossc
-- Records of c_oss
-- ----------------------------
BEGIN;
INSERT INTO `c_ossc` (`id`, `code`, `category`, `bucket_name`, `access_key`, `secret_key`, `endpoint`, `describe`, `state`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('512293694996549', 'qiniu-panlore', '2', 'figure-bed', 'x6gL6f28tRdRszYJ7WMB_3RvG_vajTODD0RwvWWg', 'H0fxWDsOF6E_aqefAh5XRpQpLrj0vPxOZ3oCdwRv', 'http://s3.cn-south-1.qiniucs.com', NULL, b'1', NULL, NULL, '2023-12-18 22:08:54.664000', NULL, '2023-12-21 19:56:34.000000');
INSERT INTO `c_ossc` (`id`, `code`, `category`, `bucket_name`, `access_key`, `secret_key`, `endpoint`, `describe`, `state`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('512293825183813', 'ali-kangod', '3', 'kd-resources', 'LTAI5tNaV4WeFuBzc4vtEc9m', 'ZKmNmyvhEu35WbHwVRgxMpVk3XBkDu', 'https://oss-cn-chengdu.aliyuncs.com', NULL, b'0', NULL, NULL, '2023-12-18 22:08:54.664000', NULL, '2023-12-21 15:10:29.000000');
INSERT INTO `c_ossc` (`id`, `code`, `category`, `bucket_name`, `access_key`, `secret_key`, `endpoint`, `describe`, `state`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('513209566588997', '123', '2', '213', '31212', '123', 'dadqwe', NULL, b'1', NULL, NULL, '2023-12-21 12:15:04.343000', NULL, '2023-12-21 12:20:10.000000');
INSERT INTO `c_ossc` (`id`, `code`, `category`, `bucket_name`, `access_key`, `secret_key`, `endpoint`, `describe`, `state`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('513209590362181', '3213', '2', '3123', '3112', '3213', 'dazzaz', '312', b'1', NULL, NULL, '2023-12-21 12:15:10.147000', NULL, '2023-12-21 12:20:14.000000');
INSERT INTO `c_ossc` (`id`, `code`, `category`, `bucket_name`, `access_key`, `secret_key`, `endpoint`, `describe`, `state`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('513209620418629', '3123', '3', '3123', '3123', '123', 'dqwdqzzz', '3123', b'1', NULL, NULL, '2023-12-21 12:15:17.485000', NULL, '2023-12-21 12:20:18.000000');
INSERT INTO `c_ossc` (`id`, `code`, `category`, `bucket_name`, `access_key`, `secret_key`, `endpoint`, `describe`, `state`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('513209982296133', 'dsadqwd', '3', 'sadsad', 'sadsad', 'sadsad', 'asdasd', NULL, b'1', NULL, NULL, '2023-12-21 12:16:45.834000', NULL, '2023-12-21 12:16:45.834000');
INSERT INTO `c_ossc` (`id`, `code`, `category`, `bucket_name`, `access_key`, `secret_key`, `endpoint`, `describe`, `state`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('513210013646917', 'sadsadqwqw', '1', 'asdas', 'sadas', 'dasasd', 'qweqwe', NULL, b'1', NULL, NULL, '2023-12-21 12:16:53.488000', NULL, '2023-12-21 12:16:53.488000');
INSERT INTO `c_oss` (`id`, `code`, `category`, `bucket_name`, `access_key`, `secret_key`, `endpoint`, `describe`, `state`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('512293694996549', 'qiniu-panlore', '2', 'figure-bed', 'x6gL6f28tRdRszYJ7WMB_3RvG_vajTODD0RwvWWg', 'H0fxWDsOF6E_aqefAh5XRpQpLrj0vPxOZ3oCdwRv', 'http://s3.cn-south-1.qiniucs.com', NULL, b'1', NULL, NULL, '2023-12-18 22:08:54.664000', NULL, '2023-12-21 19:56:34.000000');
INSERT INTO `c_oss` (`id`, `code`, `category`, `bucket_name`, `access_key`, `secret_key`, `endpoint`, `describe`, `state`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('512293825183813', 'ali-kangod', '3', 'kd-resources', 'LTAI5tNaV4WeFuBzc4vtEc9m', 'ZKmNmyvhEu35WbHwVRgxMpVk3XBkDu', 'https://oss-cn-chengdu.aliyuncs.com', NULL, b'0', NULL, NULL, '2023-12-18 22:08:54.664000', NULL, '2023-12-21 15:10:29.000000');
INSERT INTO `c_oss` (`id`, `code`, `category`, `bucket_name`, `access_key`, `secret_key`, `endpoint`, `describe`, `state`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('513209566588997', '123', '2', '213', '31212', '123', 'dadqwe', NULL, b'1', NULL, NULL, '2023-12-21 12:15:04.343000', NULL, '2023-12-21 12:20:10.000000');
INSERT INTO `c_oss` (`id`, `code`, `category`, `bucket_name`, `access_key`, `secret_key`, `endpoint`, `describe`, `state`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('513209590362181', '3213', '2', '3123', '3112', '3213', 'dazzaz', '312', b'1', NULL, NULL, '2023-12-21 12:15:10.147000', NULL, '2023-12-21 12:20:14.000000');
INSERT INTO `c_oss` (`id`, `code`, `category`, `bucket_name`, `access_key`, `secret_key`, `endpoint`, `describe`, `state`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('513209620418629', '3123', '3', '3123', '3123', '123', 'dqwdqzzz', '3123', b'1', NULL, NULL, '2023-12-21 12:15:17.485000', NULL, '2023-12-21 12:20:18.000000');
INSERT INTO `c_oss` (`id`, `code`, `category`, `bucket_name`, `access_key`, `secret_key`, `endpoint`, `describe`, `state`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('513209982296133', 'dsadqwd', '3', 'sadsad', 'sadsad', 'sadsad', 'asdasd', NULL, b'1', NULL, NULL, '2023-12-21 12:16:45.834000', NULL, '2023-12-21 12:16:45.834000');
INSERT INTO `c_oss` (`id`, `code`, `category`, `bucket_name`, `access_key`, `secret_key`, `endpoint`, `describe`, `state`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('513210013646917', 'sadsadqwqw', '1', 'asdas', 'sadas', 'dasasd', 'qweqwe', NULL, b'1', NULL, NULL, '2023-12-21 12:16:53.488000', NULL, '2023-12-21 12:16:53.488000');
COMMIT;

-- ----------------------------
Expand Down Expand Up @@ -403,9 +403,9 @@ INSERT INTO `c_resource` (`id`, `code`, `name`, `menu_id`, `describe_`, `readonl
INSERT INTO `c_resource` (`id`, `code`, `name`, `menu_id`, `describe_`, `readonly_`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('477524312936517', 'org:station:importExcel', '导入', '473633775972421', NULL, b'0', NULL, NULL, '2023-09-11 16:11:24.228134', NULL, '2023-09-11 16:11:24.228134');
INSERT INTO `c_resource` (`id`, `code`, `name`, `menu_id`, `describe_`, `readonly_`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('477540145778757', 'org:userRole:listUserRoleByRoleId;org:roleAuthority:listRoleAuthorityIdByRoleId;org:userRole:saveListAfterDelete', '分配角色', '477506352619589', NULL, b'0', NULL, NULL, '2023-09-11 17:15:49.679589', NULL, '2023-09-16 19:52:57.737020');
INSERT INTO `c_resource` (`id`, `code`, `name`, `menu_id`, `describe_`, `readonly_`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('477540812017733', 'org:roleAuthority:listRoleAuthorityIdByRoleId;system:resource:list;org:roleAuthority:saveBatchRoleAutority', '分配资源', '477506352619589', NULL, b'0', NULL, NULL, '2023-09-11 17:18:32.326606', NULL, '2023-09-16 19:52:57.739896');
INSERT INTO `c_resource` (`id`, `code`, `name`, `menu_id`, `describe_`, `readonly_`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('512263975366725', 'resource:ossc:store', '新建', '512216970563653', NULL, b'0', NULL, NULL, '2023-12-18 20:07:27.136296', NULL, '2023-12-18 20:07:27.136296');
INSERT INTO `c_resource` (`id`, `code`, `name`, `menu_id`, `describe_`, `readonly_`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('512264058916933', 'resource:ossc:delete', '删除', '512216970563653', NULL, b'0', NULL, NULL, '2023-12-18 20:07:47.518657', NULL, '2023-12-18 20:07:47.518657');
INSERT INTO `c_resource` (`id`, `code`, `name`, `menu_id`, `describe_`, `readonly_`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('512264133689413', 'resource:ossc:update', '更新', '512216970563653', NULL, b'0', NULL, NULL, '2023-12-18 20:08:05.772686', NULL, '2023-12-18 20:08:05.772686');
INSERT INTO `c_resource` (`id`, `code`, `name`, `menu_id`, `describe_`, `readonly_`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('512263975366725', 'resource:oss:store', '新建', '512216970563653', NULL, b'0', NULL, NULL, '2023-12-18 20:07:27.136296', NULL, '2023-12-18 20:07:27.136296');
INSERT INTO `c_resource` (`id`, `code`, `name`, `menu_id`, `describe_`, `readonly_`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('512264058916933', 'resource:oss:delete', '删除', '512216970563653', NULL, b'0', NULL, NULL, '2023-12-18 20:07:47.518657', NULL, '2023-12-18 20:07:47.518657');
INSERT INTO `c_resource` (`id`, `code`, `name`, `menu_id`, `describe_`, `readonly_`, `deleted_at`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES ('512264133689413', 'resource:oss:update', '更新', '512216970563653', NULL, b'0', NULL, NULL, '2023-12-18 20:08:05.772686', NULL, '2023-12-18 20:08:05.772686');
COMMIT;

-- ----------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/modules/resource/controllers/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './ossc.controller';
export * from './oss.controller';
33 changes: 33 additions & 0 deletions src/modules/resource/controllers/oss.controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Controller, Get, Query } from '@nestjs/common';

import { RequireAuthority, RequireLogin } from '@/modules/auth/auth.decorator';
import { BaseController } from '@/modules/restful/base';
import { Crud } from '@/modules/restful/decorators';

import { CreateOssDto, QueryOssDto, UpdateOssDto } from '../dtos';

import { OssService } from '../services';

@Crud({
id: 'oss',
enabled: ['list', 'detail', 'store', 'update', 'delete', 'restore'],
dtos: {
store: CreateOssDto,
update: UpdateOssDto,
list: QueryOssDto,
},
preAuth: 'resource:oss:',
})
@Controller('oss')
@RequireLogin()
export class OssController extends BaseController<OssService> {
constructor(protected service: OssService) {
super(service);
}

@Get('listRelate')
@RequireAuthority('resource:oss:listRelate')
async listRelate(@Query() options: QueryOssDto) {
return this.service.listRelate(options);
}
}
33 changes: 0 additions & 33 deletions src/modules/resource/controllers/ossc.controller.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/modules/resource/dtos/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './ossc.dto';
export * from './oss.dto';
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import { IsUnique, IsUniqueExist } from '@/modules/database/constraints';
import { ListWithTrashedQueryDto } from '@/modules/restful/dtos';
import { PublicOrderType } from '@/modules/system/constants';

import { OsscEntity } from '../entities';
import { OssEntity } from '../entities';

/**
* 分页查询验证
*/
@DtoValidation({ type: 'query' })
export class QueryOsscDto extends ListWithTrashedQueryDto {
export class QueryOssDto extends ListWithTrashedQueryDto {
@IsEnum(PublicOrderType, {
message: `排序规则必须是${Object.values(PublicOrderType).join(',')}其中一项`,
})
Expand All @@ -34,12 +34,12 @@ export class QueryOsscDto extends ListWithTrashedQueryDto {
* 创建验证
*/
@DtoValidation({ groups: ['create'] })
export class CreateOsscDto {
@IsUnique(OsscEntity, {
export class CreateOssDto {
@IsUnique(OssEntity, {
groups: ['create'],
message: '资源编码名称重复',
})
@IsUniqueExist(OsscEntity, {
@IsUniqueExist(OssEntity, {
groups: ['update'],
message: '资源编码重复',
})
Expand All @@ -51,15 +51,15 @@ export class CreateOsscDto {
* 更新验证
*/
@DtoValidation({ groups: ['update'] })
export class UpdateOsscDto extends PartialType(CreateOsscDto) {
@IsNumberString(undefined, { groups: ['update'], message: '对象储存ID格式错误' })
export class UpdateOssDto extends PartialType(CreateOssDto) {
@IsNumberString(undefined, { groups: ['update'], message: '对象存储ID格式错误' })
@IsDefined({ groups: ['update'], message: 'ID必须指定' })
id!: string;
}

/**
* 翻译成字典值的DTO
*/
export class OsscEchoDto {
export class OssEchoDto {
category: string;
}
2 changes: 1 addition & 1 deletion src/modules/resource/entities/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './ossc.entity';
export * from './oss.entity';
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { Column, CreateDateColumn, DeleteDateColumn, Entity, UpdateDateColumn }
import { BoolBitTransformer } from '@/modules/core/helpers/utils';
import { BaseEntity } from '@/modules/database/base';

import { OsscEchoDto } from '../dtos';
import { OssEchoDto } from '../dtos';

@Entity('c_ossc', { schema: 'prune' })
export class OsscEntity extends BaseEntity {
@Entity('c_oss', { schema: 'prune' })
export class OssEntity extends BaseEntity {
@Type()
osscEchoDto: OsscEchoDto;
ossEchoDto: OssEchoDto;

@Column('varchar', {
name: 'code',
Expand Down
2 changes: 1 addition & 1 deletion src/modules/resource/repositories/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './ossc.repository';
export * from './oss.repository';
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { BaseRepository } from '@/modules/database/base';
import { CustomRepository } from '@/modules/database/decorators';

import { OsscEntity } from '../entities';
import { OssEntity } from '../entities';

@CustomRepository(OsscEntity)
export class OsscRepository extends BaseRepository<OsscEntity> {
protected _qbName = 'ossc';
@CustomRepository(OssEntity)
export class OssRepository extends BaseRepository<OssEntity> {
protected _qbName = 'oss';

buildBaseQB() {
return this.createQueryBuilder(this.qbName);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/resource/services/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './ossc.service';
export * from './oss.service';
Loading

0 comments on commit 4b0b534

Please sign in to comment.