backend base

This commit is contained in:
2025-07-15 17:32:19 +09:00
parent 99e08bb02f
commit 6b009b7c22
68 changed files with 13865 additions and 0 deletions

5
backend/dist/users/dto/create-user.dto.d.ts vendored Executable file
View File

@@ -0,0 +1,5 @@
export declare class CreateUserDto {
readonly name: string;
readonly email?: string;
readonly password: string;
}

34
backend/dist/users/dto/create-user.dto.js vendored Executable file
View File

@@ -0,0 +1,34 @@
"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.CreateUserDto = void 0;
const class_validator_1 = require("class-validator");
class CreateUserDto {
name;
email;
password;
}
exports.CreateUserDto = CreateUserDto;
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateUserDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsEmail)(),
__metadata("design:type", String)
], CreateUserDto.prototype, "email", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.MinLength)(4),
__metadata("design:type", String)
], CreateUserDto.prototype, "password", void 0);
//# sourceMappingURL=create-user.dto.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"create-user.dto.js","sourceRoot":"","sources":["../../../src/users/dto/create-user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA2E;AAE3E,MAAa,aAAa;IAEb,IAAI,CAAS;IAIb,KAAK,CAAU;IAIf,QAAQ,CAAS;CAC7B;AAXD,sCAWC;AATY;IADR,IAAA,0BAAQ,GAAE;;2CACW;AAIb;IAFR,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;;4CACc;AAIf;IAFR,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,CAAC,CAAC;;+CACa"}

7
backend/dist/users/user.entity.d.ts vendored Executable file
View File

@@ -0,0 +1,7 @@
import { TimestampedEntity } from "src/common/entities/timestamped.entity";
export declare class User extends TimestampedEntity {
id: number;
name: string;
email?: string;
password: string;
}

41
backend/dist/users/user.entity.js vendored Executable file
View File

@@ -0,0 +1,41 @@
"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 timestamped_entity_1 = require("../common/entities/timestamped.entity");
const typeorm_1 = require("typeorm");
let User = class User extends timestamped_entity_1.TimestampedEntity {
id;
name;
email;
password;
};
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);
exports.User = User = __decorate([
(0, typeorm_1.Entity)()
], User);
//# sourceMappingURL=user.entity.js.map

1
backend/dist/users/user.entity.js.map vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/users/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8EAA2E;AAC3E,qCAAiE;AAG1D,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,sCAAiB;IAEvC,EAAE,CAAS;IAGX,IAAI,CAAS;IAGb,KAAK,CAAU;IAGf,QAAQ,CAAS;CACpB,CAAA;AAZY,oBAAI;AAEb;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;eAXR,IAAI;IADhB,IAAA,gBAAM,GAAE;GACI,IAAI,CAYhB"}

2
backend/dist/users/users.module.d.ts vendored Executable file
View File

@@ -0,0 +1,2 @@
export declare class UsersModule {
}

25
backend/dist/users/users.module.js vendored Executable file
View File

@@ -0,0 +1,25 @@
"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;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UsersModule = void 0;
const common_1 = require("@nestjs/common");
const users_service_1 = require("./users.service");
const typeorm_1 = require("@nestjs/typeorm");
const user_entity_1 = require("./user.entity");
let UsersModule = class UsersModule {
};
exports.UsersModule = UsersModule;
exports.UsersModule = UsersModule = __decorate([
(0, common_1.Module)({
imports: [typeorm_1.TypeOrmModule.forFeature([user_entity_1.User])],
providers: [users_service_1.UsersService],
controllers: [],
exports: [users_service_1.UsersService]
})
], UsersModule);
//# sourceMappingURL=users.module.js.map

1
backend/dist/users/users.module.js.map vendored Executable file
View File

@@ -0,0 +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;AAQ9B,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,EAAE;QACf,OAAO,EAAE,CAAC,4BAAY,CAAC;KACxB,CAAC;GACW,WAAW,CAAG"}

10
backend/dist/users/users.service.d.ts vendored Executable file
View File

@@ -0,0 +1,10 @@
import { User } from './user.entity';
import { Repository } from 'typeorm';
import { CreateUserDto } from './dto/create-user.dto';
export declare class UsersService {
private repo;
constructor(repo: Repository<User>);
findByName(name: string): Promise<User | null>;
findByEmail(email: string): Promise<User | null>;
create(dto: CreateUserDto): Promise<User>;
}

45
backend/dist/users/users.service.js vendored Executable file
View File

@@ -0,0 +1,45 @@
"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);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UsersService = void 0;
const common_1 = require("@nestjs/common");
const typeorm_1 = require("@nestjs/typeorm");
const user_entity_1 = require("./user.entity");
const typeorm_2 = require("typeorm");
let UsersService = class UsersService {
repo;
constructor(repo) {
this.repo = repo;
}
async findByName(name) {
return this.repo.findOne({ where: { name } });
}
async findByEmail(email) {
return this.repo.findOne({ where: { email } });
}
async create(dto) {
const existing = await this.findByName(dto.name);
if (existing)
throw new common_1.BadRequestException("Already Exist User");
const user = this.repo.create(dto);
return this.repo.save(user);
}
};
exports.UsersService = UsersService;
exports.UsersService = UsersService = __decorate([
(0, common_1.Injectable)(),
__param(0, (0, typeorm_1.InjectRepository)(user_entity_1.User)),
__metadata("design:paramtypes", [typeorm_2.Repository])
], UsersService);
//# sourceMappingURL=users.service.js.map

1
backend/dist/users/users.service.js.map vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"users.service.js","sourceRoot":"","sources":["../../src/users/users.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAiE;AACjE,6CAAmD;AACnD,+CAAqC;AACrC,qCAAqC;AAI9B,IAAM,YAAY,GAAlB,MAAM,YAAY;IACuB;IAA5C,YAA4C,IAAsB;QAAtB,SAAI,GAAJ,IAAI,CAAkB;IAAG,CAAC;IAEtE,KAAK,CAAC,UAAU,CAAC,IAAY;QACzB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAC,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAAa;QAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAC,CAAC,CAAC;IAClD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAkB;QAC3B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACjD,IAAI,QAAQ;YAAE,MAAM,IAAI,4BAAmB,CAAC,oBAAoB,CAAC,CAAC;QAElE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;CACJ,CAAA;AAlBY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;IAEI,WAAA,IAAA,0BAAgB,EAAC,kBAAI,CAAC,CAAA;qCAAe,oBAAU;GADnD,YAAY,CAkBxB"}