Commit 40a581ee authored by qinhaitao's avatar qinhaitao

feat: 🎸 vip接口修改

parent 716daf38
...@@ -36,7 +36,7 @@ export default class AwardsController { ...@@ -36,7 +36,7 @@ export default class AwardsController {
/** /**
* 权益重新领取 * 权益重新领取
*/ */
receiveEnamePrize(context: IContext<IReceiveEnameParams>, { awardInfo, session }: IReceivePrizeControllerInfos, [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>>; receiveEnamePrize(context: IContext<IReceiveEnameParams>, { awardInfo, session }: IReceivePrizeControllerInfos, [awardSer]: [AwardsService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<string | boolean | object | string[] | number[] | object[], false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<CodeType | IAwards, true>>;
/** /**
* 概率抽奖 * 概率抽奖
*/ */
......
...@@ -47,13 +47,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) { ...@@ -47,13 +47,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
var common_1 = require("../decorator/common/"); var common_1 = require("../decorator/common/");
var common_2 = require("../decorator/common/");
var sdk_1 = require("../sdk"); var sdk_1 = require("../sdk");
var service_1 = require("../service"); var service_1 = require("../service");
var constants_1 = require("../constants"); var constants_1 = require("../constants");
var check_1 = require("../utils/common/check"); var check_1 = require("../utils/common/check");
var errorCode_1 = require("../errorCode"); var errorCode_1 = require("../errorCode");
var common_3 = require("../decorator/common");
var update_1 = require("../utils/common/update/"); var update_1 = require("../utils/common/update/");
var Share = /** @class */ (function () { var Share = /** @class */ (function () {
function Share() { function Share() {
...@@ -102,17 +100,17 @@ var Share = /** @class */ (function () { ...@@ -102,17 +100,17 @@ var Share = /** @class */ (function () {
}; };
__decorate([ __decorate([
common_1.checkParams(['activityId']), common_1.checkParams(['activityId']),
common_2.services([service_1.UserService]), common_1.services([service_1.UserService]),
__metadata("design:type", Function), __metadata("design:type", Function),
__metadata("design:paramtypes", [Object, Object]), __metadata("design:paramtypes", [Object, Object]),
__metadata("design:returntype", Promise) __metadata("design:returntype", Promise)
], Share.prototype, "getShareInfo", null); ], Share.prototype, "getShareInfo", null);
__decorate([ __decorate([
common_1.checkParams(['activityId', 'inviteId']), common_1.checkParams(['activityId', 'inviteId']),
common_2.registeInfos(['vipInfo']), common_1.registeInfos(['vipInfo']),
common_2.services([service_1.TaskService, service_1.StatService]), common_1.services([service_1.TaskService, service_1.StatService]),
common_2.preCheck([check_1.checkActivityTime, check_1.checkInviteId, check_1.checkNewVip, check_1.checkHelpRecord]), common_1.preCheck([check_1.checkActivityTime, check_1.checkInviteId, check_1.checkNewVip, check_1.checkHelpRecord]),
common_3.preUpdate([update_1.updateVip]), common_1.preUpdate([update_1.updateVip]),
__metadata("design:type", Function), __metadata("design:type", Function),
__metadata("design:paramtypes", [Object, Object, Array]), __metadata("design:paramtypes", [Object, Object, Array]),
__metadata("design:returntype", Promise) __metadata("design:returntype", Promise)
......
{"version":3,"file":"share.controller.js","sourceRoot":"","sources":["../../src/controller/share.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,+CAAkD;AAClD,+CAAuE;AACvE,8BAAqC;AACrC,sCAAkE;AAClE,0CAAwC;AACxC,+CAAsG;AACtG,0CAAyC;AACzC,8CAA+C;AAC/C,kDAAmD;AAKnD;IAAA;IA8CA,CAAC;IA7CC;;OAEG;IAGG,4BAAY,GAAlB,UACE,OAAyC,EACzC,EAA8B;YAA5B,QAAQ,cAAA;;;;gBAGO,OAAO,GACpB,QAAQ,oBADY,CACZ;gBAEZ,sBAAO,kBAAY,CAAC,OAAO,CAAC;wBAC1B,OAAO,EAAE,OAAO;qBACjB,CAAC,EAAA;;;KACH;IACD;;OAEG;I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pC,iBAAQ,CAAC,CAAC,yBAAiB,EAAE,qBAAa,EAAE,mBAAW,EAAE,uBAAe,CAAC,CAAC;QAC1E,kBAAS,CAAC,CAAC,kBAAS,CAAC,CAAC;;;;uCAoBtB;IACH,YAAC;CAAA,AA9CD,IA8CC;kBA9CoB,KAAK"}
\ No newline at end of file \ No newline at end of file
...@@ -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 | string[] | object[] | number[], 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[] | number[] | object[], false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, true>>;
} }
...@@ -9,7 +9,7 @@ export default class User { ...@@ -9,7 +9,7 @@ export default class User {
/** /**
* 获取会员信息 * 获取会员信息
*/ */
getVipInfo(context: IContext<IVipParams>, { session, activityUserNick }: IControllerInfos): Promise<IResult<IVipInfo>>; getVipInfo(context: IContext<IVipParams>, { session, activityUserNick }: IControllerInfos, [userService]: [UserService]): Promise<IResult<IVipInfo>>;
/** /**
* 获取排行榜 * 获取排行榜
*/ */
......
...@@ -49,24 +49,22 @@ Object.defineProperty(exports, "__esModule", { value: true }); ...@@ -49,24 +49,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
var common_1 = require("../decorator/common"); var common_1 = require("../decorator/common");
var sdk_1 = require("../sdk"); var sdk_1 = require("../sdk");
var service_1 = require("../service"); var service_1 = require("../service");
var vip_1 = require("../utils/common/vip");
var User = /** @class */ (function () { var User = /** @class */ (function () {
function User() { function User() {
} }
/** /**
* 获取会员信息 * 获取会员信息
*/ */
User.prototype.getVipInfo = function (context, _a) { User.prototype.getVipInfo = function (context, _a, _b) {
var session = _a.session, activityUserNick = _a.activityUserNick; var session = _a.session, activityUserNick = _a.activityUserNick;
var userService = _b[0];
return __awaiter(this, void 0, void 0, function () { return __awaiter(this, void 0, void 0, function () {
var callbackUrl, result; var result;
return __generator(this, function (_b) { return __generator(this, function (_c) {
switch (_b.label) { switch (_c.label) {
case 0: case 0: return [4 /*yield*/, userService.getShopVip(context, session, activityUserNick)];
callbackUrl = context.data.callbackUrl;
return [4 /*yield*/, vip_1.getShopVip(context, session, callbackUrl || vip_1.formatVipCbUrl(context), activityUserNick)];
case 1: case 1:
result = _b.sent(); result = _c.sent();
return [2 /*return*/, sdk_1.resultsModel.success(result)]; return [2 /*return*/, sdk_1.resultsModel.success(result)];
} }
}); });
...@@ -105,8 +103,9 @@ var User = /** @class */ (function () { ...@@ -105,8 +103,9 @@ var User = /** @class */ (function () {
__decorate([ __decorate([
common_1.checkParams(['activityId']), common_1.checkParams(['activityId']),
common_1.registeInfos(['session']), common_1.registeInfos(['session']),
common_1.services([service_1.UserService]),
__metadata("design:type", Function), __metadata("design:type", Function),
__metadata("design:paramtypes", [Object, Object]), __metadata("design:paramtypes", [Object, Object, Array]),
__metadata("design:returntype", Promise) __metadata("design:returntype", Promise)
], User.prototype, "getVipInfo", null); ], User.prototype, "getVipInfo", null);
__decorate([ __decorate([
......
{"version":3,"file":"user.controller.js","sourceRoot":"","sources":["../../src/controller/user.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,8CAAyE;AACzE,8BAAqC;AACrC,sCAAwC;AACxC,2CAAgE;AAOhE;IAAA;IAgDA,CAAC;IA/CC;;OAEG;IAGG,yBAAU,GAAhB,UACE,OAA6B,EAC7B,EAA+C;YAA7C,OAAO,aAAA,EAAE,gBAAgB,sBAAA;;;;;;wBAEnB,WAAW,GAAK,OAAO,CAAC,IAAI,YAAjB,CAAiB;wBAErB,qBAAM,gBAAU,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,IAAI,o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Y,CAAC,CAAC,SAAS,CAAC,CAAC;QACzB,iBAAQ,CAAC,CAAC,qBAAW,CAAC,CAAC;;;;0CAUvB;IAOD;QAFC,oBAAW,CAAC,CAAC,YAAY,CAAC,CAAC;QAC3B,iBAAQ,CAAC,CAAC,qBAAW,CAAC,CAAC;;;;2CA0BvB;IACH,WAAC;CAAA,AAjDD,IAiDC;kBAjDoB,IAAI"}
\ No newline at end of file \ No newline at end of file
...@@ -3,7 +3,7 @@ declare const _default: { ...@@ -3,7 +3,7 @@ declare const _default: {
login: (context: IContext<import("./controller/login.controller").ILoginParams>, { userInfo, activityInfo, vipInfo }: IControllerInfos, [userService, accessService]: [import("./service/user.service").default, import("./service").AccessService]) => Promise<IResult<{ login: (context: IContext<import("./controller/login.controller").ILoginParams>, { userInfo, activityInfo, vipInfo }: IControllerInfos, [userService, accessService]: [import("./service/user.service").default, import("./service").AccessService]) => Promise<IResult<{
openId: string; openId: string;
}>>; }>>;
getVipInfo: (context: IContext<import("./controller/user.controller").IVipParams>, { session, activityUserNick }: IControllerInfos) => Promise<IResult<IVipInfo>>; getVipInfo: (context: IContext<import("./controller/user.controller").IVipParams>, { session, activityUserNick }: IControllerInfos, [userService]: [import("./service/user.service").default]) => Promise<IResult<IVipInfo>>;
getTaskList: (context: IContext<{ getTaskList: (context: IContext<{
activityId: string; activityId: string;
}>, { userInfo, activityInfo }: IControllerInfos, [taskService]: [import("./service").TaskService]) => Promise<IResult<import("./service/task.service").ITaskInfo[]>>; }>, { userInfo, activityInfo }: IControllerInfos, [taskService]: [import("./service").TaskService]) => Promise<IResult<import("./service/task.service").ITaskInfo[]>>;
...@@ -27,12 +27,12 @@ declare const _default: { ...@@ -27,12 +27,12 @@ declare const _default: {
list: IAwards[]; list: IAwards[];
}>>; }>>;
receiveObjectPrize: (context: IContext<import("./controller/awards.controller").IReceiveOjectParams>, { activityInfo }: import("./controller/awards.controller").IReceivePrizeControllerInfos, [awardSer]: [import("./service").AwardsService]) => Promise<IResult<boolean>>; receiveObjectPrize: (context: IContext<import("./controller/awards.controller").IReceiveOjectParams>, { activityInfo }: import("./controller/awards.controller").IReceivePrizeControllerInfos, [awardSer]: [import("./service").AwardsService]) => Promise<IResult<boolean>>;
receiveEnamePrize: (context: IContext<import("./controller/awards.controller").IReceiveEnameParams>, { awardInfo, session }: import("./controller/awards.controller").IReceivePrizeControllerInfos, [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>>; receiveEnamePrize: (context: IContext<import("./controller/awards.controller").IReceiveEnameParams>, { awardInfo, session }: import("./controller/awards.controller").IReceivePrizeControllerInfos, [awardSer]: [import("./service").AwardsService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<string | boolean | object | string[] | number[] | object[], false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<import("taobao-mini-sdk/lib/utils/codetypes").CodeType | IAwards, true>>;
doHelp: (context: IContext<{ doHelp: (context: IContext<{
activityId: string; activityId: string;
inviteId: string; inviteId: string;
}>, { userInfo, activityInfo, inviteUserInfo }: import("./controller/share.controller").IdoHelpInfos, [taskService, statService]: [import("./service").TaskService, import("./service").StatService]) => Promise<IResult<boolean>>; }>, { userInfo, activityInfo, inviteUserInfo }: import("./controller/share.controller").IdoHelpInfos, [taskService, statService]: [import("./service").TaskService, import("./service").StatService]) => Promise<IResult<boolean>>;
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>>; getStats: (context: IContext<import("./controller/stat.controller").IGetStatsParams>) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<string | boolean | object | string[] | number[] | object[], false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, true>>;
addStat: (context: IContext<import("./controller/stat.controller").IAddStatsParams>, { userInfo }: IControllerInfos, [statService]: [import("./service").StatService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<boolean, true>>; addStat: (context: IContext<import("./controller/stat.controller").IAddStatsParams>, { userInfo }: IControllerInfos, [statService]: [import("./service").StatService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<boolean, true>>;
getRankList: (context: IContext<{ getRankList: (context: IContext<{
activityId: string; activityId: string;
......
...@@ -70,5 +70,9 @@ declare class UserService extends BaseService { ...@@ -70,5 +70,9 @@ declare class UserService extends BaseService {
* @returns 若用户不存在,返回null; 用户存在,返回用户信息(object对象) * @returns 若用户不存在,返回null; 用户存在,返回用户信息(object对象)
*/ */
getUserInfoById(_id: string): Promise<unknown>; getUserInfoById(_id: string): Promise<unknown>;
getShopVip(context: IContext<{
activityId: string;
callbackUrl?: string;
}>, session: string, activityUserNick: string): Promise<IVipInfo>;
} }
export default UserService; export default UserService;
...@@ -71,6 +71,7 @@ var db_1 = require("../db"); ...@@ -71,6 +71,7 @@ var db_1 = require("../db");
var utils_1 = require("../utils"); var utils_1 = require("../utils");
var userUpdate_1 = require("../utils/common/userUpdate"); var userUpdate_1 = require("../utils/common/userUpdate");
var format_1 = require("../utils/common/format"); var format_1 = require("../utils/common/format");
var vip_1 = require("../utils/common/vip");
var UserService = /** @class */ (function (_super) { var UserService = /** @class */ (function (_super) {
__extends(UserService, _super); __extends(UserService, _super);
function UserService(context) { function UserService(context) {
...@@ -329,6 +330,19 @@ var UserService = /** @class */ (function (_super) { ...@@ -329,6 +330,19 @@ var UserService = /** @class */ (function (_super) {
}); });
}); });
}; };
UserService.prototype.getShopVip = function (context, session, activityUserNick) {
return __awaiter(this, void 0, void 0, function () {
var callbackUrl;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
callbackUrl = context.data.callbackUrl;
return [4 /*yield*/, vip_1.getShopVip(context, session, callbackUrl || vip_1.formatVipCbUrl(context), activityUserNick)];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
return UserService; return UserService;
}(base_service_1.default)); }(base_service_1.default));
exports.default = UserService; exports.default = UserService;
......
This diff is collapsed.
/** @format */ /** @format */
import { checkParams } from '../decorator/common/' import { services, preCheck, registeInfos, preUpdate, checkParams } from '../decorator/common/'
import { services, preCheck, registeInfos } from '../decorator/common/'
import { resultsModel } from '../sdk' import { resultsModel } from '../sdk'
import { UserService, StatService, TaskService } from '../service' import { UserService, StatService, TaskService } from '../service'
import { STAT_TYPE } from '../constants' import { STAT_TYPE } from '../constants'
import { checkActivityTime, checkInviteId, checkHelpRecord, checkNewVip } from '../utils/common/check' import { checkActivityTime, checkInviteId, checkHelpRecord, checkNewVip } from '../utils/common/check'
import { CODE_TYPES } from '../errorCode' import { CODE_TYPES } from '../errorCode'
import { preUpdate } from '../decorator/common'
import { updateVip } from '../utils/common/update/' import { updateVip } from '../utils/common/update/'
export interface IdoHelpInfos extends IControllerInfos { export interface IdoHelpInfos extends IControllerInfos {
inviteUserInfo: IUserInfo inviteUserInfo: IUserInfo
......
...@@ -16,13 +16,14 @@ export default class User { ...@@ -16,13 +16,14 @@ export default class User {
*/ */
@checkParams(['activityId']) @checkParams(['activityId'])
@registeInfos(['session']) @registeInfos(['session'])
@services([UserService])
async getVipInfo( async getVipInfo(
context: IContext<IVipParams>, context: IContext<IVipParams>,
{ session, activityUserNick }: IControllerInfos { session, activityUserNick }: IControllerInfos,
[userService]: [UserService]
): Promise<IResult<IVipInfo>> { ): Promise<IResult<IVipInfo>> {
const { callbackUrl } = context.data
// 拼接回调参数 // 拼接回调参数
const result = await getShopVip(context, session, callbackUrl || formatVipCbUrl(context), activityUserNick) const result = await userService.getShopVip(context, session, activityUserNick)
return resultsModel.success(result) return resultsModel.success(result)
} }
......
...@@ -10,6 +10,7 @@ import { USER_DB_NAME } from '../db' ...@@ -10,6 +10,7 @@ import { USER_DB_NAME } from '../db'
import { getToday, formatUpdateUserProjection } from '../utils' import { getToday, formatUpdateUserProjection } from '../utils'
import { isNewVip } from '../utils/common/userUpdate' import { isNewVip } from '../utils/common/userUpdate'
import { formatUserNick } from '../utils/common/format' import { formatUserNick } from '../utils/common/format'
import { getShopVip, formatVipCbUrl } from '../utils/common/vip'
class UserService extends BaseService { class UserService extends BaseService {
userdao: IBaseDao userdao: IBaseDao
constructor(context: IContext<IParams>) { constructor(context: IContext<IParams>) {
...@@ -220,6 +221,15 @@ class UserService extends BaseService { ...@@ -220,6 +221,15 @@ class UserService extends BaseService {
async getUserInfoById(_id: string) { async getUserInfoById(_id: string) {
return await this.userdao.findOne({ _id }) return await this.userdao.findOne({ _id })
} }
async getShopVip(
context: IContext<{ activityId: string; callbackUrl?: string }>,
session: string,
activityUserNick: string
) {
const { callbackUrl } = context.data
return await getShopVip(context, session, callbackUrl || formatVipCbUrl(context), activityUserNick)
}
} }
export default UserService export default UserService
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