179 lines
7.5 KiB
JavaScript
179 lines
7.5 KiB
JavaScript
"use strict";
|
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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;
|
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
};
|
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
};
|
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.UserController = void 0;
|
|
const openapi = require("@nestjs/swagger");
|
|
const common_1 = require("@nestjs/common");
|
|
const swagger_1 = require("@nestjs/swagger");
|
|
const api_1 = require("../../common/api");
|
|
const user_im_dto_1 = require("../dto/user_im.dto");
|
|
const user_im_vo_1 = require("../vo/user_im.vo");
|
|
const red_packet_model_1 = require("../../../model/red_packet.model");
|
|
const red_packet_record_model_1 = require("../../../model/red_packet_record.model");
|
|
const user_model_1 = require("../../../model/user.model");
|
|
const user_im_service_1 = require("../service/user_im.service");
|
|
let UserController = class UserController {
|
|
userImService;
|
|
constructor(userImService) {
|
|
this.userImService = userImService;
|
|
}
|
|
like(dto) {
|
|
return this.userImService.like(dto);
|
|
}
|
|
info(dto) {
|
|
return this.userImService.info(dto);
|
|
}
|
|
redPackeDetail(dto) {
|
|
return this.userImService.redPackeDetail(dto);
|
|
}
|
|
redPackeRecords(dto, page) {
|
|
return this.userImService.redPackeRecords(dto, page);
|
|
}
|
|
createRedPacket(dto) {
|
|
return this.userImService.createRedPacket(dto);
|
|
}
|
|
claimed(dto) {
|
|
return this.userImService.claimed(dto);
|
|
}
|
|
claimedPrepare(dto) {
|
|
return this.userImService.claimedPrepare(dto);
|
|
}
|
|
updateUserProfile(dto) {
|
|
return this.userImService.updateUserProfile(dto);
|
|
}
|
|
getUserGradeByImUid() {
|
|
return this.userImService.getUserGradeByImUid();
|
|
}
|
|
};
|
|
exports.UserController = UserController;
|
|
__decorate([
|
|
(0, common_1.Get)('like'),
|
|
(0, swagger_1.ApiOperation)({ summary: '搜索用户 ' }),
|
|
api_1.Api.ApiPaginatedResponse({
|
|
model: user_im_vo_1.UserLikeVo,
|
|
codeDescription: '200成功,300已禁用,400失败',
|
|
}),
|
|
openapi.ApiResponse({ status: 200 }),
|
|
__param(0, (0, common_1.Query)()),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", [user_im_dto_1.UserLikeDto]),
|
|
__metadata("design:returntype", void 0)
|
|
], UserController.prototype, "like", null);
|
|
__decorate([
|
|
(0, common_1.Post)('info'),
|
|
(0, swagger_1.ApiOperation)({ summary: '搜索用户 ' }),
|
|
api_1.Api.ApiResponse({
|
|
model: user_model_1.UserModel,
|
|
codeDescription: '200成功,300已禁用,400失败',
|
|
}),
|
|
openapi.ApiResponse({ status: 201 }),
|
|
__param(0, (0, common_1.Body)()),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", [user_im_dto_1.UserInfoDto]),
|
|
__metadata("design:returntype", void 0)
|
|
], UserController.prototype, "info", null);
|
|
__decorate([
|
|
(0, common_1.Get)('redPackeDetail/:id'),
|
|
(0, swagger_1.ApiOperation)({ summary: '红包详情 ' }),
|
|
api_1.Api.ApiResponse({
|
|
model: red_packet_model_1.RedPacketModel,
|
|
codeDescription: '200成功,300已禁用,400失败',
|
|
}),
|
|
openapi.ApiResponse({ status: 200 }),
|
|
__param(0, (0, common_1.Param)()),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", [user_im_dto_1.UserRedPacketDetailDto]),
|
|
__metadata("design:returntype", void 0)
|
|
], UserController.prototype, "redPackeDetail", null);
|
|
__decorate([
|
|
(0, common_1.Get)('redPackeRecords/:id'),
|
|
(0, swagger_1.ApiOperation)({ summary: '红包领取记录 ' }),
|
|
api_1.Api.ApiPaginatedResponse({
|
|
model: red_packet_record_model_1.RedPacketRecordModel,
|
|
codeDescription: '200成功,300已禁用,400失败',
|
|
}),
|
|
openapi.ApiResponse({ status: 200 }),
|
|
__param(0, (0, common_1.Param)()),
|
|
__param(1, (0, common_1.Query)()),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", [user_im_dto_1.UserRedPacketDetailDto,
|
|
api_1.PaginatedDto]),
|
|
__metadata("design:returntype", void 0)
|
|
], UserController.prototype, "redPackeRecords", null);
|
|
__decorate([
|
|
(0, common_1.Post)('createRedPacket'),
|
|
(0, swagger_1.ApiOperation)({ summary: '创建红包 ' }),
|
|
api_1.Api.ApiResponse({
|
|
model: red_packet_model_1.RedPacketModel,
|
|
codeDescription: '200成功,300已禁用,400失败',
|
|
}),
|
|
openapi.ApiResponse({ status: 201, type: Object }),
|
|
__param(0, (0, common_1.Body)()),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", [user_im_dto_1.UserCreateRedPacketDto]),
|
|
__metadata("design:returntype", void 0)
|
|
], UserController.prototype, "createRedPacket", null);
|
|
__decorate([
|
|
(0, common_1.Post)('claimed'),
|
|
(0, swagger_1.ApiOperation)({ summary: '领取红包 ' }),
|
|
api_1.Api.ApiResponse({
|
|
model: user_im_vo_1.UserClaimedVo,
|
|
codeDescription: '200成功,300已禁用,400失败',
|
|
}),
|
|
openapi.ApiResponse({ status: 201, type: Object }),
|
|
__param(0, (0, common_1.Body)()),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", [user_im_dto_1.UserRedPacketDetailDto]),
|
|
__metadata("design:returntype", void 0)
|
|
], UserController.prototype, "claimed", null);
|
|
__decorate([
|
|
(0, common_1.Post)('claimedPrepare'),
|
|
(0, swagger_1.ApiOperation)({ summary: '准备领取红包,如果已经领取了则返回领取记录' }),
|
|
api_1.Api.ApiResponse({
|
|
model: user_im_vo_1.UserClaimedVo,
|
|
codeDescription: '200成功,300已禁用,400失败',
|
|
}),
|
|
openapi.ApiResponse({ status: 201, type: Object }),
|
|
__param(0, (0, common_1.Body)()),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", [user_im_dto_1.UserRedPacketDetailDto]),
|
|
__metadata("design:returntype", void 0)
|
|
], UserController.prototype, "claimedPrepare", null);
|
|
__decorate([
|
|
(0, common_1.Post)('updateUserProfile'),
|
|
(0, swagger_1.ApiOperation)({ summary: '修改IM用户资料' }),
|
|
api_1.Api.ApiResponse(),
|
|
openapi.ApiResponse({ status: 201 }),
|
|
__param(0, (0, common_1.Body)()),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", [user_im_dto_1.UserUpdateUserProfileDto]),
|
|
__metadata("design:returntype", void 0)
|
|
], UserController.prototype, "updateUserProfile", null);
|
|
__decorate([
|
|
(0, common_1.Get)('getUserGradeByImUid'),
|
|
(0, swagger_1.ApiOperation)({ summary: '获取用户等级' }),
|
|
api_1.Api.ApiPaginatedResponse({
|
|
model: user_model_1.UserModel,
|
|
}),
|
|
openapi.ApiResponse({ status: 200 }),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", []),
|
|
__metadata("design:returntype", void 0)
|
|
], UserController.prototype, "getUserGradeByImUid", null);
|
|
exports.UserController = UserController = __decorate([
|
|
(0, common_1.Controller)('userIm'),
|
|
(0, swagger_1.ApiTags)('IM用户'),
|
|
__metadata("design:paramtypes", [user_im_service_1.UserImService])
|
|
], UserController);
|
|
//# sourceMappingURL=user_im.controller.js.map
|