Skip to content

Commit

Permalink
Merge branch 'develop' into feat/#131
Browse files Browse the repository at this point in the history
  • Loading branch information
Arios67 committed Apr 4, 2022
2 parents 4c72f28 + 54443ac commit 884c115
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ars/src/apis/art/art.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export class ArtService {
.where('user.id =:id', { id: userId })
.withDeleted()
.getCount();

return art;
}

Expand Down
2 changes: 2 additions & 0 deletions ars/src/apis/board/board.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { BoardImage } from '../boardImage/entities/boardImage.entity';
import { Comment } from '../comment/entities/comment.entity';
import { FileService } from '../file/file.service';
import { LikeBoardService } from '../likeBoard/likeBoard.service';
import { User } from '../user/entities/user.entity';
import { BoardResolver } from './board.resolver';
import { BoardService } from './board.service';
import { Board } from './entities/board.entity';
Expand All @@ -18,6 +19,7 @@ import { LikeBoard } from './entities/likeBoard.entity';
BoardImage,
Comment,
LikeBoard,
User,
]),
],
providers: [
Expand Down
6 changes: 3 additions & 3 deletions ars/src/apis/board/board.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ export class BoardResolver {

// 게시물 모두 조회
@Query(() => [Board])
async fetchBoards() {
return await this.boardService.findAll();
async fetchBoards(@Args('page', { nullable: true }) page: number) {
return await this.boardService.findAll(page);
}

// 내가 쓴 게시물 조회
@UseGuards(GqlAuthAccessGuard)
@Query(() => [Board])
async fetchBoardsOfMine(
@Args('page') page: number,
@Args('page', { nullable: true }) page: number,
@CurrentUser() currentUser: ICurrentUser,
) {
return await this.boardService.findMine({ currentUser }, page);
Expand Down
6 changes: 4 additions & 2 deletions ars/src/apis/board/board.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,19 @@ export class BoardService {
}

// 게시물 모두 조회
async findAll() {
async findAll(page) {
return await this.boardRepository.find({
relations: ['art'],
take: 10,
skip: 10 * (page - 1),
});
}

// 내가 쓴 게시물 조회
async findMine({ currentUser }, page) {
return await this.boardRepository.find({
skip: 10,
take: 10,
skip: 10 * (page - 1),
where: { user: currentUser },
});
}
Expand Down
4 changes: 3 additions & 1 deletion ars/src/apis/payment/payment.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export class PaymentResolver {
constructor(
private readonly paymentService: PaymentService,
private readonly userService: UserService,
private readonly elasticsearchService: ElasticsearchService,

private readonly elasticsearchService: ElasticsearchService,

Expand Down Expand Up @@ -64,11 +65,12 @@ export class PaymentResolver {
},
},
});
console.log(result);

return artId;
}

return 'ok';
}
// 레디스에 입찰 정보(작품, 현재 입찰가, 현재 상위 입찰자)
@UseGuards(GqlAuthAccessGuard)
@Mutation(() => [String])
Expand Down
4 changes: 4 additions & 0 deletions ars/src/apis/payment/payment.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export class PaymentService {
private readonly connection: Connection,
) {}

async find() {
await this.artRepository.find();
}

// 마감된 작품 체크
async checkTimeout() {
const utc = new Date();
Expand Down
4 changes: 2 additions & 2 deletions ars/src/common/graphql/schema.gql
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ type Query {
fetchLikeArt(page: Float): [Art!]!
fetchBoard(boardId: String!): Board!
fetchBoardImgaes(boardId: String!): [BoardImage!]!
fetchBoards: [Board!]!
fetchBoardsOfMine(page: Float!): [Board!]!
fetchBoards(page: Float): [Board!]!
fetchBoardsOfMine(page: Float): [Board!]!
fetchBoardsOfMineCount: Float!
countLikeBoard(boardId: String!): Int!
fetchLikeBoard: [Board!]!
Expand Down
2 changes: 1 addition & 1 deletion frontend/payment.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
{
headers: {
Authorization:
"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImJiYkBhLmEiLCJzdWIiOiI4MzdjZTkyOS1lYjE5LTRiYTgtOTgzNi02ZTk3NTQ2NzkzNGEiLCJpYXQiOjE2NDg2MzU0OTcsImV4cCI6MTY0ODYzOTA5N30.0biQLLvJrSYyntwAsBzQX6abz-x7yXsFDSr44uA7h2M",
"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImVrdG1mQGEuYSIsInN1YiI6ImM0ZTViYWY5LTI0NzctNDIxZC1iMDRhLWZmNzAwNjQwYjc2MCIsImlhdCI6MTY0OTA0NjMwMCwiZXhwIjoxNjQ5MDQ5OTAwfQ.i__qC-xy43JECudJ0YGuCoHWYyTb7nmRYJHU__4G9Ns",
},
}
);
Expand Down

0 comments on commit 884c115

Please sign in to comment.