-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from lingmengcan/dev
1.0.0
- Loading branch information
Showing
50 changed files
with
1,772 additions
and
686 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { IsNotEmpty } from 'class-validator'; | ||
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm'; | ||
|
||
@Entity('control_net_preprocessor') | ||
export class ControlNetPreprocessor { | ||
@PrimaryGeneratedColumn({ type: 'bigint', name: 'preprocessor_id', unsigned: true }) | ||
preprocessorId: number; | ||
|
||
@Column('varchar', { name: 'preprocessor_name', length: 100 }) | ||
preprocessorName: string; | ||
|
||
@Column('varchar', { name: 'preprocessor_code', length: 100 }) | ||
preprocessorCode: string; | ||
|
||
@Column('varchar', { name: 'preprocessor_type', length: 100 }) | ||
preprocessorType: string; | ||
|
||
@Column({ type: 'json', name: 'params' }) | ||
params: string; | ||
|
||
@Column('int', { name: 'sort' }) | ||
sort: number; | ||
|
||
@Column('tinyint', { | ||
name: 'status', | ||
comment: '-1 deleted, 0 normal, 1 deactivated', | ||
}) | ||
@IsNotEmpty() | ||
status: number; | ||
|
||
@Column('varchar', { name: 'description', length: 512 }) | ||
description: string; | ||
|
||
@Column('varchar', { name: 'created_user', length: 32 }) | ||
createdUser: string; | ||
|
||
@Column('varchar', { name: 'updated_user', length: 32 }) | ||
updatedUser: string; | ||
|
||
@Column('datetime', { | ||
name: 'created_at', | ||
default: () => 'CURRENT_TIMESTAMP', | ||
}) | ||
createdAt: Date; | ||
|
||
@Column('datetime', { | ||
name: 'updated_at', | ||
default: () => 'CURRENT_TIMESTAMP', | ||
}) | ||
updatedAt: Date; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ControlNetPreprocessor } from '@/entities/control-net-preprocessor.entity'; | ||
import { ControlNetPreprocessorService } from '@/services/control-net-preprocessor.service'; | ||
import { Module } from '@nestjs/common'; | ||
import { TypeOrmModule } from '@nestjs/typeorm'; | ||
|
||
@Module({ | ||
imports: [TypeOrmModule.forFeature([ControlNetPreprocessor])], | ||
providers: [ControlNetPreprocessorService], | ||
exports: [ControlNetPreprocessorService], | ||
}) | ||
export class ControlNetPreprocessorModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { DrawController } from '@/controllers/draw.controller'; | ||
import { DrawService } from '@/services/draw.service'; | ||
import { Module } from '@nestjs/common'; | ||
import { MediaModule } from './media.module'; | ||
import { ControlNetPreprocessorModule } from './control-net-preprocessor.module'; | ||
|
||
@Module({ | ||
imports: [MediaModule, ControlNetPreprocessorModule], | ||
controllers: [DrawController], | ||
providers: [DrawService], | ||
exports: [DrawService], | ||
}) | ||
export class DrawModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { ControlNetPreprocessor } from '@/entities/control-net-preprocessor.entity'; | ||
import { Injectable } from '@nestjs/common'; | ||
import { InjectRepository } from '@nestjs/typeorm'; | ||
import { DataSource, Repository } from 'typeorm'; | ||
|
||
@Injectable() | ||
export class ControlNetPreprocessorService { | ||
constructor( | ||
@InjectRepository(ControlNetPreprocessor) | ||
private repository: Repository<ControlNetPreprocessor>, | ||
private dataSource: DataSource, | ||
) {} | ||
|
||
/** | ||
* 列表 | ||
* | ||
* @returns | ||
*/ | ||
async findPreprocessorList() { | ||
const qb = this.repository | ||
.createQueryBuilder('ControlNetPreprocessor') | ||
.andWhere('ControlNetPreprocessor.status = 0'); | ||
|
||
qb.orderBy({ 'ControlNetPreprocessor.sort': 'ASC' }); | ||
|
||
return qb.getMany(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
|
||
@Injectable() | ||
export class DrawService {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.