Commit e6fd20dd authored by qinhaitao's avatar qinhaitao

refactor: 💡 优化参数

parent 53b7fac5
......@@ -18,5 +18,5 @@ export default class StatController {
/**
* 统计数据
*/
getStats(context: IContext<IGetStatsParams>): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any[], true> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<string | boolean | object | string[] | object[] | number[], false>>;
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,6 +15,6 @@ declare const _default: {
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 | 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>>;
getStats: (context: IContext<import("./controller/stat.controller").IGetStatsParams>) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any[], true> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<string | boolean | object | string[] | object[] | number[], false>>;
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;
......@@ -13,12 +13,12 @@ declare class UserService extends BaseService {
*/
getUserInfo(): Promise<IUserInfo>;
/**
* @desc 根据inviteId获取用户详情
* @desc 根据openId获取用户详情
* @desc 常用于助力分享码为用户openId, 被邀请人打开活动助力时需要获取邀请人的用户详情
* @param {邀请人的openId} inviteId
* @param {openId} openId
* @returns 若用户不存在,返回null; 用户存在,返回用户信息(object对象)
*/
getUserInfoByOpenId(inviteId: string): Promise<IUserInfo>;
getUserInfoByOpenId(openId: string): Promise<IUserInfo>;
/**
* @desc 获取是否是会员
* @param {调用淘宝接口的session} session
......
......@@ -98,19 +98,19 @@ var UserService = /** @class */ (function (_super) {
});
};
/**
* @desc 根据inviteId获取用户详情
* @desc 根据openId获取用户详情
* @desc 常用于助力分享码为用户openId, 被邀请人打开活动助力时需要获取邀请人的用户详情
* @param {邀请人的openId} inviteId
* @param {openId} openId
* @returns 若用户不存在,返回null; 用户存在,返回用户信息(object对象)
*/
UserService.prototype.getUserInfoByOpenId = function (inviteId) {
UserService.prototype.getUserInfoByOpenId = function (openId) {
return __awaiter(this, void 0, void 0, function () {
var activityId, record;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
activityId = this.context.data.activityId;
return [4 /*yield*/, this.userdao.findOne({ openId: inviteId, activityId: activityId })];
return [4 /*yield*/, this.userdao.findOne({ openId: openId, activityId: activityId })];
case 1:
record = _a.sent();
return [2 /*return*/, record];
......
This diff is collapsed.
......@@ -28,14 +28,14 @@ class UserService extends BaseService {
}
/**
* @desc 根据inviteId获取用户详情
* @desc 根据openId获取用户详情
* @desc 常用于助力分享码为用户openId, 被邀请人打开活动助力时需要获取邀请人的用户详情
* @param {邀请人的openId} inviteId
* @param {openId} openId
* @returns 若用户不存在,返回null; 用户存在,返回用户信息(object对象)
*/
async getUserInfoByOpenId(inviteId: string) {
async getUserInfoByOpenId(openId: string) {
let { activityId } = this.context.data
let record = await this.userdao.findOne<IUserInfo>({ openId: inviteId, activityId })
let record = await this.userdao.findOne<IUserInfo>({ openId, activityId })
return record
}
......
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