-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: update cron task names and add key-based filtering in getCronLogs - getCronLogs 메소드에 key 파라미터를 추가하여 taskName을 기준으로 필터링 가능하도록 수정 - Cron 작업의 로그 태스크 이름을 간결하게 변경 * refactor: update cron task names and add key-based filtering in getCronLogs - getCronLogs 메소드에 key 파라미터를 추가하여 taskName을 기준으로 필터링 가능하도록 수정 - Cron 작업의 로그 태스크 이름을 간결하게 변경 * feat: store database implementation * feat: theme crud * feat: item crud * feat: view and purchase themes * feat: view and purchase items * feat: activate themes and items * feat: Add layout information to user basic information and modify caching * doc: swagger update * doc: swagger update * doc: swagger update * fix: problem with published posts not being viewed properly due to paging issues * test: Added console log to resolve issues that occur when using rt * test: Added console log to resolve issues that occur when using rt * feat: middleware is added to add request request identifier for testing. * feat: middleware is added to add request request identifier for testing. * fix: replace app.enableCors with express cors middleware for custom headers * fix: replace app.enableCors with express cors middleware for custom headers * fix: add X-Access-Token to Access-Control-Expose-Headers * feat: Add basic theme creation logic * refactor: guard refactoring and improving duplicate handling logic * fix: remove tag limit * refactor: item and theme purchase logic by applying Redis distributed locks and transactions * refactor: Add retry logic to method * refactor: Added name duplication check logic when saving and updating stories * fix: 키워드 타입 검사 추가 * fix: 키워드 타입 검사 추가 * chore: Update dependency package versions to latest * chore: 의존성 패키지 업데이트 * chore: 의존성 패키지 업데이트 * chore: 의존성 패키지 업데이트 * chore: eslint updated * fix: redis connection settings in redlock * fix: 에세이 조회 분산락에 지수 백오프 적용 * doc: edit readme * chore: edit eslint config * fix: 땅에 묻기 기능 추가로 인한 기존 로직 변경 * fix: 땅에묻기 필수 좌표 분기 추가 * refactor: geometry 타입 변경 밑작업 * fix: 에세이 작성시 위도,경도 데이터 geometry로 변환 * feat: 사용자 위치 기반 주변 에세이 알림 추가 * feat: 사용자 위치 기반 주변 에세이 알림 추가 * fix: 장치 설정 검색을 일괄 처리하여 성능 최적화 * fix: 관리자 검색 API에 대한 페이지네이션 추가 * feat: 유저 및 에세이 유사도 검색 추가
- Loading branch information
1 parent
77ab555
commit 805af60
Showing
12 changed files
with
241 additions
and
166 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class AddTrigramUser1730047331380 implements MigrationInterface { | ||
name = 'AddTrigramUser1730047331380'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`CREATE EXTENSION IF NOT EXISTS pg_trgm`); | ||
await queryRunner.query(`CREATE EXTENSION IF NOT EXISTS unaccent`); | ||
|
||
// Add unaccented_email column (no generated expression) | ||
await queryRunner.query(`ALTER TABLE "user" ADD COLUMN "unaccented_email" TEXT`); | ||
|
||
// Populate unaccented_email initially | ||
await queryRunner.query(`UPDATE "user" SET "unaccented_email" = unaccent(email)`); | ||
|
||
// Create trigger function for unaccented_email updates | ||
await queryRunner.query(` | ||
CREATE OR REPLACE FUNCTION update_unaccented_email() | ||
RETURNS TRIGGER AS $$ | ||
BEGIN | ||
NEW.unaccented_email = unaccent(NEW.email); | ||
RETURN NEW; | ||
END; | ||
$$ LANGUAGE plpgsql; | ||
`); | ||
|
||
// Apply trigger to update unaccented_email on email change | ||
await queryRunner.query(` | ||
CREATE TRIGGER trigger_update_unaccented_email | ||
BEFORE INSERT OR UPDATE OF email ON "user" | ||
FOR EACH ROW EXECUTE FUNCTION update_unaccented_email(); | ||
`); | ||
|
||
// Create index for trigram search on unaccented_email | ||
await queryRunner.query( | ||
`CREATE INDEX "IDX_USER_UNACCENTED_EMAIL" ON "user" USING gin (unaccented_email gin_trgm_ops)`, | ||
); | ||
|
||
// Optional: Create index for text search if required | ||
await queryRunner.query( | ||
`CREATE INDEX "IDX_USER_SEARCH_VECTOR" ON "user" USING gin (to_tsvector('simple', coalesce(email, '')))`, | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`DROP INDEX "IDX_USER_SEARCH_VECTOR"`); | ||
await queryRunner.query(`DROP INDEX "IDX_USER_UNACCENTED_EMAIL"`); | ||
await queryRunner.query(`DROP TRIGGER trigger_update_unaccented_email ON "user"`); | ||
await queryRunner.query(`DROP FUNCTION update_unaccented_email`); | ||
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "unaccented_email"`); | ||
} | ||
} |
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,30 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class AddVectorUser1730048056148 implements MigrationInterface { | ||
name = 'AddVectorUser1730048056148'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`CREATE EXTENSION IF NOT EXISTS unaccent`); | ||
|
||
// Add search_vector column for full-text search on email | ||
await queryRunner.query( | ||
`ALTER TABLE "user" ADD COLUMN IF NOT EXISTS "search_vector" TSVECTOR GENERATED ALWAYS AS (to_tsvector('simple', coalesce(email, ''))) STORED`, | ||
); | ||
|
||
// Check and create index if not exists | ||
await queryRunner.query(` | ||
DO $$ | ||
BEGIN | ||
IF NOT EXISTS (SELECT 1 FROM pg_indexes WHERE indexname = 'IDX_USER_SEARCH_VECTOR') THEN | ||
CREATE INDEX "IDX_USER_SEARCH_VECTOR" ON "user" USING gin (search_vector); | ||
END IF; | ||
END | ||
$$; | ||
`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`DROP INDEX "IDX_USER_SEARCH_VECTOR"`); | ||
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "search_vector"`); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,7 +1,25 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { AdminResDto } from './adminRes.dto'; | ||
import { Expose } from 'class-transformer'; | ||
import { IsNumber } from 'class-validator'; | ||
|
||
export class AdminsResDto { | ||
@ApiProperty({ type: [AdminResDto] }) | ||
@Expose() | ||
admins: AdminResDto[]; | ||
|
||
@ApiProperty() | ||
@IsNumber() | ||
@Expose() | ||
page: number; | ||
|
||
@ApiProperty() | ||
@IsNumber() | ||
@Expose() | ||
total: number; | ||
|
||
@ApiProperty() | ||
@IsNumber() | ||
@Expose() | ||
totalPage: number; | ||
} |
Oops, something went wrong.