Skip to content

Commit

Permalink
fix: 유저 엔티티 수정 및 등록 (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
Coalery authored Dec 28, 2024
2 parents d0d0f1c + 1288399 commit 9487bd9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/app/domain/user/model/Profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ export class Profile {
@Length(1, 255)
readonly college: string;

@Property({ type: 'bigint', length: 20, name: 'grade' })
@Property({ type: 'int', name: 'grade' })
@IsInt()
readonly grade: number;

@Property({ type: 'bigint', length: 20, name: 'number', nullable: true })
@Property({ type: 'int', name: 'number', nullable: true })
@IsInt()
@IsOptional()
readonly number: number | null;
Expand Down
23 changes: 7 additions & 16 deletions src/app/domain/user/model/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export type UserConstructorParams = {
// TODO: AggregateRoot 제거
@Entity({ tableName: 'khlug_members' })
export class User extends AggregateRoot {
@PrimaryKey({ type: 'bigint', length: 20, name: 'id' })
@PrimaryKey({ type: 'int', name: 'id' })
@IsInt()
@IsNotEmpty()
private _id: string;
Expand All @@ -68,11 +68,11 @@ export class User extends AggregateRoot {
@Length(2, 2)
private _admission: string;

@Property({ type: 'bigint', length: 20, name: 'state' })
@Property({ type: 'int', name: 'state' })
@IsInt()
private _state: UserState;

@Property({ type: 'bigint', length: 20, name: 'expoint' })
@Property({ type: 'int', name: 'expoint' })
@IsInt()
private _point: number;

Expand All @@ -99,10 +99,7 @@ export class User extends AggregateRoot {
@IsOptional()
private _rememberToken: string | null;

@Property({
type: 'timestamp',
name: 'khuisauth_at',
})
@Property({ type: 'timestamp', name: 'khuisauth_at' })
@IsDate()
private _khuisAuthAt: Date;

Expand Down Expand Up @@ -137,21 +134,15 @@ export class User extends AggregateRoot {
@IsDate()
private _createdAt: Date;

@Property({
type: 'timestamp',
name: 'last_login',
})
@Property({ type: 'timestamp', name: 'last_login' })
@IsDate()
private _lastLoginAt: Date;

@Property({
type: 'timestamp',
name: 'last_enter',
})
@Property({ type: 'timestamp', name: 'last_enter' })
@IsDate()
private _lastEnterAt: Date;

@Embedded(() => Profile)
@Embedded(() => Profile, { prefix: '' })
private _profile: Profile;

constructor(params: UserConstructorParams) {
Expand Down
3 changes: 2 additions & 1 deletion src/core/persistence/Entities.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Cache } from '@khlug/app/domain/cache/model/Cache';
import { User } from '@khlug/app/domain/user/model/User';

export const EntityModels = [Cache];
export const EntityModels = [Cache, User];

0 comments on commit 9487bd9

Please sign in to comment.