Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 유저 엔티티 수정 및 등록 #83

Merged
merged 1 commit into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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];
Loading