be refactor

main
Peace 2 months ago
parent 3daefc7b1b
commit 8f9a049310
  1. 2
      backend/dist/auth/auth.service.d.ts
  2. 2
      backend/dist/tsconfig.build.tsbuildinfo
  3. 10
      backend/dist/users/user.entity.d.ts
  4. 57
      backend/dist/users/user.entity.js
  5. 1
      backend/dist/users/user.entity.js.map
  6. 2
      backend/dist/users/users.module.js
  7. 2
      backend/dist/users/users.module.js.map
  8. 2
      backend/dist/users/users.service.d.ts
  9. 2
      backend/dist/users/users.service.js
  10. 2
      backend/dist/users/users.service.js.map
  11. 2
      backend/src/profiles/entities/profile.entity.ts
  12. 2
      backend/src/profiles/profiles.controller.ts
  13. 4
      backend/src/profiles/profiles.module.ts
  14. 4
      backend/src/profiles/profiles.service.ts
  15. 12
      backend/src/scripts/data/sample-user.ts
  16. 0
      backend/src/scripts/generate-dummy-data.ts
  17. 2
      backend/src/users/entities/user.entity.ts
  18. 2
      backend/src/users/users.module.ts
  19. 2
      backend/src/users/users.service.ts

@ -7,7 +7,7 @@ export declare class AuthService {
private userService; private userService;
private jwtService; private jwtService;
constructor(userService: UsersService, jwtService: JwtService); constructor(userService: UsersService, jwtService: JwtService);
signup(dto: CreateUserDto): Promise<import("../users/user.entity").User>; signup(dto: CreateUserDto): Promise<import("../users/entities/user.entity").User>;
login(dto: LoginUserDto): Promise<LoginResponseDto>; login(dto: LoginUserDto): Promise<LoginResponseDto>;
isNameAvailable(name: string): Promise<boolean>; isNameAvailable(name: string): Promise<boolean>;
isEmailAvailabe(email: string): Promise<boolean>; isEmailAvailabe(email: string): Promise<boolean>;

File diff suppressed because one or more lines are too long

@ -1,10 +0,0 @@
import { TimestampedEntity } from 'src/common/entities/timestamped.entity';
import { Profile } from 'src/profiles/profile.entity';
export declare class User extends TimestampedEntity {
id: number;
name: string;
email?: string;
password: string;
profile?: Profile;
deletedAt?: Date;
}

@ -1,57 +0,0 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.User = void 0;
const openapi = require("@nestjs/swagger");
const timestamped_entity_1 = require("../common/entities/timestamped.entity");
const profile_entity_1 = require("../profiles/profile.entity");
const typeorm_1 = require("typeorm");
let User = class User extends timestamped_entity_1.TimestampedEntity {
id;
name;
email;
password;
profile;
deletedAt;
static _OPENAPI_METADATA_FACTORY() {
return { id: { required: true, type: () => Number }, name: { required: true, type: () => String }, email: { required: false, type: () => String }, password: { required: true, type: () => String }, profile: { required: false, type: () => require("../profiles/profile.entity").Profile }, deletedAt: { required: false, type: () => Date } };
}
};
exports.User = User;
__decorate([
(0, typeorm_1.PrimaryGeneratedColumn)(),
__metadata("design:type", Number)
], User.prototype, "id", void 0);
__decorate([
(0, typeorm_1.Column)({ unique: true }),
__metadata("design:type", String)
], User.prototype, "name", void 0);
__decorate([
(0, typeorm_1.Column)({ unique: true, nullable: true }),
__metadata("design:type", String)
], User.prototype, "email", void 0);
__decorate([
(0, typeorm_1.Column)(),
__metadata("design:type", String)
], User.prototype, "password", void 0);
__decorate([
(0, typeorm_1.OneToOne)(() => profile_entity_1.Profile, (profile) => profile.user, { cascade: true }),
(0, typeorm_1.JoinColumn)(),
__metadata("design:type", profile_entity_1.Profile)
], User.prototype, "profile", void 0);
__decorate([
(0, typeorm_1.DeleteDateColumn)({ type: 'timestamp' }),
__metadata("design:type", Date)
], User.prototype, "deletedAt", void 0);
exports.User = User = __decorate([
(0, typeorm_1.Entity)()
], User);
//# sourceMappingURL=user.entity.js.map

@ -1 +0,0 @@
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/users/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,8EAA2E;AAC3E,+DAAsD;AACtD,qCAOiB;AAGV,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,sCAAiB;IAEzC,EAAE,CAAS;IAGX,IAAI,CAAS;IAGb,KAAK,CAAU;IAGf,QAAQ,CAAS;IAIjB,OAAO,CAAW;IAGlB,SAAS,CAAQ;;;;CAClB,CAAA;AAnBY,oBAAI;AAEf;IADC,IAAA,gCAAsB,GAAE;;gCACd;AAGX;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;kCACZ;AAGb;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mCAC1B;AAGf;IADC,IAAA,gBAAM,GAAE;;sCACQ;AAIjB;IAFC,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,wBAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACrE,IAAA,oBAAU,GAAE;8BACH,wBAAO;qCAAC;AAGlB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;8BAC5B,IAAI;uCAAC;eAlBN,IAAI;IADhB,IAAA,gBAAM,GAAE;GACI,IAAI,CAmBhB"}

@ -10,7 +10,7 @@ exports.UsersModule = void 0;
const common_1 = require("@nestjs/common"); const common_1 = require("@nestjs/common");
const users_service_1 = require("./users.service"); const users_service_1 = require("./users.service");
const typeorm_1 = require("@nestjs/typeorm"); const typeorm_1 = require("@nestjs/typeorm");
const user_entity_1 = require("./user.entity"); const user_entity_1 = require("./entities/user.entity");
const users_controller_1 = require("./users.controller"); const users_controller_1 = require("./users.controller");
let UsersModule = class UsersModule { let UsersModule = class UsersModule {
}; };

@ -1 +1 @@
{"version":3,"file":"users.module.js","sourceRoot":"","sources":["../../src/users/users.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,mDAA+C;AAC/C,6CAAgD;AAChD,+CAAqC;AACrC,yDAAqD;AAQ9C,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,kCAAW;sBAAX,WAAW;IANvB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,kBAAI,CAAC,CAAC,CAAC;QAC3C,SAAS,EAAE,CAAC,4BAAY,CAAC;QACzB,WAAW,EAAE,CAAC,kCAAe,CAAC;QAC9B,OAAO,EAAE,CAAC,4BAAY,CAAC;KACxB,CAAC;GACW,WAAW,CAAG"} {"version":3,"file":"users.module.js","sourceRoot":"","sources":["../../src/users/users.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,mDAA+C;AAC/C,6CAAgD;AAChD,wDAA8C;AAC9C,yDAAqD;AAQ9C,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,kCAAW;sBAAX,WAAW;IANvB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,kBAAI,CAAC,CAAC,CAAC;QAC3C,SAAS,EAAE,CAAC,4BAAY,CAAC;QACzB,WAAW,EAAE,CAAC,kCAAe,CAAC;QAC9B,OAAO,EAAE,CAAC,4BAAY,CAAC;KACxB,CAAC;GACW,WAAW,CAAG"}

@ -1,4 +1,4 @@
import { User } from './user.entity'; import { User } from './entities/user.entity';
import { Repository } from 'typeorm'; import { Repository } from 'typeorm';
import { CreateUserDto } from './dto/create-user.dto'; import { CreateUserDto } from './dto/create-user.dto';
import { ChangePasswordDto } from './dto/change-password.dto'; import { ChangePasswordDto } from './dto/change-password.dto';

@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.UsersService = void 0; exports.UsersService = void 0;
const common_1 = require("@nestjs/common"); const common_1 = require("@nestjs/common");
const typeorm_1 = require("@nestjs/typeorm"); const typeorm_1 = require("@nestjs/typeorm");
const user_entity_1 = require("./user.entity"); const user_entity_1 = require("./entities/user.entity");
const typeorm_2 = require("typeorm"); const typeorm_2 = require("typeorm");
const bcrypt = require("bcryptjs"); const bcrypt = require("bcryptjs");
let UsersService = class UsersService { let UsersService = class UsersService {

@ -1 +1 @@
{"version":3,"file":"users.service.js","sourceRoot":"","sources":["../../src/users/users.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAKwB;AACxB,6CAAmD;AACnD,+CAAqC;AACrC,qCAAqC;AAGrC,mCAAmC;AAI5B,IAAM,YAAY,GAAlB,MAAM,YAAY;IACqB;IAA5C,YAA4C,IAAsB;QAAtB,SAAI,GAAJ,IAAI,CAAkB;IAAG,CAAC;IAEtE,KAAK,CAAC,QAAQ,CAAC,EAAU;QACvB,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,IAAY;QAC3B,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAAa;QAC7B,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAkB;QAC7B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACjD,IAAI,QAAQ;YAAE,MAAM,IAAI,4BAAmB,CAAC,sBAA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EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE;gBACP,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG;gBACtB,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS;aACnC;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AApEY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;IAEE,WAAA,IAAA,0BAAgB,EAAC,kBAAI,CAAC,CAAA;qCAAe,oBAAU;GADjD,YAAY,CAoExB"}

@ -1,5 +1,5 @@
import { TimestampedEntity } from 'src/common/entities/timestamped.entity'; import { TimestampedEntity } from 'src/common/entities/timestamped.entity';
import { User } from 'src/users/user.entity'; import { User } from 'src/users/entities/user.entity';
import { Column, Entity, OneToOne, PrimaryGeneratedColumn } from 'typeorm'; import { Column, Entity, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
@Entity() @Entity()

@ -1,4 +1,4 @@
import { Body, Controller, HttpCode, Patch, Post, Request, UseGuards } from '@nestjs/common'; import { Body, Controller, HttpCode, Post, Request, UseGuards } from '@nestjs/common';
import { ProfilesService } from './profiles.service'; import { ProfilesService } from './profiles.service';
import { CreateProfileDto } from './dto/create-profile.dto'; import { CreateProfileDto } from './dto/create-profile.dto';
import { ProfileResponseDto } from './dto/profile-response.dto'; import { ProfileResponseDto } from './dto/profile-response.dto';

@ -1,9 +1,9 @@
import { Module } from '@nestjs/common'; import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm'; import { TypeOrmModule } from '@nestjs/typeorm';
import { Profile } from './profile.entity'; import { Profile } from './entities/profile.entity';
import { ProfilesController } from './profiles.controller'; import { ProfilesController } from './profiles.controller';
import { ProfilesService } from './profiles.service'; import { ProfilesService } from './profiles.service';
import { User } from 'src/users/user.entity'; import { User } from 'src/users/entities/user.entity';
@Module({ @Module({
imports: [TypeOrmModule.forFeature([Profile, User])], imports: [TypeOrmModule.forFeature([Profile, User])],

@ -1,10 +1,10 @@
import { Injectable, NotFoundException } from '@nestjs/common'; import { Injectable, NotFoundException } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm'; import { InjectRepository } from '@nestjs/typeorm';
import { Profile } from './profile.entity'; import { Profile } from './entities/profile.entity';
import { Repository } from 'typeorm'; import { Repository } from 'typeorm';
import { CreateProfileDto } from './dto/create-profile.dto'; import { CreateProfileDto } from './dto/create-profile.dto';
import { ProfileResponseDto } from './dto/profile-response.dto'; import { ProfileResponseDto } from './dto/profile-response.dto';
import { User } from 'src/users/user.entity'; import { User } from 'src/users/entities/user.entity';
@Injectable() @Injectable()
export class ProfilesService { export class ProfilesService {

@ -2,18 +2,18 @@ import { CreateUserDto } from 'src/users/dto/create-user.dto';
export const testUsers: CreateUserDto[] = [ export const testUsers: CreateUserDto[] = [
{ {
name: 'testuser1', name: 'alice',
email: 'testuser1@email.com', email: 'alice@email.com',
password: 'password123', password: 'password123',
}, },
{ {
name: 'testuser2', name: 'bob',
email: 'testuser2@email.com', email: 'bob@email.com',
password: 'password456', password: 'password456',
}, },
{ {
name: 'testuser3', name: 'john',
email: 'testuser3@email.com', email: 'john@email.com',
password: 'password789', password: 'password789',
}, },
]; ];

@ -1,5 +1,5 @@
import { TimestampedEntity } from 'src/common/entities/timestamped.entity'; import { TimestampedEntity } from 'src/common/entities/timestamped.entity';
import { Profile } from 'src/profiles/profile.entity'; import { Profile } from 'src/profiles/entities/profile.entity';
import { import {
Column, Column,
DeleteDateColumn, DeleteDateColumn,

@ -1,7 +1,7 @@
import { Module } from '@nestjs/common'; import { Module } from '@nestjs/common';
import { UsersService } from './users.service'; import { UsersService } from './users.service';
import { TypeOrmModule } from '@nestjs/typeorm'; import { TypeOrmModule } from '@nestjs/typeorm';
import { User } from './user.entity'; import { User } from './entities/user.entity';
import { UsersController } from './users.controller'; import { UsersController } from './users.controller';
@Module({ @Module({

@ -5,7 +5,7 @@ import {
UnauthorizedException, UnauthorizedException,
} from '@nestjs/common'; } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm'; import { InjectRepository } from '@nestjs/typeorm';
import { User } from './user.entity'; import { User } from './entities/user.entity';
import { Repository } from 'typeorm'; import { Repository } from 'typeorm';
import { CreateUserDto } from './dto/create-user.dto'; import { CreateUserDto } from './dto/create-user.dto';
import { ChangePasswordDto } from './dto/change-password.dto'; import { ChangePasswordDto } from './dto/change-password.dto';

Loading…
Cancel
Save