Commit 3bd3d696 authored by qinhaitao's avatar qinhaitao

style: 💄 dist update

parent a1cf0621
...@@ -32,11 +32,11 @@ export default class AwardsController { ...@@ -32,11 +32,11 @@ export default class AwardsController {
/** /**
* 权益重新领取 * 权益重新领取
*/ */
receiveEnamePrize(context: IContext<IReceiveEnameParams>, {}: {}, [awardSer]: [AwardsService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<string | boolean | object | object[] | number[] | string[], false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<CodeType | IAwards, true>>; receiveEnamePrize(context: IContext<IReceiveEnameParams>, {}: {}, [awardSer]: [AwardsService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<string | boolean | object | string[] | object[] | number[], false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<CodeType | IAwards, true>>;
/** /**
* 概率抽奖 * 概率抽奖
*/ */
drawLotteryPrize(context: IContext<IParams>, { userInfo }: IControllerInfos, [awardSer]: [AwardsService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<string | boolean | object | object[] | number[] | string[], false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<{ drawLotteryPrize(context: IContext<IParams>, { userInfo }: IControllerInfos, [awardSer]: [AwardsService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<string | boolean | object | string[] | object[] | number[], false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<{
data: { data: {
type: number; type: number;
name: string; name: string;
......
...@@ -18,5 +18,5 @@ export default class StatController { ...@@ -18,5 +18,5 @@ export default class StatController {
/** /**
* 统计数据 * 统计数据
*/ */
getStats(context: IContext<IGetStatsParams>): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<string | boolean | object | object[] | number[] | string[], false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, true>>; getStats(context: IContext<IGetStatsParams>): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<string | boolean | object | string[] | object[] | number[], false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, true>>;
} }
...@@ -15,8 +15,8 @@ declare const _default: { ...@@ -15,8 +15,8 @@ declare const _default: {
list: IAwards[]; list: IAwards[];
}>>; }>>;
receiveObjectPrize: (context: IContext<import("./controller/awards.controller").IReceiveOjectParams>, {}: {}, [awardSer]: [import("./service").AwardsService]) => Promise<IResult<boolean>>; receiveObjectPrize: (context: IContext<import("./controller/awards.controller").IReceiveOjectParams>, {}: {}, [awardSer]: [import("./service").AwardsService]) => Promise<IResult<boolean>>;
receiveEnamePrize: (context: IContext<import("./controller/awards.controller").IReceiveEnameParams>, {}: {}, [awardSer]: [import("./service").AwardsService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<string | boolean | object | object[] | number[] | string[], false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<import("taobao-mini-sdk/lib/utils/codetypes").CodeType | IAwards, true>>; receiveEnamePrize: (context: IContext<import("./controller/awards.controller").IReceiveEnameParams>, {}: {}, [awardSer]: [import("./service").AwardsService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<string | boolean | object | string[] | object[] | number[], false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<import("taobao-mini-sdk/lib/utils/codetypes").CodeType | IAwards, true>>;
doHelp: (context: IContext<IParams>, { userInfo, vipInfo, activityInfo }: IControllerInfos, [userService, taskService, accessService]: [import("./service/user.service").default, import("./service").TaskService, import("./service").AccessService]) => Promise<IResult<boolean>>; doHelp: (context: IContext<IParams>, { userInfo, vipInfo, activityInfo }: IControllerInfos, [userService, taskService, accessService]: [import("./service/user.service").default, import("./service").TaskService, import("./service").AccessService]) => Promise<IResult<boolean>>;
getStats: (context: IContext<import("./controller/stat.controller").IGetStatsParams>) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<string | boolean | object | object[] | number[] | string[], false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, true>>; getStats: (context: IContext<import("./controller/stat.controller").IGetStatsParams>) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<string | boolean | object | string[] | object[] | number[], false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, true>>;
}; };
export default _default; export default _default;
...@@ -42,6 +42,19 @@ declare class UserService extends BaseService { ...@@ -42,6 +42,19 @@ declare class UserService extends BaseService {
* @returns 若更新成功,返回为1; 若更新失败,返回为 0 或系统直接报错 * @returns 若更新成功,返回为1; 若更新失败,返回为 0 或系统直接报错
*/ */
updateUser(_id: string, projection: IUpdateQuery): Promise<any>; updateUser(_id: string, projection: IUpdateQuery): Promise<any>;
/**
* @desc 排行榜
* @param {查询条件} match
* @param {排序规则} sort
* @param {查询条数} limit
*/
getRank(match: Object, sort: Object, limit: number): Promise<any>;
/**
* @desc 获取我的排名
* @param {查询条件} match
* @param {排序规则} sort
*/
getMyRank(match: Object, sort: Object): Promise<any>;
/** /**
* updateUser projection 格式化 * updateUser projection 格式化
* *
......
...@@ -290,6 +290,77 @@ var UserService = /** @class */ (function (_super) { ...@@ -290,6 +290,77 @@ var UserService = /** @class */ (function (_super) {
}); });
}); });
}; };
/**
* @desc 排行榜
* @param {查询条件} match
* @param {排序规则} sort
* @param {查询条数} limit
*/
UserService.prototype.getRank = function (match, sort, limit) {
return __awaiter(this, void 0, void 0, function () {
var data, activityId;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
data = this.context.data;
activityId = data.activityId;
return [4 /*yield*/, this.userdao.aggregate([
{ $match: __assign(__assign({}, match), { activityId: activityId }) },
{ $sort: sort },
{ $group: { _id: null, table: { $push: '$$ROOT' } } },
{ $unwind: { path: '$table', includeArrayIndex: 'no' } },
{
$project: {
_id: 0,
openId: '$table.openId',
userNick: '$table.userNick',
no: {
$add: ['$no', 1]
}
}
},
{ $limit: limit }
])];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
/**
* @desc 获取我的排名
* @param {查询条件} match
* @param {排序规则} sort
*/
UserService.prototype.getMyRank = function (match, sort) {
return __awaiter(this, void 0, void 0, function () {
var _a, openId, data, activityId;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = this.context, openId = _a.openId, data = _a.data;
activityId = data.activityId;
return [4 /*yield*/, this.userdao.aggregate([
{ $match: __assign(__assign({}, match), { activityId: activityId }) },
{ $sort: sort },
{ $group: { _id: null, table: { $push: '$$ROOT' } } },
{ $unwind: { path: '$table', includeArrayIndex: 'no' } },
{
$project: {
_id: 0,
openId: '$table.openId',
userNick: '$table.userNick',
no: {
$add: ['$no', 1]
}
}
},
{ $match: { openId: openId } }
])];
case 1: return [2 /*return*/, _b.sent()];
}
});
});
};
/** /**
* updateUser projection 格式化 * updateUser projection 格式化
* *
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment