Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Sep 19, 2024
1 parent 4283c22 commit 07c667f
Show file tree
Hide file tree
Showing 14 changed files with 90 additions and 14 deletions.
5 changes: 4 additions & 1 deletion backend/src/entities/BookInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ export class BookInfo {
@OneToMany(() => SuperTag, (superTags) => superTags.userId)
superTags?: SuperTag[];

@OneToOne(() => BookInfoSearchKeywords, (bookInfoSearchKeyword) => bookInfoSearchKeyword.bookInfo)
@OneToOne(
() => BookInfoSearchKeywords,
(bookInfoSearchKeyword) => bookInfoSearchKeyword.bookInfo,
)
bookInfoSearchKeyword?: BookInfoSearchKeywords;
}
9 changes: 8 additions & 1 deletion backend/src/entities/BookInfoSearchKeywords.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { Column, Entity, Index, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
import {
Column,
Entity,
Index,
JoinColumn,
OneToOne,
PrimaryGeneratedColumn,
} from 'typeorm';
import { BookInfo } from './BookInfo';

@Index('FK_bookInfoId', ['bookInfoId'], {})
Expand Down
8 changes: 7 additions & 1 deletion backend/src/entities/Category.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { Column, Entity, Index, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
import {
Column,
Entity,
Index,
OneToMany,
PrimaryGeneratedColumn,
} from 'typeorm';
import { BookInfo } from './BookInfo';

@Index('id', ['id'], { unique: true })
Expand Down
9 changes: 8 additions & 1 deletion backend/src/entities/Lending.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { Column, Entity, Index, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import {
Column,
Entity,
Index,
JoinColumn,
ManyToOne,
PrimaryGeneratedColumn,
} from 'typeorm';
import { Book } from './Book';
import { User } from './User';

Expand Down
9 changes: 8 additions & 1 deletion backend/src/entities/Likes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { Column, Entity, Index, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import {
Column,
Entity,
Index,
JoinColumn,
ManyToOne,
PrimaryGeneratedColumn,
} from 'typeorm';
import { User } from './User';
import { BookInfo } from './BookInfo';

Expand Down
9 changes: 8 additions & 1 deletion backend/src/entities/Reservation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { Column, Entity, Index, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import {
Column,
Entity,
Index,
JoinColumn,
ManyToOne,
PrimaryGeneratedColumn,
} from 'typeorm';
import { User } from './User';
import { BookInfo } from './BookInfo';
import { Book } from './Book';
Expand Down
9 changes: 8 additions & 1 deletion backend/src/entities/Reviews.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { Column, Entity, Index, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import {
Column,
Entity,
Index,
JoinColumn,
ManyToOne,
PrimaryGeneratedColumn,
} from 'typeorm';
import { User } from './User';
import { BookInfo } from './BookInfo';

Expand Down
9 changes: 8 additions & 1 deletion backend/src/entities/SearchLogs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { Column, Entity, Index, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import {
Column,
Entity,
Index,
JoinColumn,
ManyToOne,
PrimaryGeneratedColumn,
} from 'typeorm';
import { SearchKeywords } from './SearchKeywords';

@Index('FK_searchKeywordId', ['searchKeywordId'], {})
Expand Down
9 changes: 8 additions & 1 deletion backend/src/entities/SubTag.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { Column, Entity, Index, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import {
Column,
Entity,
Index,
JoinColumn,
ManyToOne,
PrimaryGeneratedColumn,
} from 'typeorm';
import { User } from './User';
import { SuperTag } from './SuperTag';

Expand Down
8 changes: 7 additions & 1 deletion backend/src/entities/User.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { Column, Entity, Index, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
import {
Column,
Entity,
Index,
OneToMany,
PrimaryGeneratedColumn,
} from 'typeorm';
import { Book } from './Book';
import { Lending } from './Lending';
import { Likes } from './Likes';
Expand Down
5 changes: 4 additions & 1 deletion backend/src/entities/VHistories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ import { DataSource, ViewColumn, ViewEntity } from 'typeorm';
.addSelect('DATE_FORMAT(l.createdAt, "%Y-%m-%d")', 'createdAt')
.addSelect('DATE_FORMAT(l.returnedAt, "%Y-%m-%d")', 'returnedAt')
.addSelect('DATE_FORMAT(l.updatedAt, "%Y-%m-%d")', 'updatedAt')
.addSelect("DATE_FORMAT(DATE_ADD(l.createdAt, interval 14 day), '%Y-%m-%d')", 'dueDate')
.addSelect(
"DATE_FORMAT(DATE_ADD(l.createdAt, interval 14 day), '%Y-%m-%d')",
'dueDate',
)
.addSelect(
'(SELECT nickname FROM user WHERE user.id = lendingLibrarianId)',
'lendingLibrarianNickName',
Expand Down
5 changes: 4 additions & 1 deletion backend/src/entities/VLending.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import { DataSource, ViewColumn, ViewEntity } from 'typeorm';
.addSelect('bi.image', 'image')
.addSelect("date_format(l.createdAt, '%Y-%m-%d')", 'createdAt')
.addSelect("date_format(l.returnedAt, '%Y-%m-%d')", 'returnedAt')
.addSelect("date_format(DATE_ADD(l.createdAt, INTERVAL 14 DAY), '%Y-%m-%d')", 'dueDate')
.addSelect(
"date_format(DATE_ADD(l.createdAt, INTERVAL 14 DAY), '%Y-%m-%d')",
'dueDate',
)
.from('lending', 'l')
.innerJoin('user', 'u', 'l.userId = u.id')
.leftJoin('book', 'b', 'l.bookId = b.id')
Expand Down
5 changes: 4 additions & 1 deletion backend/src/entities/VTagsSubDefault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ import { User } from './User';
.addSelect('sp.content', 'superContent')
.addSelect('sb.isPublic', 'isPublic')
.addSelect('sb.isDeleted', 'isDeleted')
.addSelect("CASE WHEN sb.isPublic = 1 THEN 'public' ELSE 1 'private' END", 'visibility')
.addSelect(
"CASE WHEN sb.isPublic = 1 THEN 'public' ELSE 1 'private' END",
'visibility',
)
.from(SuperTag, 'sp')
.innerJoin(SubTag, 'sb', 'sb.superTagId = sp.id')
.innerJoin(BookInfo, 'bi', 'bi.id = sp.bookInfoId')
Expand Down
5 changes: 4 additions & 1 deletion backend/src/entities/VUserLending.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import { DataSource, ViewColumn, ViewEntity } from 'typeorm';
.addSelect('l.lendingCondition', 'lendingCondition')
.addSelect('bi.id', 'bookInfoId')
.addSelect('bi.title', 'title')
.addSelect("date_format(DATE_ADD(l.createdAt, INTERVAL 14 DAY), '%Y-%m-%d')", 'duedate')
.addSelect(
"date_format(DATE_ADD(l.createdAt, INTERVAL 14 DAY), '%Y-%m-%d')",
'duedate',
)
.addSelect('bi.image', 'image')
.addSelect(
'CASE WHEN DATEDIFF(now(), DATE_ADD(l.createdAt, INTERVAL 14 DAY)) < 0 THEN 0 ELSE DATEDIFF(now(), DATE_ADD(l.createdAt, INTERVAL 14 DAY)) END',
Expand Down

0 comments on commit 07c667f

Please sign in to comment.