geek-custom-api-core 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/api/app/common-product-info/common-product-info.admin.controller.d.ts +32 -0
- package/dist/api/app/common-product-info/common-product-info.admin.controller.js +153 -0
- package/dist/api/app/common-product-info/common-product-info.admin.controller.js.map +1 -0
- package/dist/api/app/common-product-info/common-product-info.controller.d.ts +8 -0
- package/dist/api/app/common-product-info/common-product-info.controller.js +47 -0
- package/dist/api/app/common-product-info/common-product-info.controller.js.map +1 -0
- package/dist/api/app/common-product-info/common-product-info.module.d.ts +2 -0
- package/dist/api/app/common-product-info/common-product-info.module.js +23 -0
- package/dist/api/app/common-product-info/common-product-info.module.js.map +1 -0
- package/dist/api/app/common-product-info/common-product-info.service.d.ts +32 -0
- package/dist/api/app/common-product-info/common-product-info.service.js +169 -0
- package/dist/api/app/common-product-info/common-product-info.service.js.map +1 -0
- package/dist/api/app/common-product-info/dto/common-product-info.admin.create.dto.d.ts +21 -0
- package/dist/api/app/common-product-info/dto/common-product-info.admin.create.dto.js +114 -0
- package/dist/api/app/common-product-info/dto/common-product-info.admin.create.dto.js.map +1 -0
- package/dist/api/app/common-product-info/dto/common-product-info.admin.search.dto.d.ts +9 -0
- package/dist/api/app/common-product-info/dto/common-product-info.admin.search.dto.js +50 -0
- package/dist/api/app/common-product-info/dto/common-product-info.admin.search.dto.js.map +1 -0
- package/dist/api/app/common-product-info/dto/common-product-info.admin.update.dto.d.ts +6 -0
- package/dist/api/app/common-product-info/dto/common-product-info.admin.update.dto.js +24 -0
- package/dist/api/app/common-product-info/dto/common-product-info.admin.update.dto.js.map +1 -0
- package/dist/api/app/common-product-info/dto/common-product-info.search.dto.d.ts +5 -0
- package/dist/api/app/common-product-info/dto/common-product-info.search.dto.js +35 -0
- package/dist/api/app/common-product-info/dto/common-product-info.search.dto.js.map +1 -0
- package/dist/api/app/common-product-info/entity/common-product-info.detail.entity.d.ts +9 -0
- package/dist/api/app/common-product-info/entity/common-product-info.detail.entity.js +51 -0
- package/dist/api/app/common-product-info/entity/common-product-info.detail.entity.js.map +1 -0
- package/dist/api/app/common-product-info/entity/common-product-info.entity.d.ts +16 -0
- package/dist/api/app/common-product-info/entity/common-product-info.entity.js +93 -0
- package/dist/api/app/common-product-info/entity/common-product-info.entity.js.map +1 -0
- package/dist/api/app/search-ranking/entity/search-ranking.entity.d.ts +6 -0
- package/dist/api/app/search-ranking/entity/search-ranking.entity.js +46 -0
- package/dist/api/app/search-ranking/entity/search-ranking.entity.js.map +1 -0
- package/dist/api/app/search-ranking/search-ranking.controller.d.ts +10 -0
- package/dist/api/app/search-ranking/search-ranking.controller.js +126 -0
- package/dist/api/app/search-ranking/search-ranking.controller.js.map +1 -0
- package/dist/api/app/search-ranking/search-ranking.module.d.ts +2 -0
- package/dist/api/app/search-ranking/search-ranking.module.js +22 -0
- package/dist/api/app/search-ranking/search-ranking.module.js.map +1 -0
- package/dist/api/app/search-ranking/search-ranking.service.d.ts +14 -0
- package/dist/api/app/search-ranking/search-ranking.service.js +130 -0
- package/dist/api/app/search-ranking/search-ranking.service.js.map +1 -0
- package/dist/api/app/survey/entity/survey-question-template.entity.d.ts +3 -1
- package/dist/api/app/survey/entity/survey-question-template.entity.js +7 -1
- package/dist/api/app/survey/entity/survey-question-template.entity.js.map +1 -1
- package/dist/api/app/survey/entity/survey-question.entity.d.ts +2 -3
- package/dist/api/app/survey/entity/survey-question.entity.js +6 -0
- package/dist/api/app/survey/entity/survey-question.entity.js.map +1 -1
- package/dist/api/app/survey/survey.controller.d.ts +2 -16
- package/dist/api/app/survey/survey.controller.js +13 -8
- package/dist/api/app/survey/survey.controller.js.map +1 -1
- package/dist/api/app/survey/survey.service.d.ts +2 -14
- package/dist/api/app/survey/survey.service.js +5 -6
- package/dist/api/app/survey/survey.service.js.map +1 -1
- package/dist/api/common/exception/dto/exception.insert.dto.d.ts +1 -0
- package/dist/api/common/exception/dto/exception.insert.dto.js +6 -0
- package/dist/api/common/exception/dto/exception.insert.dto.js.map +1 -1
- package/dist/api/common/exception/entity/exception.entity.d.ts +1 -0
- package/dist/api/common/exception/entity/exception.entity.js +7 -0
- package/dist/api/common/exception/entity/exception.entity.js.map +1 -1
- package/dist/common/enum/enum.d.ts +6 -0
- package/dist/common/enum/enum.js +8 -1
- package/dist/common/enum/enum.js.map +1 -1
- package/dist/common/filter/GlobalExceptionFilter.js +6 -3
- package/dist/common/filter/GlobalExceptionFilter.js.map +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -1
- package/sql/0.0.10.sql +43 -0
package/README.md
CHANGED
|
@@ -34,6 +34,16 @@ $ npm install
|
|
|
34
34
|
|
|
35
35
|
## Version up history
|
|
36
36
|
|
|
37
|
+
Ver. 0.0.10
|
|
38
|
+
|
|
39
|
+
- [FEAT] 상품 공통 정보
|
|
40
|
+
- [FEAT] 실시간 검색 순위
|
|
41
|
+
- [FIX] 에러 로그, IP 추가
|
|
42
|
+
|
|
43
|
+
Ver. 0.0.9
|
|
44
|
+
|
|
45
|
+
- Fix Survey template bug fix
|
|
46
|
+
|
|
37
47
|
Ver. 0.0.8
|
|
38
48
|
|
|
39
49
|
- [HOTFIX] Shop Middleware set partner sno
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CommonProductInfoService } from './common-product-info.service';
|
|
2
|
+
import { CommonProductInfoAdminCreateDto } from './dto/common-product-info.admin.create.dto';
|
|
3
|
+
import { CommonProductInfo } from './entity/common-product-info.entity';
|
|
4
|
+
import { CommonProductInfoAdminSearchDto } from './dto/common-product-info.admin.search.dto';
|
|
5
|
+
import { CommonProductInfoAdminUpdateDto } from './dto/common-product-info.admin.update.dto';
|
|
6
|
+
import { ICustomAdminRequest } from 'src/common/interface/ICustomAdminRequest';
|
|
7
|
+
export declare class CommonProductInfoAdminController {
|
|
8
|
+
private readonly commonProductInfoService;
|
|
9
|
+
constructor(commonProductInfoService: CommonProductInfoService);
|
|
10
|
+
create(req: ICustomAdminRequest, dto: CommonProductInfoAdminCreateDto): Promise<{
|
|
11
|
+
message: string;
|
|
12
|
+
statusCode: number;
|
|
13
|
+
}>;
|
|
14
|
+
getSearchList(req: ICustomAdminRequest, dto: CommonProductInfoAdminSearchDto): Promise<{
|
|
15
|
+
statusCode: string;
|
|
16
|
+
data: any[];
|
|
17
|
+
count: any;
|
|
18
|
+
currentPage: any;
|
|
19
|
+
nextPage: any;
|
|
20
|
+
prevPage: number;
|
|
21
|
+
lastPage: number;
|
|
22
|
+
}>;
|
|
23
|
+
findOne(sno: number): Promise<CommonProductInfo>;
|
|
24
|
+
update(dto: CommonProductInfoAdminUpdateDto): Promise<{
|
|
25
|
+
status: import("@nestjs/common").HttpStatus;
|
|
26
|
+
message: string;
|
|
27
|
+
}>;
|
|
28
|
+
remove(sno: number): Promise<{
|
|
29
|
+
status: import("@nestjs/common").HttpStatus;
|
|
30
|
+
message: string;
|
|
31
|
+
}>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.CommonProductInfoAdminController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const common_product_info_service_1 = require("./common-product-info.service");
|
|
18
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
19
|
+
const common_product_info_admin_create_dto_1 = require("./dto/common-product-info.admin.create.dto");
|
|
20
|
+
const common_product_info_entity_1 = require("./entity/common-product-info.entity");
|
|
21
|
+
const common_product_info_admin_search_dto_1 = require("./dto/common-product-info.admin.search.dto");
|
|
22
|
+
const common_product_info_admin_update_dto_1 = require("./dto/common-product-info.admin.update.dto");
|
|
23
|
+
const hasRole_decorator_1 = require("../../../common/decorators/hasRole.decorator");
|
|
24
|
+
const enum_1 = require("../../../common/enum/enum");
|
|
25
|
+
const accessToken_guard_1 = require("../../../common/guards/accessToken.guard");
|
|
26
|
+
const roles_guard_1 = require("../../../common/guards/roles.guard");
|
|
27
|
+
let CommonProductInfoAdminController = class CommonProductInfoAdminController {
|
|
28
|
+
constructor(commonProductInfoService) {
|
|
29
|
+
this.commonProductInfoService = commonProductInfoService;
|
|
30
|
+
}
|
|
31
|
+
async create(req, dto) {
|
|
32
|
+
return await this.commonProductInfoService.create(req.partnerSno, dto);
|
|
33
|
+
}
|
|
34
|
+
async getSearchList(req, dto) {
|
|
35
|
+
const partnerSno = req.partnerSno;
|
|
36
|
+
return await this.commonProductInfoService.getProductInfoList(partnerSno, dto);
|
|
37
|
+
}
|
|
38
|
+
async findOne(sno) {
|
|
39
|
+
const result = await this.commonProductInfoService.findOne(sno);
|
|
40
|
+
return result[0];
|
|
41
|
+
}
|
|
42
|
+
update(dto) {
|
|
43
|
+
return this.commonProductInfoService.update(dto);
|
|
44
|
+
}
|
|
45
|
+
remove(sno) {
|
|
46
|
+
return this.commonProductInfoService.remove(sno);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
exports.CommonProductInfoAdminController = CommonProductInfoAdminController;
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, common_1.Post)('/app/admin/common-product-info'),
|
|
52
|
+
(0, hasRole_decorator_1.HasRoles)(enum_1.MANAGER_TYPE.PARTNER),
|
|
53
|
+
(0, common_1.UseGuards)(accessToken_guard_1.AccessTokenGuard, roles_guard_1.RolesGuard),
|
|
54
|
+
(0, swagger_1.ApiHeader)({
|
|
55
|
+
name: 'access token',
|
|
56
|
+
required: true,
|
|
57
|
+
description: '관리자 access token',
|
|
58
|
+
}),
|
|
59
|
+
(0, swagger_1.ApiBody)({ type: common_product_info_admin_create_dto_1.CommonProductInfoAdminCreateDto }),
|
|
60
|
+
(0, swagger_1.ApiOperation)({
|
|
61
|
+
summary: '상품 공통정보 저장',
|
|
62
|
+
description: '상품 공통정보 저장 API 입니다.',
|
|
63
|
+
}),
|
|
64
|
+
(0, swagger_1.ApiCreatedResponse)({ description: '등록성공', type: common_product_info_entity_1.CommonProductInfo }),
|
|
65
|
+
__param(0, (0, common_1.Req)()),
|
|
66
|
+
__param(1, (0, common_1.Body)()),
|
|
67
|
+
__metadata("design:type", Function),
|
|
68
|
+
__metadata("design:paramtypes", [Object, common_product_info_admin_create_dto_1.CommonProductInfoAdminCreateDto]),
|
|
69
|
+
__metadata("design:returntype", Promise)
|
|
70
|
+
], CommonProductInfoAdminController.prototype, "create", null);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, common_1.Get)('/app/admin/common-product-info'),
|
|
73
|
+
(0, hasRole_decorator_1.HasRoles)(enum_1.MANAGER_TYPE.PARTNER),
|
|
74
|
+
(0, common_1.UseGuards)(accessToken_guard_1.AccessTokenGuard, roles_guard_1.RolesGuard),
|
|
75
|
+
(0, swagger_1.ApiHeader)({
|
|
76
|
+
name: 'access token',
|
|
77
|
+
required: true,
|
|
78
|
+
description: '관리자 access token',
|
|
79
|
+
}),
|
|
80
|
+
(0, swagger_1.ApiQuery)({ type: common_product_info_admin_search_dto_1.CommonProductInfoAdminSearchDto }),
|
|
81
|
+
(0, swagger_1.ApiOperation)({
|
|
82
|
+
summary: '상품 공통정보 검색',
|
|
83
|
+
description: '상품 공통정보 검색 API 입니다.',
|
|
84
|
+
}),
|
|
85
|
+
(0, swagger_1.ApiResponse)({ status: 200, type: [common_product_info_entity_1.CommonProductInfo] }),
|
|
86
|
+
__param(0, (0, common_1.Req)()),
|
|
87
|
+
__param(1, (0, common_1.Query)()),
|
|
88
|
+
__metadata("design:type", Function),
|
|
89
|
+
__metadata("design:paramtypes", [Object, common_product_info_admin_search_dto_1.CommonProductInfoAdminSearchDto]),
|
|
90
|
+
__metadata("design:returntype", Promise)
|
|
91
|
+
], CommonProductInfoAdminController.prototype, "getSearchList", null);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, common_1.Get)('/app/admin/common-product-info/:sno'),
|
|
94
|
+
(0, hasRole_decorator_1.HasRoles)(enum_1.MANAGER_TYPE.PARTNER),
|
|
95
|
+
(0, common_1.UseGuards)(accessToken_guard_1.AccessTokenGuard, roles_guard_1.RolesGuard),
|
|
96
|
+
(0, swagger_1.ApiHeader)({
|
|
97
|
+
name: 'access token',
|
|
98
|
+
required: true,
|
|
99
|
+
description: '관리자 access token',
|
|
100
|
+
}),
|
|
101
|
+
(0, swagger_1.ApiOperation)({
|
|
102
|
+
summary: '상품 공통정보 상세',
|
|
103
|
+
description: '상품 공통정보 상세 API 입니다.',
|
|
104
|
+
}),
|
|
105
|
+
(0, swagger_1.ApiResponse)({ status: 200, type: common_product_info_entity_1.CommonProductInfo }),
|
|
106
|
+
__param(0, (0, common_1.Param)('sno')),
|
|
107
|
+
__metadata("design:type", Function),
|
|
108
|
+
__metadata("design:paramtypes", [Number]),
|
|
109
|
+
__metadata("design:returntype", Promise)
|
|
110
|
+
], CommonProductInfoAdminController.prototype, "findOne", null);
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, common_1.Put)('/app/admin/common-product-info/:sno'),
|
|
113
|
+
(0, hasRole_decorator_1.HasRoles)(enum_1.MANAGER_TYPE.PARTNER),
|
|
114
|
+
(0, common_1.UseGuards)(accessToken_guard_1.AccessTokenGuard, roles_guard_1.RolesGuard),
|
|
115
|
+
(0, swagger_1.ApiHeader)({
|
|
116
|
+
name: 'access token',
|
|
117
|
+
required: true,
|
|
118
|
+
description: '관리자 access token',
|
|
119
|
+
}),
|
|
120
|
+
(0, swagger_1.ApiOperation)({
|
|
121
|
+
summary: '상품 공통정보 수정',
|
|
122
|
+
description: '상품 공통정보 수정 API 입니다.',
|
|
123
|
+
}),
|
|
124
|
+
(0, swagger_1.ApiResponse)({ status: 200, type: common_product_info_entity_1.CommonProductInfo }),
|
|
125
|
+
__param(0, (0, common_1.Body)()),
|
|
126
|
+
__metadata("design:type", Function),
|
|
127
|
+
__metadata("design:paramtypes", [common_product_info_admin_update_dto_1.CommonProductInfoAdminUpdateDto]),
|
|
128
|
+
__metadata("design:returntype", void 0)
|
|
129
|
+
], CommonProductInfoAdminController.prototype, "update", null);
|
|
130
|
+
__decorate([
|
|
131
|
+
(0, common_1.Delete)('/app/admin/common-product-info/:sno'),
|
|
132
|
+
(0, hasRole_decorator_1.HasRoles)(enum_1.MANAGER_TYPE.PARTNER),
|
|
133
|
+
(0, common_1.UseGuards)(accessToken_guard_1.AccessTokenGuard, roles_guard_1.RolesGuard),
|
|
134
|
+
(0, swagger_1.ApiHeader)({
|
|
135
|
+
name: 'access token',
|
|
136
|
+
required: true,
|
|
137
|
+
description: '관리자 access token',
|
|
138
|
+
}),
|
|
139
|
+
(0, swagger_1.ApiOperation)({
|
|
140
|
+
summary: '상품 공통정보 삭제',
|
|
141
|
+
description: '상품 공통정보 삭제 API 입니다.',
|
|
142
|
+
}),
|
|
143
|
+
__param(0, (0, common_1.Param)('sno')),
|
|
144
|
+
__metadata("design:type", Function),
|
|
145
|
+
__metadata("design:paramtypes", [Number]),
|
|
146
|
+
__metadata("design:returntype", void 0)
|
|
147
|
+
], CommonProductInfoAdminController.prototype, "remove", null);
|
|
148
|
+
exports.CommonProductInfoAdminController = CommonProductInfoAdminController = __decorate([
|
|
149
|
+
(0, swagger_1.ApiTags)('[관리자] 상품 공통 정보 관리'),
|
|
150
|
+
(0, common_1.Controller)(),
|
|
151
|
+
__metadata("design:paramtypes", [common_product_info_service_1.CommonProductInfoService])
|
|
152
|
+
], CommonProductInfoAdminController);
|
|
153
|
+
//# sourceMappingURL=common-product-info.admin.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-product-info.admin.controller.js","sourceRoot":"","sources":["../../../../src/api/app/common-product-info/common-product-info.admin.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAWwB;AACxB,+EAAyE;AAEzE,6CAQyB;AACzB,qGAA6F;AAC7F,oFAAwE;AACxE,qGAA6F;AAC7F,qGAA6F;AAC7F,oFAAmE;AACnE,oDAAoD;AACpD,gFAAuE;AACvE,oEAA2D;AAKpD,IAAM,gCAAgC,GAAtC,MAAM,gCAAgC;IAC3C,YACmB,wBAAkD;QAAlD,6BAAwB,GAAxB,wBAAwB,CAA0B;IAClE,CAAC;IAgBE,AAAN,KAAK,CAAC,MAAM,CACH,GAAwB,EACvB,GAAoC;QAE5C,OAAO,MAAM,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;IACzE,CAAC;IAgBK,AAAN,KAAK,CAAC,aAAa,CACV,GAAwB,EACtB,GAAoC;QAE7C,MAAM,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC;QAClC,OAAO,MAAM,IAAI,CAAC,wBAAwB,CAAC,kBAAkB,CAC3D,UAAU,EACV,GAAG,CACJ,CAAC;IACJ,CAAC;IAeK,AAAN,KAAK,CAAC,OAAO,CAAe,GAAW;QACrC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,wBAAwB,CAAC,O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9C,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,sEAA+B;;8DAElD;AAcD;IAZC,IAAA,eAAM,EAAC,qCAAqC,CAAC;IAC7C,IAAA,4BAAQ,EAAC,mBAAY,CAAC,OAAO,CAAC;IAC9B,IAAA,kBAAS,EAAC,oCAAgB,EAAE,wBAAU,CAAC;IACvC,IAAA,mBAAS,EAAC;QACT,IAAI,EAAE,cAAc;QACpB,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,kBAAkB;KAChC,CAAC;IACD,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,YAAY;QACrB,WAAW,EAAE,qBAAqB;KACnC,CAAC;IACM,WAAA,IAAA,cAAK,EAAC,KAAK,CAAC,CAAA;;;;8DAEnB;2CApGU,gCAAgC;IAF5C,IAAA,iBAAO,EAAC,mBAAmB,CAAC;IAC5B,IAAA,mBAAU,GAAE;qCAGkC,sDAAwB;GAF1D,gCAAgC,CAqG5C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CommonProductInfoSearchDto } from './dto/common-product-info.search.dto';
|
|
2
|
+
import { CommonProductInfoService } from './common-product-info.service';
|
|
3
|
+
import { CommonProductInfo } from './entity/common-product-info.entity';
|
|
4
|
+
export declare class CommonProductInfoController {
|
|
5
|
+
private readonly commonProductInfoService;
|
|
6
|
+
constructor(commonProductInfoService: CommonProductInfoService);
|
|
7
|
+
find(dto: CommonProductInfoSearchDto): Promise<CommonProductInfo[]>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.CommonProductInfoController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
+
const common_product_info_search_dto_1 = require("./dto/common-product-info.search.dto");
|
|
19
|
+
const common_product_info_service_1 = require("./common-product-info.service");
|
|
20
|
+
const common_product_info_entity_1 = require("./entity/common-product-info.entity");
|
|
21
|
+
let CommonProductInfoController = class CommonProductInfoController {
|
|
22
|
+
constructor(commonProductInfoService) {
|
|
23
|
+
this.commonProductInfoService = commonProductInfoService;
|
|
24
|
+
}
|
|
25
|
+
async find(dto) {
|
|
26
|
+
return await this.commonProductInfoService.find(dto);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.CommonProductInfoController = CommonProductInfoController;
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, common_1.Get)(),
|
|
32
|
+
(0, swagger_1.ApiOperation)({
|
|
33
|
+
summary: '(사용자) 상품 공통정보 조회',
|
|
34
|
+
description: '(사용자) 상품 상세 진입시 공통정보 조회 API 입니다.',
|
|
35
|
+
}),
|
|
36
|
+
(0, swagger_1.ApiResponse)({ status: 200, type: common_product_info_entity_1.CommonProductInfo }),
|
|
37
|
+
__param(0, (0, common_1.Query)()),
|
|
38
|
+
__metadata("design:type", Function),
|
|
39
|
+
__metadata("design:paramtypes", [common_product_info_search_dto_1.CommonProductInfoSearchDto]),
|
|
40
|
+
__metadata("design:returntype", Promise)
|
|
41
|
+
], CommonProductInfoController.prototype, "find", null);
|
|
42
|
+
exports.CommonProductInfoController = CommonProductInfoController = __decorate([
|
|
43
|
+
(0, swagger_1.ApiTags)('[사용자] 상품 공통 정보'),
|
|
44
|
+
(0, common_1.Controller)('/app/common-product-info'),
|
|
45
|
+
__metadata("design:paramtypes", [common_product_info_service_1.CommonProductInfoService])
|
|
46
|
+
], CommonProductInfoController);
|
|
47
|
+
//# sourceMappingURL=common-product-info.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-product-info.controller.js","sourceRoot":"","sources":["../../../../src/api/app/common-product-info/common-product-info.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAwD;AACxD,6CAAqE;AACrE,yFAAkF;AAClF,+EAAyE;AACzE,oFAAwE;AAIjE,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IACtC,YACmB,wBAAkD;QAAlD,6BAAwB,GAAxB,wBAAwB,CAA0B;IAClE,CAAC;IAQE,AAAN,KAAK,CAAC,IAAI,CAAU,GAA+B;QACjD,OAAO,MAAM,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvD,CAAC;CACF,CAAA;AAdY,kEAA2B;AAWhC;IANL,IAAA,YAAG,GAAE;IACL,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,kBAAkB;QAC3B,WAAW,EAAE,kCAAkC;KAChD,CAAC;IACD,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,8CAAiB,EAAE,CAAC;IAC1C,WAAA,IAAA,cAAK,GAAE,CAAA;;qCAAM,2DAA0B;;uDAElD;sCAbU,2BAA2B;IAFvC,IAAA,iBAAO,EAAC,gBAAgB,CAAC;IACzB,IAAA,mBAAU,EAAC,0BAA0B,CAAC;qCAGQ,sDAAwB;GAF1D,2BAA2B,CAcvC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.CommonProductInfoModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const common_product_info_controller_1 = require("./common-product-info.controller");
|
|
12
|
+
const common_product_info_service_1 = require("./common-product-info.service");
|
|
13
|
+
const common_product_info_admin_controller_1 = require("./common-product-info.admin.controller");
|
|
14
|
+
let CommonProductInfoModule = class CommonProductInfoModule {
|
|
15
|
+
};
|
|
16
|
+
exports.CommonProductInfoModule = CommonProductInfoModule;
|
|
17
|
+
exports.CommonProductInfoModule = CommonProductInfoModule = __decorate([
|
|
18
|
+
(0, common_1.Module)({
|
|
19
|
+
controllers: [common_product_info_controller_1.CommonProductInfoController, common_product_info_admin_controller_1.CommonProductInfoAdminController],
|
|
20
|
+
providers: [common_product_info_service_1.CommonProductInfoService],
|
|
21
|
+
})
|
|
22
|
+
], CommonProductInfoModule);
|
|
23
|
+
//# sourceMappingURL=common-product-info.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-product-info.module.js","sourceRoot":"","sources":["../../../../src/api/app/common-product-info/common-product-info.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,qFAA+E;AAC/E,+EAAyE;AACzE,iGAA0F;AAMnF,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;CAAG,CAAA;AAA1B,0DAAuB;kCAAvB,uBAAuB;IAJnC,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,4DAA2B,EAAE,uEAAgC,CAAC;QAC5E,SAAS,EAAE,CAAC,sDAAwB,CAAC;KACtC,CAAC;GACW,uBAAuB,CAAG"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { HttpStatus } from '@nestjs/common';
|
|
2
|
+
import { CommonProductInfo } from './entity/common-product-info.entity';
|
|
3
|
+
import { CommonProductInfoSearchDto } from './dto/common-product-info.search.dto';
|
|
4
|
+
import { CommonProductInfoAdminSearchDto } from './dto/common-product-info.admin.search.dto';
|
|
5
|
+
import { CommonProductInfoAdminUpdateDto } from './dto/common-product-info.admin.update.dto';
|
|
6
|
+
import { CommonProductInfoAdminCreateDto } from './dto/common-product-info.admin.create.dto';
|
|
7
|
+
import { DefaultService } from 'src/common/service/default.service';
|
|
8
|
+
export declare class CommonProductInfoService extends DefaultService {
|
|
9
|
+
create(partnerSno: number, dto: CommonProductInfoAdminCreateDto): Promise<{
|
|
10
|
+
message: string;
|
|
11
|
+
statusCode: number;
|
|
12
|
+
}>;
|
|
13
|
+
getProductInfoList(partnerSno: number, dto: CommonProductInfoAdminSearchDto): Promise<{
|
|
14
|
+
statusCode: string;
|
|
15
|
+
data: any[];
|
|
16
|
+
count: any;
|
|
17
|
+
currentPage: any;
|
|
18
|
+
nextPage: any;
|
|
19
|
+
prevPage: number;
|
|
20
|
+
lastPage: number;
|
|
21
|
+
}>;
|
|
22
|
+
findOne(sno: number): Promise<CommonProductInfo[]>;
|
|
23
|
+
update(dto: CommonProductInfoAdminUpdateDto): Promise<{
|
|
24
|
+
status: HttpStatus;
|
|
25
|
+
message: string;
|
|
26
|
+
}>;
|
|
27
|
+
remove(sno: number): Promise<{
|
|
28
|
+
status: HttpStatus;
|
|
29
|
+
message: string;
|
|
30
|
+
}>;
|
|
31
|
+
find(dto: CommonProductInfoSearchDto): Promise<CommonProductInfo[]>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
9
|
+
var t = {};
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
13
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
14
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
15
|
+
t[p[i]] = s[p[i]];
|
|
16
|
+
}
|
|
17
|
+
return t;
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.CommonProductInfoService = void 0;
|
|
21
|
+
const common_1 = require("@nestjs/common");
|
|
22
|
+
const common_product_info_entity_1 = require("./entity/common-product-info.entity");
|
|
23
|
+
const typeorm_1 = require("typeorm");
|
|
24
|
+
const common_product_info_detail_entity_1 = require("./entity/common-product-info.detail.entity");
|
|
25
|
+
const typeorm_2 = require("typeorm");
|
|
26
|
+
const default_service_1 = require("../../../common/service/default.service");
|
|
27
|
+
const gsUtil_1 = require("../../../common/util/gsUtil");
|
|
28
|
+
let CommonProductInfoService = class CommonProductInfoService extends default_service_1.DefaultService {
|
|
29
|
+
async create(partnerSno, dto) {
|
|
30
|
+
const entityManager = await this.getEntityManager();
|
|
31
|
+
dto.partnerSno = partnerSno;
|
|
32
|
+
const result = await entityManager.save(common_product_info_entity_1.CommonProductInfo, dto);
|
|
33
|
+
if (dto.targetList) {
|
|
34
|
+
dto.targetList.map(async (value) => {
|
|
35
|
+
const productInfoDetail = new common_product_info_detail_entity_1.CommonProductInfoDetail();
|
|
36
|
+
productInfoDetail.relSno = result.sno;
|
|
37
|
+
productInfoDetail.commonCd = value.sno;
|
|
38
|
+
productInfoDetail.targetFl = dto.productInfoType;
|
|
39
|
+
await entityManager.save(productInfoDetail);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return { message: 'success', statusCode: 200 };
|
|
43
|
+
}
|
|
44
|
+
async getProductInfoList(partnerSno, dto) {
|
|
45
|
+
const entityManager = await this.getEntityManager();
|
|
46
|
+
let displayFl;
|
|
47
|
+
if (dto.displayFl === 'true') {
|
|
48
|
+
displayFl = true;
|
|
49
|
+
}
|
|
50
|
+
else if (dto.displayFl === 'false') {
|
|
51
|
+
displayFl = false;
|
|
52
|
+
}
|
|
53
|
+
let whereArr = {
|
|
54
|
+
partnerSno: partnerSno,
|
|
55
|
+
displayFl: displayFl,
|
|
56
|
+
displayType: dto.displayType,
|
|
57
|
+
startDt: dto.startDt,
|
|
58
|
+
endDt: dto.endDt,
|
|
59
|
+
};
|
|
60
|
+
if (dto.title) {
|
|
61
|
+
whereArr = Object.assign(whereArr, { title: (0, typeorm_1.Like)(`%${dto.title}%`) });
|
|
62
|
+
}
|
|
63
|
+
const list = await entityManager
|
|
64
|
+
.getRepository(common_product_info_entity_1.CommonProductInfo)
|
|
65
|
+
.findAndCount({
|
|
66
|
+
take: dto.take,
|
|
67
|
+
skip: dto.skip,
|
|
68
|
+
order: {
|
|
69
|
+
sno: 'DESC',
|
|
70
|
+
},
|
|
71
|
+
where: whereArr,
|
|
72
|
+
});
|
|
73
|
+
const data = [list[0], list[1]];
|
|
74
|
+
return (0, gsUtil_1.paginateResponse)(data, dto.page, dto.take);
|
|
75
|
+
}
|
|
76
|
+
async findOne(sno) {
|
|
77
|
+
const entityManager = await this.getEntityManager();
|
|
78
|
+
return await entityManager.getRepository(common_product_info_entity_1.CommonProductInfo).find({
|
|
79
|
+
where: { sno: sno },
|
|
80
|
+
relations: { targetList: true },
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
async update(dto) {
|
|
84
|
+
const entityManager = await this.getEntityManager();
|
|
85
|
+
const productInfoDetailRepository = entityManager.getRepository(common_product_info_detail_entity_1.CommonProductInfoDetail);
|
|
86
|
+
const { targetList } = dto, productInfoData = __rest(dto, ["targetList"]);
|
|
87
|
+
const result = await entityManager.update(common_product_info_entity_1.CommonProductInfo, dto.sno, productInfoData);
|
|
88
|
+
if (result.affected === 0) {
|
|
89
|
+
throw new common_1.HttpException('수정 중 오류가 발생했습니다.', common_1.HttpStatus.BAD_REQUEST);
|
|
90
|
+
}
|
|
91
|
+
await productInfoDetailRepository.delete({ relSno: dto.sno });
|
|
92
|
+
targetList === null || targetList === void 0 ? void 0 : targetList.map(async (value) => {
|
|
93
|
+
const productInfoDetail = new common_product_info_detail_entity_1.CommonProductInfoDetail();
|
|
94
|
+
productInfoDetail.relSno = dto.sno;
|
|
95
|
+
productInfoDetail.commonCd = value.sno;
|
|
96
|
+
productInfoDetail.targetFl = dto.productInfoType;
|
|
97
|
+
await entityManager.save(productInfoDetail);
|
|
98
|
+
});
|
|
99
|
+
return { status: common_1.HttpStatus.OK, message: '수정 성공' };
|
|
100
|
+
}
|
|
101
|
+
async remove(sno) {
|
|
102
|
+
if (!sno) {
|
|
103
|
+
throw new common_1.HttpException('sno 값이 없습니다.', common_1.HttpStatus.BAD_REQUEST);
|
|
104
|
+
}
|
|
105
|
+
const entityManager = await this.getEntityManager();
|
|
106
|
+
const productInfoRepository = entityManager.getRepository(common_product_info_entity_1.CommonProductInfo);
|
|
107
|
+
const productInfoDetailRepository = entityManager.getRepository(common_product_info_detail_entity_1.CommonProductInfoDetail);
|
|
108
|
+
await productInfoRepository.delete({ sno: sno });
|
|
109
|
+
await productInfoDetailRepository.delete({ relSno: sno });
|
|
110
|
+
return { status: common_1.HttpStatus.OK, message: '삭제 성공' };
|
|
111
|
+
}
|
|
112
|
+
async find(dto) {
|
|
113
|
+
const entityManager = await this.getEntityManager();
|
|
114
|
+
const commonCdArr = [dto.productNo, ...dto.categoryNos, dto.brandNo];
|
|
115
|
+
const commonCd = commonCdArr.join(',');
|
|
116
|
+
const qb = entityManager.createQueryBuilder(common_product_info_entity_1.CommonProductInfo, 'cpi');
|
|
117
|
+
const data = await qb
|
|
118
|
+
.leftJoinAndSelect('gs_common_product_info_detail', 'cpid', 'cpi.sno = cpid.relSno')
|
|
119
|
+
.where(new typeorm_2.Brackets((qb) => {
|
|
120
|
+
qb.where('cpid.commonCd IN (:...commonCd)', {
|
|
121
|
+
commonCd: [commonCd],
|
|
122
|
+
}).orWhere('cpi.productInfoType = (:...productInfoType)', {
|
|
123
|
+
productInfoType: ['ALL'],
|
|
124
|
+
});
|
|
125
|
+
}))
|
|
126
|
+
.andWhere('cpi.displayFl = :displayFl', { displayFl: 1 })
|
|
127
|
+
.orderBy(`FIELD(cpi.productInfoType, 'GOODS', 'CATEGORY', 'BRAND', 'ALL')`)
|
|
128
|
+
.addOrderBy('cpi.sno', 'DESC')
|
|
129
|
+
.getMany();
|
|
130
|
+
const today = new Date();
|
|
131
|
+
const year = today.getFullYear();
|
|
132
|
+
const month = (today.getMonth() + 1).toString().padStart(2, '0');
|
|
133
|
+
const date = today.getDate();
|
|
134
|
+
const todayDate = year + '-' + month + '-' + date;
|
|
135
|
+
if (data.length === 0) {
|
|
136
|
+
return data;
|
|
137
|
+
}
|
|
138
|
+
let periodCnt = 0;
|
|
139
|
+
for (const elem of data) {
|
|
140
|
+
if (elem.displayType !== 'ALWAYS') {
|
|
141
|
+
if (todayDate >= elem.startDt && todayDate <= elem.endDt) {
|
|
142
|
+
periodCnt = periodCnt + 1;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if (periodCnt > 0) {
|
|
147
|
+
for (const elem of data) {
|
|
148
|
+
if (elem.displayType !== 'ALWAYS') {
|
|
149
|
+
if (todayDate >= elem.startDt && todayDate <= elem.endDt) {
|
|
150
|
+
return [elem];
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
for (const elem of data) {
|
|
157
|
+
if (elem.displayType === 'ALWAYS') {
|
|
158
|
+
return [elem];
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return data;
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
exports.CommonProductInfoService = CommonProductInfoService;
|
|
166
|
+
exports.CommonProductInfoService = CommonProductInfoService = __decorate([
|
|
167
|
+
(0, common_1.Injectable)()
|
|
168
|
+
], CommonProductInfoService);
|
|
169
|
+
//# sourceMappingURL=common-product-info.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-product-info.service.js","sourceRoot":"","sources":["../../../../src/api/app/common-product-info/common-product-info.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,2CAAuE;AAEvE,oFAAwE;AACxE,qCAA+B;AAE/B,kGAAqF;AACrF,qCAAmC;AAKnC,6EAAoE;AACpE,wDAA0D;AAEnD,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,gCAAc;IAM1D,KAAK,CAAC,MAAM,CAAC,UAAkB,EAAE,GAAoC;QACnE,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAEpD,GAAG,CAAC,UAAU,GAAG,UAAU,CAAC;QAC5B,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,8CAAiB,EAAE,G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declare class CommonProductInfoAdminCreateDto {
|
|
3
|
+
partnerSno?: number;
|
|
4
|
+
category?: string;
|
|
5
|
+
title: string;
|
|
6
|
+
targetList?: TargetListDto[];
|
|
7
|
+
contentSameFl: YN.Y;
|
|
8
|
+
contents: string;
|
|
9
|
+
mobileContents?: string;
|
|
10
|
+
productInfoType: TARGET_TYPE.ALL;
|
|
11
|
+
productInfoExceptType?: 'GOODS' | 'CATEGORY' | 'BRAND';
|
|
12
|
+
displayFl: boolean;
|
|
13
|
+
displayType: DISPLAY_TYPE.ALWAYS;
|
|
14
|
+
startDt?: string;
|
|
15
|
+
endDt?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class TargetListDto {
|
|
18
|
+
label: string;
|
|
19
|
+
sno: number;
|
|
20
|
+
imageUrls?: string[];
|
|
21
|
+
}
|