Commit 72de2b97 authored by qinhaitao's avatar qinhaitao

init

parent 040b48e0
/** @format */
module.exports = {
parser: '@typescript-eslint/parser',
extends: ['prettier/@typescript-eslint', 'plugin:prettier/recommended'],
parserOptions: {
ecmaVersion: 2019,
sourceType: 'module'
},
env: {
browser: true,
node: true
}
}
.tea
.DS_Store
.vscode
debug.log
node_modules
\ No newline at end of file
module.exports = {
"printWidth": 120,
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": true,
"arrowParens": "avoid",
"insertPragma": true,
"tabWidth": 2,
"useTabs": false
};
\ No newline at end of file
# 通用模板
## 库表规范
http://cf.dui88.com/pages/viewpage.action?pageId=63937755
## sdk 接口文档说明
http://cf.dui88.com/pages/viewpage.action?pageId=66194323
## 模板说明
{
"runtime": "nodejs8",
"version": "1.0"
}
\ No newline at end of file
/** @format */
interface Iconfig {
VIP_CALLBACK_URL: string;
VIP_MOCK: boolean;
}
export declare const getConfig: (context: Context) => Iconfig;
export {};
"use strict";
/** @format */
Object.defineProperty(exports, "__esModule", { value: true });
exports.getConfig = void 0;
var online_1 = require("./online");
var test_1 = require("./test");
var configs = {
online: online_1.default,
test: test_1.default
};
exports.getConfig = function (context) {
var env = context.env;
return configs[env] || configs.test;
};
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAEd,mCAA6B;AAC7B,+BAAyB;AAOzB,IAAM,OAAO,GAAG;IACd,MAAM,kBAAA;IACN,IAAI,gBAAA;CACL,CAAA;AAEY,QAAA,SAAS,GAAG,UAAC,OAAgB;IACxC,IAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;IACvB,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,IAAI,CAAA;AACrC,CAAC,CAAA"}
\ No newline at end of file
/** @format */
declare const _default: {
VIP_CALLBACK_URL: string;
VIP_MOCK: boolean;
};
export default _default;
"use strict";
/** @format */
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
VIP_CALLBACK_URL: 'testUrl',
VIP_MOCK: false
};
//# sourceMappingURL=online.js.map
\ No newline at end of file
{"version":3,"file":"online.js","sourceRoot":"","sources":["../../src/config/online.ts"],"names":[],"mappings":";AAAA,cAAc;;AAEd,kBAAe;IACb,gBAAgB,EAAE,SAAS;IAC3B,QAAQ,EAAE,KAAK;CAChB,CAAA"}
\ No newline at end of file
declare const _default: {
VIP_CALLBACK_URL: string;
VIP_MOCK: boolean;
};
/** @format */
export default _default;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/** @format */
exports.default = {
VIP_CALLBACK_URL: 'onlineUrl',
VIP_MOCK: true
};
//# sourceMappingURL=test.js.map
\ No newline at end of file
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../src/config/test.ts"],"names":[],"mappings":";;AAAA,cAAc;AACd,kBAAe;IACb,gBAAgB,EAAE,WAAW;IAC7B,QAAQ,EAAE,IAAI;CACf,CAAA"}
\ No newline at end of file
/** @format */
export declare const BusinessError: {
ERROR_UPDATE_RETRY: {
code: string;
defaultMsg: string;
};
ERROR_NO_ACTIVITY: {
code: string;
defaultMsg: string;
};
ERROR_ACTIVITY_NOSTART: {
code: string;
defaultMsg: string;
};
ERROR_ACTIVITY_OVER: {
code: string;
defaultMsg: string;
};
ERROR_NO_USER: {
code: string;
defaultMsg: string;
};
ERROR_NEEDMEMBER_DOHELP: {
code: string;
defaultMsg: string;
};
ERROR_NO_VIP: {
code: string;
defaultMsg: string;
};
ERROR_TASK_ALREADYRECEIVE: {
code: string;
defaultMsg: string;
};
ERROR_TASK_COMPLETE: {
code: string;
defaultMsg: string;
};
ERROR_TASK_NORECEIVE: {
code: string;
defaultMsg: string;
};
ERROR_INVALID_INVITE_ID: {
code: string;
defaultMsg: string;
};
ERROR_NO_CREDITS: {
code: string;
defaultMsg: string;
};
ERROR_TASK_LIMIT: {
code: string;
defaultMsg: string;
};
ERROR_FORBIDDEN_OPE: {
code: string;
defaultMsg: string;
};
ERROR_RECEIVE_PRIZE: {
code: string;
defaultMsg: string;
};
ERROR_SEND_PRIZE: {
code: string;
defaultMsg: string;
};
ERROR_NO_PRIZE: {
code: string;
defaultMsg: string;
};
ERROR_NO_STOCK: {
code: string;
defaultMsg: string;
};
ERROR_PRIZE_EXPIRED: {
code: string;
defaultMsg: string;
};
};
export declare const CODE_TYPES: {
PARAMS_ERROR: import("taobao-mini-sdk/lib/utils/codetypes").CodeType;
SYSTEM_ERROR: import("taobao-mini-sdk/lib/utils/codetypes").CodeType;
SUCCESS: import("taobao-mini-sdk/lib/utils/codetypes").CodeType;
} & {
ERROR_UPDATE_RETRY: {
code: string;
defaultMsg: string;
};
ERROR_NO_ACTIVITY: {
code: string;
defaultMsg: string;
};
ERROR_ACTIVITY_NOSTART: {
code: string;
defaultMsg: string;
};
ERROR_ACTIVITY_OVER: {
code: string;
defaultMsg: string;
};
ERROR_NO_USER: {
code: string;
defaultMsg: string;
};
ERROR_NEEDMEMBER_DOHELP: {
code: string;
defaultMsg: string;
};
ERROR_NO_VIP: {
code: string;
defaultMsg: string;
};
ERROR_TASK_ALREADYRECEIVE: {
code: string;
defaultMsg: string;
};
ERROR_TASK_COMPLETE: {
code: string;
defaultMsg: string;
};
ERROR_TASK_NORECEIVE: {
code: string;
defaultMsg: string;
};
ERROR_INVALID_INVITE_ID: {
code: string;
defaultMsg: string;
};
ERROR_NO_CREDITS: {
code: string;
defaultMsg: string;
};
ERROR_TASK_LIMIT: {
code: string;
defaultMsg: string;
};
ERROR_FORBIDDEN_OPE: {
code: string;
defaultMsg: string;
};
ERROR_RECEIVE_PRIZE: {
code: string;
defaultMsg: string;
};
ERROR_SEND_PRIZE: {
code: string;
defaultMsg: string;
};
ERROR_NO_PRIZE: {
code: string;
defaultMsg: string;
};
ERROR_NO_STOCK: {
code: string;
defaultMsg: string;
};
ERROR_PRIZE_EXPIRED: {
code: string;
defaultMsg: string;
};
};
export declare const TBERROR: {
USER_PERMISSION_EXCEED_MAX_RIGHT_COUNT_IN_DAY: string;
COUPON_INVALID_OR_DELETED: string;
APPLY_OWNSELF_COUPON: string;
APPLY_SINGLE_COUPON_COUNT_EXCEED_LIMIT: string;
NO_RIGHT_QUANTITY: string;
ERRORA_3_567: string;
'Invalid session': string;
};
export declare const DRAW_STATUS: {
WAITAWARD: number;
PROCESSING: number;
SUCCESS: number;
FAIL: number;
EXPIRED: number;
RETRY: number;
};
export declare const PRIZE_TYPE: {
ENAME: number;
CREDITS: number;
OBJECT: number;
THANKS: number;
};
export declare const C_APP_NAME: string;
export declare const TAOBAO_SUCCESS_ORDER_STATUS: string[];
export declare const enum ACTIVITY_STATUS {
NORMAL = 1,
DELETE = 2
}
export declare const TASK_RATE_TYPE: {
FOREVER: number;
EVERYDAY: number;
NOLIMIT: number;
};
export declare const RECORD_TYPE: {
FOLLOW_TASK: {
type: number;
name: string;
};
SIGN_TASK: {
type: number;
name: string;
};
RECEIVE_INVITE: {
type: number;
name: string;
};
INVITE_SUCCESS: {
type: number;
name: string;
};
};
"use strict";
/** @format */
Object.defineProperty(exports, "__esModule", { value: true });
exports.RECORD_TYPE = exports.TASK_RATE_TYPE = exports.TAOBAO_SUCCESS_ORDER_STATUS = exports.C_APP_NAME = exports.PRIZE_TYPE = exports.DRAW_STATUS = exports.TBERROR = exports.CODE_TYPES = exports.BusinessError = void 0;
var sdk_1 = require("./sdk");
exports.BusinessError = {
// 更新重试失败(用于并发更新)
ERROR_UPDATE_RETRY: {
code: "210001",
defaultMsg: "\u7CFB\u7EDF\u9519\u8BEF"
},
// 活动不存在
ERROR_NO_ACTIVITY: {
code: "220001",
defaultMsg: "\u6D3B\u52A8\u4E0D\u5B58\u5728"
},
// 活动未开始
ERROR_ACTIVITY_NOSTART: {
code: "220002",
defaultMsg: "\u6D3B\u52A8\u672A\u5F00\u59CB"
},
// 活动已结束
ERROR_ACTIVITY_OVER: {
code: "220003",
defaultMsg: "\u6D3B\u52A8\u5DF2\u7ED3\u675F"
},
// 用户不存在
ERROR_NO_USER: {
code: "310002",
defaultMsg: "\u7528\u6237\u4E0D\u5B58\u5728"
},
// 需要成为会员才能助力哦
ERROR_NEEDMEMBER_DOHELP: {
code: "310004",
defaultMsg: '需要成为会员才能助力哦'
},
// 非店铺会员
ERROR_NO_VIP: {
code: "310005",
defaultMsg: '非店铺会员'
},
// 任务奖励已领取
ERROR_TASK_ALREADYRECEIVE: {
code: "430002",
defaultMsg: "\u4EFB\u52A1\u5956\u52B1\u5DF2\u9886\u53D6"
},
// 任务已完成
ERROR_TASK_COMPLETE: {
code: "430003",
defaultMsg: "\u4EFB\u52A1\u5DF2\u5B8C\u6210"
},
// 暂无次数可领取
ERROR_TASK_NORECEIVE: {
code: "430003",
defaultMsg: "\u6682\u65E0\u6B21\u6570\u53EF\u9886\u53D6"
},
ERROR_INVALID_INVITE_ID: {
code: "430004",
defaultMsg: "\u9080\u8BF7\u7801\u65E0\u6548"
},
ERROR_NO_CREDITS: {
code: "430005",
defaultMsg: "\u79EF\u5206\u4E0D\u8DB3"
},
ERROR_TASK_LIMIT: {
code: "430006",
defaultMsg: "\u4ECA\u65E5\u5B8C\u6210\u8BE5\u4EFB\u52A1\u6B21\u6570\u8D85\u9650"
},
ERROR_FORBIDDEN_OPE: {
code: "530001",
defaultMsg: "\u975E\u6CD5\u64CD\u4F5C"
},
ERROR_RECEIVE_PRIZE: {
code: "630002",
defaultMsg: "\u5956\u52B1\u5DF2\u9886\u53D6"
},
ERROR_SEND_PRIZE: {
code: "730001",
defaultMsg: "\u53D1\u5956\u5931\u8D25"
},
ERROR_NO_PRIZE: {
code: "730002",
defaultMsg: "\u5956\u54C1\u4E0D\u5B58\u5728"
},
ERROR_NO_STOCK: {
code: "730003",
defaultMsg: "\u5E93\u5B58\u4E0D\u8DB3"
},
ERROR_PRIZE_EXPIRED: {
code: "740001",
defaultMsg: "\u5956\u54C1\u5DF2\u8D85\u8FC7\u9886\u53D6\u65F6\u95F4"
}
};
exports.CODE_TYPES = Object.assign({}, sdk_1.DEFAULT_CODE_TYPES, exports.BusinessError);
// tb 接口返回部分错误
exports.TBERROR = {
USER_PERMISSION_EXCEED_MAX_RIGHT_COUNT_IN_DAY: '今日领取达到上限,明日再来领取哦',
COUPON_INVALID_OR_DELETED: '权益无效或者被删除,请联系商家',
APPLY_OWNSELF_COUPON: '不能领取自己家店铺权益',
APPLY_SINGLE_COUPON_COUNT_EXCEED_LIMIT: '请至卡券包删除无用权益再领取',
NO_RIGHT_QUANTITY: '权益库存不足,请联系商家',
ERRORA_3_567: '领取失败,为风险用户',
'Invalid session': '订购应用已过期,请联系商家处理'
};
// 领取奖品状态
exports.DRAW_STATUS = {
// 待领取
WAITAWARD: 1,
// 处理中
PROCESSING: 2,
// 领取成功
SUCCESS: 3,
// 领取失败
FAIL: 4,
// 已过期
EXPIRED: 5,
// 重新领取
RETRY: 6
};
// 奖品类型
exports.PRIZE_TYPE = {
ENAME: 1,
CREDITS: 2,
OBJECT: 3,
THANKS: 5
};
// C端的APP NAME
exports.C_APP_NAME = 'promotioncenter-${需要补充}';
// 订单状态
exports.TAOBAO_SUCCESS_ORDER_STATUS = [
'WAIT_SELLER_SEND_GOODS',
'SELLER_CONSIGNED_PART',
'WAIT_BUYER_CONFIRM_GOODS',
'TRADE_BUYER_SIGNED',
'TRADE_FINISHED',
'PAID_FORBID_CONSIGN'
];
//任务频率类型常量
exports.TASK_RATE_TYPE = {
FOREVER: 1,
EVERYDAY: 2,
NOLIMIT: 3
};
exports.RECORD_TYPE = {
FOLLOW_TASK: { type: 1, name: '关注店铺任务' },
SIGN_TASK: { type: 2, name: '签到任务' },
RECEIVE_INVITE: { type: 3, name: '接受邀请' },
INVITE_SUCCESS: { type: 4, name: '邀请成功' }
};
//# sourceMappingURL=constants.js.map
\ No newline at end of file
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAEd,6BAA0C;AAE7B,QAAA,aAAa,GAAG;IA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A,cAAc,GAAG;IAC5B,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,CAAC;CACX,CAAA;AAEY,QAAA,WAAW,GAAG;IACzB,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE;IACxC,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;IACpC,cAAc,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;IACzC,cAAc,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;CAC1C,CAAA"}
\ No newline at end of file
/** @format */
import { AwardsService, BaseService } from '../service';
export default class AwardsController {
/**
* 我的奖品列表
*/
getMyPrizeList(context: Context, {}: {}, [awardSer]: [AwardsService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result>;
/**
* 领取实物
*/
receiveObjectPrize(context: Context, {}: {}, [awardSer]: [AwardsService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result>;
/**
* 权益重新领取
*/
receiveEnamePrize(context: Context, {}: {}, [awardSer, baseService]: [AwardsService, BaseService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result>;
}
"use strict";
/** @format */
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
var decorator_1 = require("../decorator");
var sdk_1 = require("../sdk");
var service_1 = require("../service");
var AwardsController = /** @class */ (function () {
function AwardsController() {
}
/**
* 我的奖品列表
*/
AwardsController.prototype.getMyPrizeList = function (context, _a, _b) {
var awardSer = _b[0];
return __awaiter(this, void 0, void 0, function () {
var result;
return __generator(this, function (_c) {
switch (_c.label) {
case 0: return [4 /*yield*/, awardSer.getMyPrizeList({ openId: context.openId, activityId: context.data.activityId })];
case 1:
result = _c.sent();
return [2 /*return*/, sdk_1.resultsModel.success(result)];
}
});
});
};
/**
* 领取实物
*/
AwardsController.prototype.receiveObjectPrize = function (context, _a, _b) {
var awardSer = _b[0];
return __awaiter(this, void 0, void 0, function () {
var _c, province, city, area, addressdetail, _id, name, phone, activityId, result;
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
_c = context.data, province = _c.province, city = _c.city, area = _c.area, addressdetail = _c.addressdetail, _id = _c._id, name = _c.name, phone = _c.phone, activityId = _c.activityId;
return [4 /*yield*/, awardSer.recieveObjectPrize(_id, {
activityId: activityId,
province: province,
city: city,
area: area,
addressdetail: addressdetail,
name: name,
phone: phone
})
//@ts-ignore
];
case 1:
result = _d.sent();
//@ts-ignore
if (result.code) {
//@ts-ignore
return [2 /*return*/, sdk_1.resultsModel.error(result)];
}
return [2 /*return*/, sdk_1.resultsModel.success(result)];
}
});
});
};
/**
* 权益重新领取
*/
AwardsController.prototype.receiveEnamePrize = function (context, _a, _b) {
var awardSer = _b[0], baseService = _b[1];
return __awaiter(this, void 0, void 0, function () {
var _c, _id, activityId, result;
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
_c = context.data, _id = _c._id, activityId = _c.activityId;
return [4 /*yield*/, awardSer.recieveEnamePrize(_id, activityId)
//@ts-ignore
];
case 1:
result = _d.sent();
//@ts-ignore
if (result.code) {
//@ts-ignore
return [2 /*return*/, sdk_1.resultsModel.error(result)];
}
//@ts-ignore
if (result.remark) {
//@ts-ignore
return [2 /*return*/, sdk_1.resultsModel.error(result, result.remark)];
}
return [2 /*return*/, sdk_1.resultsModel.success(result)];
}
});
});
};
__decorate([
decorator_1.paramsCheck(['activityId']),
decorator_1.userCheck({ intercept: true }),
decorator_1.services([service_1.AwardsService]),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object, Object, Array]),
__metadata("design:returntype", Promise)
], AwardsController.prototype, "getMyPrizeList", null);
__decorate([
decorator_1.paramsCheck(['activityId', '_id', 'name', 'phone', 'province', 'city', 'area', 'addressdetail']),
decorator_1.userCheck({ intercept: true }),
decorator_1.services([service_1.AwardsService]),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object, Object, Array]),
__metadata("design:returntype", Promise)
], AwardsController.prototype, "receiveObjectPrize", null);
__decorate([
decorator_1.paramsCheck(['activityId', '_id']),
decorator_1.userCheck({ intercept: true }),
decorator_1.services([service_1.AwardsService, service_1.BaseService]),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object, Object, Array]),
__metadata("design:returntype", Promise)
], AwardsController.prototype, "receiveEnamePrize", null);
return AwardsController;
}());
exports.default = AwardsController;
//# sourceMappingURL=awards.controller.js.map
\ No newline at end of file
{"version":3,"file":"awards.controller.js","sourceRoot":"","sources":["../../src/controller/awards.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGd,0CAA+D;AAE/D,8BAAqC;AACrC,sCAAuD;AACvD;IAAA;IA4DA,CAAC;IA3DC;;OAEG;IAIG,yCAAc,GAApB,UAAqB,OAAgB,EAAE,EAAE,EAAE,EAA2B;YAA1B,QAAQ,QAAA;;;;;4BACrC,qBAAM,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,EAAA;;wBAAvG,MAAM,GAAG,SAA8F;wBAC3G,sBAAO,kBAAY,CAAC,OAAO,CAAC,MAAM,CAAC,EAAA;;;;KACpC;IAED;;OAEG;IAIG,6CAAkB,GAAxB,U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C,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAA;yBACjD;wBACD,sBAAO,kBAAY,CAAC,OAAO,CAAC,MAAM,CAAC,EAAA;;;;KACpC;IApDD;QAHC,uBAAW,CAAC,CAAC,YAAY,CAAC,CAAC;QAC3B,qBAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9B,oBAAQ,CAAC,CAAC,uBAAa,CAAC,CAAC;;;;0DAIzB;IAQD;QAHC,uBAAW,CAAC,CAAC,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;QAChG,qBAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9B,oBAAQ,CAAC,CAAC,uBAAa,CAAC,CAAC;;;;8DAmBzB;IAQD;QAHC,uBAAW,CAAC,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QAClC,qBAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9B,oBAAQ,CAAC,CAAC,uBAAa,EAAE,qBAAW,CAAC,CAAC;;;;6DAgBtC;IACH,uBAAC;CAAA,AA5DD,IA4DC;kBA5DoB,gBAAgB"}
\ No newline at end of file
/** @format */
import { BaseService } from '../service';
export default class BaseController {
/**
* 活动基本信息
*/
getActivityBaseInfoById(context: Context, {}: {}, [baseService]: [BaseService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result>;
}
"use strict";
/** @format */
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
var constants_1 = require("./../constants");
var decorator_1 = require("../decorator");
var sdk_1 = require("../sdk");
var service_1 = require("../service");
var BaseController = /** @class */ (function () {
function BaseController() {
}
/**
* 活动基本信息
*/
BaseController.prototype.getActivityBaseInfoById = function (context, _a, _b) {
var baseService = _b[0];
return __awaiter(this, void 0, void 0, function () {
var activityId, activityInfo;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
activityId = context.data.activityId;
// 参数校验
if (!activityId) {
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.PARAMS_ERROR, "activityId\u5FC5\u586B")];
}
return [4 /*yield*/, baseService.getBaseInfo(activityId)];
case 1:
activityInfo = _c.sent();
return [2 /*return*/, sdk_1.resultsModel.success(activityInfo)];
}
});
});
};
__decorate([
decorator_1.paramsCheck(['activityId']),
decorator_1.services([service_1.BaseService]),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object, Object, Array]),
__metadata("design:returntype", Promise)
], BaseController.prototype, "getActivityBaseInfoById", null);
return BaseController;
}());
exports.default = BaseController;
//# sourceMappingURL=base.controller.js.map
\ No newline at end of file
{"version":3,"file":"base.controller.js","sourceRoot":"","sources":["../../src/controller/base.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,4CAA2C;AAC3C,0CAAoD;AAEpD,8BAAqC;AACrC,sCAAwC;AACxC;IAAA;IAgBA,CAAC;IAfC;;OAEG;IAGG,gDAAuB,GAA7B,UAA8B,OAAgB,EAAE,EAAE,EAAE,EAA4B;YAA3B,WAAW,QAAA;;;;;;wBACtD,UAAU,GAAK,OAAO,CAAC,IAAI,WAAjB,CAAiB;wBACnC,OAAO;wBACP,IAAI,CAAC,UAAU,EAAE;4BACf,sBAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,YAAY,EAAE,wBAAc,CAAC,EAAA;yBACnE;wBAEoB,qBAAM,WAAW,CAAC,WAAW,CAAC,UAAU,CAAC,EAAA;;wBAAxD,YAAY,GAAG,SAAyC;wBAC9D,sBAAO,kBAAY,CAAC,OAAO,CAAC,YAAY,CAAC,EAAA;;;;KAC1C;IATD;QAFC,uBAAW,CAAC,CAAC,YAAY,CAAC,CAAC;QAC3B,oBAAQ,CAAC,CAAC,qBAAW,CAAC,CAAC;;;;iEAUvB;IACH,qBAAC;CAAA,AAhBD,IAgBC;kBAhBoB,cAAc"}
\ No newline at end of file
/** @format */
import { UserService, BaseService, AccessService } from '../service';
export default class Share {
/**
* 完成分享
*/
insertShareRecord(context: Context, { userInfo, vipInfo, activityInfo }: IControllerInfos, [userService, baseService, accessService]: [UserService, BaseService, AccessService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result>;
}
"use strict";
/** @format */
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
var constants_1 = require("./../constants");
var check_1 = require("../decorator/check");
var services_1 = require("../decorator/services");
var sdk_1 = require("../sdk");
var utils_1 = require("../utils");
var service_1 = require("../service");
// {
// "handler": "doFollowTask",
// "data": {
// "activityId": "5f213791964f9706aa59b192"
// }
// }
var Share = /** @class */ (function () {
function Share() {
}
/**
* 完成分享
*/
Share.prototype.insertShareRecord = function (context, _a, _b) {
var userInfo = _a.userInfo, vipInfo = _a.vipInfo, activityInfo = _a.activityInfo;
var userService = _b[0], baseService = _b[1], accessService = _b[2];
return __awaiter(this, void 0, void 0, function () {
var _c, activityId, inviteId, openId, inviteUserInfo, isFirstLogin, isValidShare, tasks, value, today, inviteUserId;
var _d;
return __generator(this, function (_e) {
switch (_e.label) {
case 0:
_c = context.data, activityId = _c.activityId, inviteId = _c.inviteId;
openId = context.openId;
return [4 /*yield*/, userService.getUserInfoByOpenId(inviteId)
// inviteId的用户信息查询不到, 则inviteId无效
];
case 1:
inviteUserInfo = _e.sent();
// inviteId的用户信息查询不到, 则inviteId无效
if (!inviteUserInfo)
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.ERROR_INVALID_INVITE_ID)];
return [4 /*yield*/, accessService.getAccessCount()];
case 2:
isFirstLogin = (_e.sent()) === 1;
isValidShare = [isFirstLogin].every(function (v) { return !!v; });
tasks = activityInfo.tasks;
value = (tasks || {}).inviteFriends.value;
today = utils_1.getToday();
if (!isValidShare) return [3 /*break*/, 4];
inviteUserId = inviteUserInfo._id;
// 增加邀请人的待领取次数和邀请记录
return [4 /*yield*/, userService.updateUser(inviteUserId, {
$inc: {
'remainTimes.invites': value
},
$push: (_d = {},
_d["taskInfo." + today + ".invites"] = { openId: openId, createTime: Date.now() },
_d)
})];
case 3:
// 增加邀请人的待领取次数和邀请记录
_e.sent();
_e.label = 4;
case 4: return [2 /*return*/, sdk_1.resultsModel.success(true)];
}
});
});
};
__decorate([
check_1.paramsCheck(['activityId', 'inviteId']),
check_1.activityTimeCheck,
services_1.services([service_1.UserService, service_1.BaseService, service_1.AccessService]),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object, Object, Array]),
__metadata("design:returntype", Promise)
], Share.prototype, "insertShareRecord", null);
return Share;
}());
exports.default = Share;
//# sourceMappingURL=share.controller.js.map
\ No newline at end of file
{"version":3,"file":"share.controller.js","sourceRoot":"","sources":["../../src/controller/share.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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EAAE;gCACzC,IAAI,EAAE;oCACJ,qBAAqB,EAAE,KAAK;iCAC7B;gCACD,KAAK;oCACH,GAAC,cAAY,KAAK,aAAU,IAAG,EAAE,MAAM,QAAA,EAAE,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE;uCAClE;6BACF,CAAC,EAAA;;wBARF,mBAAmB;wBACnB,SAOE,CAAA;;4BAGJ,sBAAO,kBAAY,CAAC,OAAO,CAAC,IAAI,CAAC,EAAA;;;;KAClC;IA5CD;QAHC,mBAAW,CAAC,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QACvC,yBAAiB;QACjB,mBAAQ,CAAC,CAAC,qBAAW,EAAE,qBAAW,EAAE,uBAAa,CAAC,CAAC;;;;kDA6CnD;IACH,YAAC;CAAA,AApDD,IAoDC;kBApDoB,KAAK"}
\ No newline at end of file
/** @format */
/** @format */
export default class StatController {
/**
* 统计数据
*/
getStats(context: Context): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result>;
}
This diff is collapsed.
{"version":3,"file":"stat.controller.js","sourceRoot":"","sources":["../../src/controller/stat.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,4BAAoF;AACpF,8BAAmF;AACnF,0CAAsD;AACtD,gCAAiC;AAEjC,cAAc;AACd;IAAA;IAyKA,CAAC;IAxKC;;OAEG;IACG,iCAAQ,GAAd,UAAe,OAAgB;;;;;;wBACvB,KAAmC,OAAO,CAAC,IAAI,EAA7C,UAAU,gBAAA,EAAE,QAAQ,cAAA,EAAE,MAAM,YAAA,CAAiB;wBAE/C,OAAO,GAAa,IAAI,aAAO,CAAC,OAAO,EAAE,iBAAY,CAAC,CAAA;wBACtD,SAAS,GAAa,IAAI,aAAO,CAAC,OAAO,EAAE,mBAAc,CAAC,CAAA;wBAC1D,SAAS,GAAa,IAAI,aAAO,CAAC,OAAO,EAAE,mBAAc,CAAC,CAAA;wBAC1D,SAAS,GAA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C,KAAK,EAAE,GAAG,CAAG;gCACzE,IAAI,EAAE,QAAQ;6BACf;yBACF,CAAC,CAAA;wBAIW,qBAAM,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC;gCAC/C,WAAW,EAAE,MAAM;gCACnB,QAAQ,EAAE,6BAAO,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,SAAI,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,UAAO;6BACnF,CAAC,EAAA;;wBAHE,MAAM,GAAG,SAGX;wBACF,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAA;wBACjC,IAAI,MAAM,CAAC,GAAG,EAAE;4BACd,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;yBAC1E;wBACD,sBAAO,kBAAY,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,EAAA;;;wBAEvC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAC,CAAC,CAAA;wBACxB,OAAO;wBACP,sBAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,YAAY,EAAE,sCAAQ,CAAC,EAAA;;;;;KAE/D;IACH,qBAAC;AAAD,CAAC,AAzKD,IAyKC"}
\ No newline at end of file
/** @format */
import { UserService, TaskService } from '../service';
export default class Task {
/**
* 任务列表
*/
getTaskList(context: Context, { userInfo, vipInfo, activityInfo, session }: IControllerInfos, [taskService]: [TaskService]): Promise<Result>;
/**
* 完成关注店铺任务
*/
doFollowTask(context: Context, { userInfo, activityInfo }: IControllerInfos, [TaskService]: [TaskService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result>;
/**
* 积分兑换次数
*/
doExchangeCreditsTask(context: Context, { userInfo, activityInfo, session }: IControllerInfos, [userService, taskService]: [UserService, TaskService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result>;
/**
* 浏览商品
*/
doBrowseGoodsTask(context: Context, { userInfo, activityInfo }: IControllerInfos, [taskService]: [TaskService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result>;
}
This diff is collapsed.
{"version":3,"file":"task.controller.js","sourceRoot":"","sources":["../../src/controller/task.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,4CAA2D;AAC3D,0CAA2F;AAE3F,8BAA6C;AAC7C,kCAAqD;AACrD,sCAAkE;AAElE,IAAI;AACJ,8BAA8B;AAC9B,cAAc;AACd,+CAA+C;AAC/C,MAAM;AACN,IAAI;AACJ;IAAA;IAgKA,CAAC;IA/JC;;OAEG;IAKG,0BAAW,GAAjB,UACE,OAAgB,EAChB,EAA8D,EAC9D,EAA4B;YAD1B,QAAQ,cAAA,EAAE,OAAO,aAAA,EAAE,YAAY,kBAAA,EAAE,OAAO,aAAA;YACzC,WAAW,QAAA;;;;;;wBAEJ,KAAK,GAAK,YAAY,MAAjB,CAAiB;wBAGF,KAAA,CAAA,KAAA,WAAW,CAAA,CAAC,WAAW,CAAA;8BAAC,QAAQ,CAAC,GAAG;8BAC9D,WAAW,CAAC,mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC;wBACzD,qBAAM,WAAW,CAAC,oBAAoB,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,EAAA;4BAF5C,qBAAM;gCAE1B,SAAgE;iCAChE;wBAEF,OAAO;sBAFL;;wBAHE,eAAe,GAAG,SAGpB;wBAGI,OAAO,GAAG,WAAW,CAAC,WAAW,CAAC,eAAe,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;wBAElE,UAAU,GAAG,WAAW,CAAC,cAAc,CAAC,eAAe,EAAE,KAAK,CAAC,CAAA;wBACrE,UAAU;wBACV,gFAAgF;wBAChF,YAAY;wBACZ,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sBAAU,CAAC,gBAAgB,CAAC,EAAA;yBACvD;wBAED,UAAU;wBACV,qBAAM,WAAW,CAAC,oBAAoB,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;gCAChE,MAAM,QAAA;6BACP,CAAC,EAAA;;wBAHF,UAAU;wBACV,SAEE,CAAA;wBAEF,sBAAO,kBAAY,CAAC,OAAO,CAAC,IAAI,CAAC,EAAA;;;;KAClC;IAvJD;QAJC,uBAAW,CAAC,CAAC,YAAY,CAAC,CAAC;QAC3B,qBAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9B,6BAAiB;QACjB,oBAAQ,CAAC,CAAC,qBAAW,CAAC,CAAC;;;;2CA6BvB;IAQD;QAHC,uBAAW,CAAC,CAAC,YAAY,CAAC,CAAC;QAC3B,6BAAiB;QACjB,oBAAQ,CAAC,CAAC,qBAAW,CAAC,CAAC;;;;4CAavB;IASD;QAJC,uBAAW,CAAC,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;QACtC,qBAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9B,6BAAiB;QACjB,oBAAQ,CAAC,CAAC,qBAAW,EAAE,qBAAW,CAAC,CAAC;;;;qDA6CpC;IASD;QAJC,uBAAW,CAAC,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;QACrC,qBAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9B,6BAAiB;QACjB,oBAAQ,CAAC,CAAC,qBAAW,CAAC,CAAC;;;;iDA0CvB;IACH,WAAC;CAAA,AAhKD,IAgKC;kBAhKoB,IAAI"}
\ No newline at end of file
/** @format */
import { UserService, AccessService } from '../service';
interface IVipContext extends Context {
data: {
activityId: string;
callbackUrl?: string;
};
}
interface ILoginContext extends Context {
data: {
activityId: string;
userNick: string;
avatar: string;
isFollow: boolean;
inviteId?: string;
};
}
export default class User {
/**
* 登录接口, 初始化/更新用户信息
*/
login(context: ILoginContext, { userInfo, vipInfo, activityInfo }: IControllerInfos, [userService, accessService]: [UserService, AccessService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result>;
/**
* 获取会员信息
*/
getVipInfo(context: IVipContext, { session }: IControllerInfos, [userService]: [UserService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result>;
}
export {};
"use strict";
/** @format */
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
var decorator_1 = require("../decorator");
var sdk_1 = require("../sdk");
var service_1 = require("../service");
var config_1 = require("../config");
var User = /** @class */ (function () {
function User() {
}
/**
* 登录接口, 初始化/更新用户信息
*/
User.prototype.login = function (context, _a, _b) {
var userInfo = _a.userInfo, vipInfo = _a.vipInfo, activityInfo = _a.activityInfo;
var userService = _b[0], accessService = _b[1];
return __awaiter(this, void 0, void 0, function () {
var openId, isFollow;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
openId = context.openId;
isFollow = context.data.isFollow;
if (!!userInfo) return [3 /*break*/, 2];
return [4 /*yield*/, userService.initUserData(vipInfo, activityInfo)];
case 1:
_c.sent();
return [3 /*break*/, 4];
case 2: return [4 /*yield*/, userService.updateUserData(vipInfo, userInfo)];
case 3:
_c.sent();
_c.label = 4;
case 4:
// access表
return [4 /*yield*/, accessService.addAccess(isFollow, vipInfo.isVip)];
case 5:
// access表
_c.sent();
return [2 /*return*/, sdk_1.resultsModel.success({
openId: openId
})];
}
});
});
};
/**
* 获取会员信息
*/
User.prototype.getVipInfo = function (context, _a, _b) {
var session = _a.session;
var userService = _b[0];
return __awaiter(this, void 0, void 0, function () {
var callbackUrl, VIP_CALLBACK_URL, result;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
callbackUrl = context.data.callbackUrl;
VIP_CALLBACK_URL = config_1.getConfig(context).VIP_CALLBACK_URL;
return [4 /*yield*/, userService.getShopVip(session, callbackUrl || VIP_CALLBACK_URL)];
case 1:
result = _c.sent();
return [2 /*return*/, sdk_1.resultsModel.success(result)];
}
});
});
};
__decorate([
decorator_1.paramsCheck(['activityId', 'userNick', 'avatar', 'isFollow']),
decorator_1.activityTimeCheck,
decorator_1.services([service_1.UserService, service_1.AccessService]),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object, Object, Array]),
__metadata("design:returntype", Promise)
], User.prototype, "login", null);
__decorate([
decorator_1.paramsCheck(['activityId']),
decorator_1.services([service_1.UserService]),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object, Object, Array]),
__metadata("design:returntype", Promise)
], User.prototype, "getVipInfo", null);
return User;
}());
exports.default = User;
//# sourceMappingURL=user.controller.js.map
\ No newline at end of file
{"version":3,"file":"user.controller.js","sourceRoot":"","sources":["../../src/controller/user.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,0CAAkF;AAElF,8BAAqC;AACrC,sCAAuD;AACvD,oCAAqC;AAiBrC;IAAA;IAyCA,CAAC;IAxCC;;OAEG;IAIG,oBAAK,GAAX,UACE,OAAsB,EACtB,EAAqD,EACrD,EAA0D;YADxD,QAAQ,cAAA,EAAE,OAAO,aAAA,EAAE,YAAY,kBAAA;YAChC,WAAW,QAAA,EAAE,aAAa,QAAA;;;;;;wBAEnB,MAAM,GAAK,OAAO,OAAZ,CAAY;wBAElB,QAAQ,GAAK,OAAO,CAAC,IAAI,SAAjB,CAAiB;6BAE7B,CAAC,QAAQ,EAAT,wBAAS;wBACX,qBAAM,WAAW,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,EAAA;;wBAArD,SAAqD,CAAA;;4BAErD,qBAAM,WAAW,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAA;;wBAAnD,SAAmD,CAAA;;;oBAGrD,UAAU;oBACV,qBAAM,aAAa,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC,EAAA;;wBADtD,UAAU;wBACV,SAAsD,CAAA;wBAEtD,sBAAO,kBAAY,CAAC,OAAO,CAAC;gCAC1B,MAAM,QAAA;6BACP,CAAC,EAAA;;;;KACH;IACD;;OAEG;IAGG,yBAAU,GAAhB,UAAiB,OAAoB,EAAE,EAA6B,EAAE,EAA4B;YAAzD,OAAO,aAAA;YAAuB,WAAW,QAAA;;;;;;wBACxE,WAAW,GAAK,OAAO,CAAC,IAAI,YAAjB,CAAiB;wBAC5B,gBAAgB,GAAK,kBAAS,CAAC,OAAO,CAAC,iBAAvB,CAAuB;wBAChC,qBAAM,WAAW,CAAC,UAAU,CAAC,OAAO,EAAE,WAAW,IAAI,gBAAgB,CAAC,EAAA;;wBAA/E,MAAM,GAAG,SAAsE;wBAErF,sBAAO,kBAAY,CAAC,OAAO,CAAC,MAAM,CAAC,EAAA;;;;KACpC;IAjCD;QAHC,uBAAW,CAAC,CAAC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;QAC7D,6BAAiB;QACjB,oBAAQ,CAAC,CAAC,qBAAW,EAAE,uBAAa,CAAC,CAAC;;;;qCAsBtC;IAMD;QAFC,uBAAW,CAAC,CAAC,YAAY,CAAC,CAAC;QAC3B,oBAAQ,CAAC,CAAC,qBAAW,CAAC,CAAC;;;;0CAOvB;IACH,WAAC;CAAA,AAzCD,IAyCC;kBAzCoB,IAAI"}
\ No newline at end of file
/** @format */
export declare const ACCESS_DB_NAME: string;
export declare const USER_DB_NAME: string;
export declare const AWARDS_DB_NAME: string;
export declare const RECORD_DB_NAME: string;
export declare const ERROR_LOG_DB_NAME: string;
export declare const SELLER_INFO_DB_NAME: string;
export declare const PRIZE_CONFIG_DB_NAME: string;
export declare const ACTIVITY_CONFIG_DB_NAME: string;
"use strict";
/** @format */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ACTIVITY_CONFIG_DB_NAME = exports.PRIZE_CONFIG_DB_NAME = exports.SELLER_INFO_DB_NAME = exports.ERROR_LOG_DB_NAME = exports.RECORD_DB_NAME = exports.AWARDS_DB_NAME = exports.USER_DB_NAME = exports.ACCESS_DB_NAME = void 0;
exports.ACCESS_DB_NAME = 'c_user_access';
exports.USER_DB_NAME = 'c_user';
exports.AWARDS_DB_NAME = 'c_awards_info';
exports.RECORD_DB_NAME = "c_user_record";
exports.ERROR_LOG_DB_NAME = 'error_log';
exports.SELLER_INFO_DB_NAME = 'a_seller_info';
exports.PRIZE_CONFIG_DB_NAME = 'b_prize_config';
exports.ACTIVITY_CONFIG_DB_NAME = 'b_activity_config';
//# sourceMappingURL=db.js.map
\ No newline at end of file
{"version":3,"file":"db.js","sourceRoot":"","sources":["../src/db.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAED,QAAA,cAAc,GAAW,eAAe,CAAA;AAExC,QAAA,YAAY,GAAW,QAAQ,CAAA;AAE/B,QAAA,cAAc,GAAW,eAAe,CAAA;AAExC,QAAA,cAAc,GAAW,eAAe,CAAA;AAExC,QAAA,iBAAiB,GAAW,WAAW,CAAA;AAEvC,QAAA,mBAAmB,GAAW,eAAe,CAAA;AAE7C,QAAA,oBAAoB,GAAW,gBAAgB,CAAA;AAE/C,QAAA,uBAAuB,GAAW,mBAAmB,CAAA"}
\ No newline at end of file
export declare const paramsCheck: (params: string[]) => (target: Object, name: string, descriptor: PropertyDescriptor) => void;
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.paramsCheck = void 0;
/** @format */
var sdk_1 = require("../sdk");
var constants_1 = require("../constants");
exports.paramsCheck = function (params) {
return function (target, name, descriptor) {
var method = descriptor.value;
descriptor.value = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var context = args[0], _a = args[1], otherArgs = _a === void 0 ? {} : _a;
var dataKeys = Object.keys(context.data);
for (var i = 0; i < params.length; i++) {
var param = params[i];
if (!dataKeys.includes(param))
return sdk_1.resultsModel.error(constants_1.CODE_TYPES.PARAMS_ERROR, "\u7F3A\u5C11" + param + "\u53C2\u6570");
}
return method.apply(target, [context, __assign({}, otherArgs)]);
};
};
};
//# sourceMappingURL=check.js.map
\ No newline at end of file
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/decorator/check.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,cAAc;AACd,8BAAqC;AACrC,0CAAyC;AAC5B,QAAA,WAAW,GAAG,UAAC,MAAgB;IAC1C,OAAO,UAAU,MAAc,EAAE,IAAY,EAAE,UAA8B;QAC3E,IAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAA;QAE/B,UAAU,CAAC,KAAK,GAAG;YAAU,cAAc;iBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;gBAAd,yBAAc;;YAClC,IAAA,OAAO,GAAoB,IAAI,GAAxB,EAAE,KAAkB,IAAI,GAAR,EAAd,SAAS,mBAAG,EAAE,KAAA,CAAQ;YACtC,IAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;YAC1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACtC,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;gBACvB,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;oBAAE,OAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,YAAY,EAAE,iBAAK,KAAK,iBAAI,CAAC,CAAA;aAClG;YACD,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,OAAO,eAAO,SAAS,EAAG,CAAC,CAAA;QAC1D,CAAC,CAAA;IACH,CAAC,CAAA;AACH,CAAC,CAAA"}
\ No newline at end of file
/** @format */
export * from './check';
export * from './services';
export * from './noCatch';
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
/** @format */
__exportStar(require("./check"), exports);
__exportStar(require("./services"), exports);
__exportStar(require("./noCatch"), exports);
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorator/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,cAAc;AACd,0CAAuB;AACvB,6CAA0B;AAC1B,4CAAyB"}
\ No newline at end of file
/** @format */
export declare const noCatch: (target: any, name: string, descriptor: PropertyDescriptor) => void;
"use strict";
/** @format */
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.noCatch = void 0;
exports.noCatch = function (target, name, descriptor) {
var method = descriptor.value;
descriptor.value = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return __awaiter(this, void 0, void 0, function () {
var context, _a, otherArgs;
return __generator(this, function (_b) {
context = args[0], _a = args[1], otherArgs = _a === void 0 ? {} : _a;
return [2 /*return*/, method.apply(this, [context, __assign(__assign({}, otherArgs), { noCatch: true })])];
});
});
};
};
//# sourceMappingURL=noCatch.js.map
\ No newline at end of file
{"version":3,"file":"noCatch.js","sourceRoot":"","sources":["../../src/decorator/noCatch.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED,QAAA,OAAO,GAAG,UAAC,MAAW,EAAE,IAAY,EAAE,UAA8B;IAC/E,IAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAA;IAC/B,UAAU,CAAC,KAAK,GAAG;QAAgB,cAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,yBAAc;;;;;gBACxC,OAAO,GAAoB,IAAI,GAAxB,EAAE,KAAkB,IAAI,GAAR,EAAd,SAAS,mBAAG,EAAE,KAAA,CAAQ;gBACtC,sBAAO,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,wBAAO,SAAS,KAAE,OAAO,EAAE,IAAI,IAAG,CAAC,EAAA;;;KACtE,CAAA;AACH,CAAC,CAAA"}
\ No newline at end of file
export declare const services: (services: any[]) => (target: Object, name: string, descriptor: PropertyDescriptor) => void;
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.services = void 0;
/** @format */
var utils_1 = require("../utils");
var sdk_1 = require("../sdk");
var constants_1 = require("../constants");
function initBaseInfo(context, baseInfos) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, baseInfos];
});
});
}
exports.services = function (services) {
return function (target, name, descriptor) {
var method = descriptor.value;
descriptor.value = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return __awaiter(this, void 0, void 0, function () {
var context, _a, otherArgs, servicesInstance, baseInfos, ret, error_1;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
context = args[0], _a = args[1], otherArgs = _a === void 0 ? {} : _a;
servicesInstance = services.map(function (v) { return new v(context); });
return [4 /*yield*/, initBaseInfo(context, otherArgs)
// 默认全局try catch 如果有noCatch参数则直接执行
];
case 1:
baseInfos = _b.sent();
// 默认全局try catch 如果有noCatch参数则直接执行
if (baseInfos.noCatch) {
delete baseInfos.noCatch;
return [2 /*return*/, method.apply(target, [context, baseInfos, servicesInstance])];
}
_b.label = 2;
case 2:
_b.trys.push([2, 4, , 6]);
utils_1.logger(context);
return [4 /*yield*/, method.apply(target, [context, baseInfos, servicesInstance])];
case 3:
ret = _b.sent();
return [3 /*break*/, 6];
case 4:
error_1 = _b.sent();
console.log('error', error_1);
return [4 /*yield*/, utils_1.recordErrorLog(context, baseInfos, error_1.toString(), error_1.stack)];
case 5:
_b.sent();
ret = sdk_1.resultsModel.error(constants_1.CODE_TYPES.SYSTEM_ERROR);
return [3 /*break*/, 6];
case 6: return [2 /*return*/, ret];
}
});
});
};
};
};
//# sourceMappingURL=services.js.map
\ No newline at end of file
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../src/decorator/services.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd,kCAAgD;AAChD,8BAAqC;AACrC,0CAAyC;AACzC,SAAe,YAAY,CAAC,OAAgB,EAAE,SAA2B;;;YAGvE,sBAAO,SAAS,EAAA;;;CACjB;AAEY,QAAA,QAAQ,GAAG,UAAC,QAAe;IACtC,OAAO,UAAC,MAAc,EAAE,IAAY,EAAE,UAA8B;QAClE,IAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAA;QAE/B,UAAU,CAAC,KAAK,GAAG;YAAgB,cAAc;iBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;gBAAd,yBAAc;;;;;;;4BAC1C,OAAO,GAAoB,IAAI,GAAxB,EAAE,KAAkB,IAAI,GAAR,EAAd,SAAS,mBAAG,EAAE,KAAA,CAAQ;4BAC9B,gBAAgB,GAAG,QAAQ,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,IAAI,CAAC,CAAC,OAAO,CAAC,EAAd,CAAc,CAAC,CAAA;4BACtB,qBAAM,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC;gCAC1E,mCAAmC;8BADuC;;4BAApE,SAAS,GAAqB,SAAsC;4BAC1E,mCAAmC;4BACnC,IAAI,SAAS,CAAC,OAAO,EAAE;gCACrB,OAAO,SAAS,CAAC,OAAO,CAAA;gCACxB,sBAAO,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC,EAAA;6BACpE;;;;4BAGC,cAAM,CAAC,OAAO,CAAC,CAAA;4BACT,qBAAM,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC,EAAA;;4BAAxE,GAAG,GAAG,SAAkE,CAAA;;;;4BAExE,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,OAAK,CAAC,CAAA;4BAC3B,qBAAM,sBAAc,CAAC,OAAO,EAAE,SAAS,EAAE,OAAK,CAAC,QAAQ,EAAE,EAAE,OAAK,CAAC,KAAK,CAAC,EAAA;;4BAAvE,SAAuE,CAAA;4BACvE,GAAG,GAAG,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,YAAY,CAAC,CAAA;;gCAEnD,sBAAO,GAAG,EAAA;;;;SACX,CAAA;IACH,CAAC,CAAA;AACH,CAAC,CAAA"}
\ No newline at end of file
/** @format */
declare const _default: {};
export default _default;
"use strict";
/** @format */
Object.defineProperty(exports, "__esModule", { value: true });
var utils_1 = require("./utils");
exports.default = utils_1.exportHandlers([]);
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,cAAc;;AAEd,iCAAwC;AAGxC,kBAAe,sBAAc,CAAC,EAAE,CAAC,CAAA"}
\ No newline at end of file
/** @format */
import Utils from 'taobao-mini-sdk/lib/utils/index';
import TBAPI from 'taobao-mini-sdk/lib/service/TBAPI';
declare const DEFAULT_CODE_TYPES: {
PARAMS_ERROR: import("taobao-mini-sdk/lib/utils/codetypes").CodeType;
SYSTEM_ERROR: import("taobao-mini-sdk/lib/utils/codetypes").CodeType;
SUCCESS: import("taobao-mini-sdk/lib/utils/codetypes").CodeType;
}, getStartTimestamp: (day: string) => number, getEndTimestamp: (day: string) => number;
declare const resultsModel: import("taobao-mini-sdk/lib/utils/resultmodel").ResultsModel;
export declare const TBAPIS: typeof TBAPI;
export declare const BaseDao: any;
export declare const transformBeijingDate: typeof Utils.transformBeijingDate;
export declare const dateFormatter: typeof Utils.dateFormatter;
export { DEFAULT_CODE_TYPES, resultsModel, getStartTimestamp, getEndTimestamp };
"use strict";
/** @format */
Object.defineProperty(exports, "__esModule", { value: true });
exports.getEndTimestamp = exports.getStartTimestamp = exports.resultsModel = exports.DEFAULT_CODE_TYPES = exports.dateFormatter = exports.transformBeijingDate = exports.BaseDao = exports.TBAPIS = void 0;
var index_1 = require("taobao-mini-sdk/lib/utils/index");
var base_dao_1 = require("taobao-mini-sdk/lib/dao/base.dao");
var TBAPI_1 = require("taobao-mini-sdk/lib/service/TBAPI");
var MockConfig = require('../mockServer/sdk');
var DEFAULT_CODE_TYPES = index_1.default.DEFAULT_CODE_TYPES, cloudDateFormatter = index_1.default.dateFormatter, cloudTransformBeijingDate = index_1.default.transformBeijingDate, getStartTimestamp = index_1.default.getStartTimestamp, getEndTimestamp = index_1.default.getEndTimestamp, ResultsModel = index_1.default.ResultsModel;
exports.DEFAULT_CODE_TYPES = DEFAULT_CODE_TYPES;
exports.getStartTimestamp = getStartTimestamp;
exports.getEndTimestamp = getEndTimestamp;
var resultsModel = new ResultsModel();
exports.resultsModel = resultsModel;
var env = process.argv[2];
console.log("env", env);
exports.TBAPIS = env === 'mock' ? MockConfig.TBAPIS : TBAPI_1.default;
exports.BaseDao = env === 'mock' ? MockConfig.BaseDao : base_dao_1.BaseDao;
exports.transformBeijingDate = env === 'mock' ? MockConfig.transformBeijingDate : cloudTransformBeijingDate;
exports.dateFormatter = env === 'mock' ? MockConfig.dateFormatter : cloudDateFormatter;
//# sourceMappingURL=sdk.js.map
\ No newline at end of file
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAEd,yDAAmD;AACnD,6DAA0E;AAC1E,2DAAqD;AACrD,IAAI,UAAU,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;AAG3C,IAAA,kBAAkB,GAMhB,eAAK,mBANW,EACH,kBAAkB,GAK/B,eAAK,cAL0B,EACX,yBAAyB,GAI7C,eAAK,qBAJwC,EAC/C,iBAAiB,GAGf,eAAK,kBAHU,EACjB,eAAe,GAEb,eAAK,gBAFQ,EACf,YAAY,GACV,eAAK,aADK,CACL;AAgBA,gDAAkB;AAAgB,8CAAiB;AAAE,0CAAe;AAd7E,IAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAA;AAcV,oCAAY;AAZzC,IAAI,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACzB,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;AAEV,QAAA,MAAM,GAAiB,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,eAAK,CAAA;AAEjE,QAAA,OAAO,GAAG,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,kBAAY,CAAA;AAE5D,QAAA,oBAAoB,GAC/B,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC,yBAAyB,CAAA;AAEjE,QAAA,aAAa,GAA+B,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,kBAAkB,CAAA"}
\ No newline at end of file
/**
* 访问明细
*
* @format
*/
export default class UserAccessService {
context: Context;
accessdao: IBaseDao;
constructor(context: Context);
/**
* 增加访问记录
* @param {是否关注店铺} isFollow
*/
addAccess(isFollow: boolean, isVip: boolean): Promise<any>;
getAccessCount(): Promise<any>;
}
"use strict";
/**
* 访问明细
*
* @format
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
var sdk_1 = require("../sdk");
var utils_1 = require("../utils");
var db_1 = require("../db");
var UserAccessService = /** @class */ (function () {
function UserAccessService(context) {
this.context = context;
this.accessdao = new sdk_1.BaseDao(context, db_1.ACCESS_DB_NAME);
}
/**
* 增加访问记录
* @param {是否关注店铺} isFollow
*/
UserAccessService.prototype.addAccess = function (isFollow, isVip) {
return __awaiter(this, void 0, void 0, function () {
var _a, openId, data, activityId, userNick, avatar, inviteId;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = this.context, openId = _a.openId, data = _a.data;
activityId = data.activityId, userNick = data.userNick, avatar = data.avatar, inviteId = data.inviteId;
return [4 /*yield*/, this.accessdao.insertOne({
openId: openId,
activityId: activityId,
userNick: userNick,
avatar: avatar,
isReceiveShare: !!inviteId,
inviteId: inviteId,
isFollow: isFollow,
isVip: isVip,
accessTime: Date.now(),
createTime: Date.now(),
updateTime: Date.now(),
createDay: utils_1.getToday()
})];
case 1: return [2 /*return*/, _b.sent()];
}
});
});
};
UserAccessService.prototype.getAccessCount = function () {
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.accessdao.count({
openId: openId,
activityId: activityId
})];
case 1: return [2 /*return*/, _b.sent()];
}
});
});
};
return UserAccessService;
}());
exports.default = UserAccessService;
//# sourceMappingURL=access.service.js.map
\ No newline at end of file
{"version":3,"file":"access.service.js","sourceRoot":"","sources":["../../src/service/access.service.ts"],"names":[],"mappings":";AAAA;;;;G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SAGL,EAAA;;;;KACH;IACH,wBAAC;AAAD,CAAC,AAvCD,IAuCC"}
\ No newline at end of file
/**
* 奖励
*
* @format
*/
import UserService from './user.service';
export default class AwardsService extends UserService {
awardsdao: IBaseDao;
activityprizedao: IBaseDao;
constructor(context: Context);
reduceStock(_id: string): Promise<true | import("taobao-mini-sdk/lib/utils/codetypes").CodeType>;
/**
* 插入奖品记录
* @param {*} award
*/
addAward(award: any): Promise<any>;
/**
* 发放奖品
* @param {*} document
*/
sendAward(document: any): Promise<any>;
/**
* 我的奖品
* @param {*} param0
*/
getMyPrizeList({ openId, activityId }: {
openId: any;
activityId: any;
}): Promise<any>;
recieveObjectPrize(_id: any, { activityId, province, city, area, addressdetail, name, phone }: {
activityId: any;
province: any;
city: any;
area: any;
addressdetail: any;
name: any;
phone: any;
}): Promise<true | import("taobao-mini-sdk/lib/utils/codetypes").CodeType>;
recieveEnamePrize(_id: any, activityId: any): Promise<{}>;
/**
* 获取活动配置项奖品
* @param {*} _id
*/
getActivityPrizeById(_id: string): Promise<any>;
}
This diff is collapsed.
{"version":3,"file":"awards.service.js","sourceRoot":"","sources":["../../src/service/awards.service.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,8BAAgC;AAChC,+CAAwC;AACxC,0CAAmF;AACnF,4BAA4D;AAC5D,kCAA2E;AAE3E;IAA2C,iCAAW;IAGpD,uBAAY,OAAgB;QAA5B,YACE,kBAAM,OAAO,CAAC,SAGf;QAFC,KAAI,CAAC,SAAS,GAAG,IAAI,aAAO,CAAC,OAAO,EAAE,mBAAc,CAAC,CAAA;QACrD,KAAI,CAAC,gBAAgB,GAAG,IAAI,aAAO,CAAC,OAAO,EAAE,yBAAoB,CAAC,CAAA;;IACpE,CAAC;IAED,YAAY;IACN,mCAAW,GAAjB,UAAkB,GAAW;;;;;4BACd,qBAAM,IAAI,CAAC,gBAAgB,C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AyNrD"}
\ No newline at end of file
/**
* 基本信息
*
* @format
*/
export default class BaseService {
context: Context;
activitydao: IBaseDao;
constructor(context: Context);
/**
* @desc 活动基本信息
* @param {活动id} activityId
* @returns 返回活动详情,若不存在活动,返回为null
*/
getBaseInfo(activityId: string): Promise<any>;
}
"use strict";
/**
* 基本信息
*
* @format
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
var sdk_1 = require("../sdk");
var db_1 = require("../db");
var BaseService = /** @class */ (function () {
function BaseService(context) {
this.context = context;
this.activitydao = new sdk_1.BaseDao(context, db_1.ACTIVITY_CONFIG_DB_NAME);
}
/**
* @desc 活动基本信息
* @param {活动id} activityId
* @returns 返回活动详情,若不存在活动,返回为null
*/
BaseService.prototype.getBaseInfo = function (activityId) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
console.log(process.argv[2], 'process.argv[2]');
return [4 /*yield*/, this.activitydao.findOne({ _id: activityId })];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
return BaseService;
}());
exports.default = BaseService;
//# sourceMappingURL=base.service.js.map
\ No newline at end of file
{"version":3,"file":"base.service.js","sourceRoot":"","sources":["../../src/service/base.service.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,8BAAgC;AAChC,4BAA+C;AAE/C;IAGE,qBAAY,OAAgB;QAC1B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,WAAW,GAAG,IAAI,aAAO,CAAC,OAAO,EAAE,4BAAuB,CAAC,CAAA;IAClE,CAAC;IACD;;;;OAIG;IACG,iCAAW,GAAjB,UAAkB,UAAkB;;;;;wBAClC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAA;wBACxC,qBAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,EAAA;4BAA1D,sBAAO,SAAmD,EAAA;;;;KAC3D;IACH,kBAAC;AAAD,CAAC,AAhBD,IAgBC"}
\ No newline at end of file
/** @format */
export { default as BaseService } from './base.service';
"use strict";
/** @format */
Object.defineProperty(exports, "__esModule", { value: true });
var base_service_1 = require("./base.service");
Object.defineProperty(exports, "BaseService", { enumerable: true, get: function () { return base_service_1.default; } });
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/service/index.ts"],"names":[],"mappings":";AAAA,cAAc;;AAEd,+CAAuD;AAA9C,2GAAA,OAAO,OAAe"}
\ No newline at end of file
/**
* 任务相关方法
*
* @format
*/
import UserService from './user.service';
interface ITaskInfo {
taskType?: string;
url?: string;
rewards: number;
done?: boolean;
itemIds?: string;
waitReceive?: number;
title: string;
}
export default class TaskService extends UserService {
constructor(context: Context);
initVipTask(userInfo: IUserInfo, vipInfo: IVipInfo, tasks: ITasks): ITaskInfo;
initOrderGoodsTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo;
initBrowseGoodsTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo;
initInvitesTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo;
initFollowTask(userInfo: IUserInfo, tasks: ITasks): {
taskType: string;
title: string;
rewards: number;
waitReceive: number;
done: boolean;
};
initExchangeCreditsTask(userInfo: IUserInfo, tasks: ITasks): {
taskType: string;
title: string;
rewards: number;
waitReceive: number;
done: boolean;
};
updateVipTaskStatus(userInfo: IUserInfo, vipInfo: IVipInfo, tasks: ITasks): {
member: IMemberInfo;
remainTimes: IRemainTimesInfo;
};
updateOrderGoodsTask(userInfo: IUserInfo, tasks: ITasks, session?: string): Promise<{
remainTimes?: undefined;
taskInfo?: undefined;
} | {
remainTimes: IRemainTimesInfo;
taskInfo: object;
}>;
/**
*更新关注店铺任务状态
*
* @param {IUserInfo} userInfo
* @param {IActivityInfo} activityInfo
* @returns
* @memberof TaskService
*/
updateFollowTask(userInfo: IUserInfo, activityInfo: IActivityInfo): Promise<any>;
/**
*
* 获取任务今天完成的次数
*
* @param {string} taskType 任务类型
* @param {IUserInfo} userInfo 用户信息
* @returns {number} todayTimes 今日任务完成次数 todayTaskInfo 今日对应任务完成详情
* @memberof TaskService
*/
getTodayCompleteTask(taskType: string, userInfo: IUserInfo): {
todayTimes: any;
todayTaskInfo: any;
};
/**
* 根据任务类型获取任务完成情况
*
* @param {IUserInfo} userInfo
* @param {string} taskType
* @returns {array}
* @memberof TaskService
*/
getCompleteTaskByUserTaskInfo(taskType: string, userInfo: IUserInfo): any[];
/**
*根据任务类型更新任务待领取次数和任务记录
*
* @param {string} taskType
* @param {number} rewards
* @param {IUserInfo} userInfo
* @param {object} [customRecord]
* @returns {boolean}
* @memberof TaskService
*/
updateUserTaskRecord(taskType: string, rewards: number, userInfo: IUserInfo, customRecord?: object): Promise<boolean>;
updateTasks(id: string, needUpdateKeysArray: object[]): Promise<any>;
}
export {};
This diff is collapsed.
{"version":3,"file":"task.service.js","sourceRoot":"","sources":["../../src/service/task.service.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,+CAAwC;AAExC,kCAAqD;AACrD,0CAA6C;AAW7C;IAAyC,+BAAW;IAClD,qBAAY,OAAgB;eAC1B,kBAAM,OAAO,CAAC;IAChB,CAAC;IAED,iCAAW,GAAX,UAAY,QAAmB,EAAE,OAAiB,EAAE,KAAa;QAE7D,IAAA,KAEE,QAAQ,OAFiB,EAAjB,IAAI,UAAA,EAAE,SAAS,eAAA,EACzB,WAAW,GACT,QAAQ,YADC,CACD;QAEZ,SAAS;QAES,IAAA,KAAK,GACnB,KAAK,mBADc,CACd;QAET,OAAO;QAEP,IAAM,WAAW,GAAG,IAAI,CAAA;QAExB,OAAO;YACL,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE,0BAAM;YACb,GAAG,EAAE,OAAO,CAAC,GAAG;Y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C,GAAG,EAAE,IAAK,YAAY,CAAE;uCACvF;6BACF,CAAC,EAAA;;wBAPI,MAAM,GAAG,SAOb;wBACF,sBAAO,MAAM,KAAK,CAAC,EAAA;;;;KACpB;IAEK,iCAAW,GAAjB,UAAkB,EAAU,EAAE,mBAA6B;;;;;;wBACnD,UAAU,GAAG,MAAM,CAAC,MAAM,OAAb,MAAM,kBAAQ,EAAE,GAAK,mBAAmB,EAAC,CAAA;wBAC5D,qBAAM,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE;gCACxB,IAAI,EAAE,UAAU;6BACjB,CAAC,EAAA;;wBAFF,SAEE,CAAA;wBACK,qBAAM,IAAI,CAAC,WAAW,EAAE,EAAA;4BAA/B,sBAAO,SAAwB,EAAA;;;;KAChC;IACH,kBAAC;AAAD,CAAC,AA/VD,CAAyC,sBAAW,GA+VnD"}
\ No newline at end of file
/**
* 用户相关方法
*
* @format
*/
import BaseService from './base.service';
declare class UserService extends BaseService {
userdao: IBaseDao;
constructor(context: Context);
/**
* @desc 获取当前打开活动的用户详情
* @returns 若用户不存在,返回null; 用户存在,返回用户信息(object对象)
*/
getUserInfo(): Promise<any>;
/**
* @desc 根据inviteId获取用户详情
* @desc 常用于助力分享码为用户openId, 被邀请人打开活动助力时需要获取邀请人的用户详情
* @param {邀请人的openId} inviteId
* @returns 若用户不存在,返回null; 用户存在,返回用户信息(object对象)
*/
getUserInfoByOpenId(inviteId: string): Promise<any>;
/**
* @desc 获取是否是会员
* @param {调用淘宝接口的session} session
* @returns {isVip: boolean(是否是会员), url: string(入会链接) }
*/
getShopVip(session: string, callbackUrl?: string): Promise<IVipInfo>;
/**
* 初始化用户数据
*
* @param {IVipInfo} vipInfo
* @param {IActivityInfo} activityInfo
* @returns
* @memberof UserService
*/
initUserData(vipInfo: IVipInfo, activityInfo: IActivityInfo): Promise<any>;
updateUserData(vipInfo: IVipInfo, userInfo: IUserInfo): Promise<void>;
/**
* @desc 更新用户表
* @param {用户的主键id} _id
* @param {更新的对象} document
* @returns 若更新成功,返回为1; 若更新失败,返回为 0 或系统直接报错
*/
updateUser(_id: string, projection: object): Promise<any>;
/**
* @desc 根据用户主键id查找用户详情
* @param {用户的主键id} _id
* @returns 若用户不存在,返回null; 用户存在,返回用户信息(object对象)
*/
getUserInfoById(_id: string): Promise<any>;
/**
*判断是否新会员
*
* @param {IUserInfo} userInfo
* @param {IVipInfo} vipInfo
* @returns {boolean}
* @memberof UserService
*/
checkNewVipStatus(userInfo: IUserInfo, vipInfo: IVipInfo): boolean;
}
export default UserService;
This diff is collapsed.
{"version":3,"file":"user.service.js","sourceRoot":"","sources":["../../src/service/user.service.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,8BAAwC;AACxC,+CAAwC;AACxC,4BAAoC;AACpC,kCAAmC;AACnC,oCAAqC;AAErC;IAA0B,+BAAW;IAEnC,qBAAY,OAAgB;QAA5B,YACE,kBAAM,OAAO,CAAC,SAEf;QADC,KAAI,CAAC,OAAO,GAAG,IAAI,aAAO,CAAC,OAAO,EAAE,iBAAY,CAAC,CAAA;;IACnD,CAAC;IACD;;;OAGG;IACG,iCAAW,GAAjB;;;;;;wBACM,KAAmB,IAAI,CAAC,OAAO,EAA7B,MAAM,YAAA,EAAE,IAAI,UAAA,CAAiB;wBAC7B,UAAU,GAAK,IAAI,WAAT,CAAS;wBACZ,qBAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,QAAA,EAAE,UAAU,YAAA,EAAE,CAAC,EAAA;;wBAA3D,MAAM,GAAG,SAAkD;wBAC/D,sBAAO,MAAM,EAAA;;;;KACd;IAED;;;;;OAKG;IACG,yCAAmB,GAAzB,UAA0B,QAAgB;;;;;;wBAClC,UAAU,GAAK,IAAI,CAAC,OAAO,CAAC,IAAI,WAAtB,CAAsB;wBACzB,qBAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,M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AM,EAAE,QAAQ,CAAC,MAAM;oCACvB,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC;oCACxB,MAAM,EAAE,QAAQ,CAAC,MAAM;iCACxB;6BACF,CAAC,EAAA;;wBANF,SAME,CAAA;;;;;KACH;IAED;;;;;OAKG;IACG,gCAAU,GAAhB,UAAiB,GAAW,EAAE,UAAkB;;;;;wBAC9C,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;wBACvB,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE;4BACtB,UAAU,CAAC,MAAM,CAAC,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;yBAC3C;wBACM,qBAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,GAAG,KAAA,EAAE,EAAE,UAAU,CAAC,EAAA;4BAArD,sBAAO,SAA8C,EAAA;;;;KACtD;IACD;;;;OAIG;IACG,qCAAe,GAArB,UAAsB,GAAW;;;;4BACxB,qBAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,GAAG,KAAA,EAAE,CAAC,EAAA;4BAA1C,sBAAO,SAAmC,EAAA;;;;KAC3C;IAED;;;;;;;OAOG;IACH,uCAAiB,GAAjB,UAAkB,QAAmB,EAAE,OAAiB;QAE1C,IAAA,IAAI,GACZ,QAAQ,YADI,CACJ;QAEJ,IAAA,KAAK,GAAK,OAAO,MAAZ,CAAY;QAEzB,OAAO,CAAC,IAAI,IAAI,KAAK,CAAA;IACvB,CAAC;IACH,kBAAC;AAAD,CAAC,AA9LD,CAA0B,sBAAW,GA8LpC;AAED,kBAAe,WAAW,CAAA"}
\ No newline at end of file
/** @format */
export declare const exportHandlers: (controllers: any[]) => {};
"use strict";
/** @format */
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.exportHandlers = void 0;
exports.exportHandlers = function (controllers) {
var handlersMapper = controllers
.map(function (controller) {
var controllerInstance = new controller();
var handlersKeys = Object.getOwnPropertyNames(Object.getPrototypeOf(controllerInstance)).filter(function (v) { return v !== 'constructor'; });
return handlersKeys.reduce(function (prev, current) {
var _a;
return __assign(__assign({}, prev), (_a = {}, _a[current] = controllerInstance[current], _a));
}, {});
})
.reduce(function (prev, current) {
return __assign(__assign({}, current), prev);
}, {});
return handlersMapper;
};
//# sourceMappingURL=exportHandlers.js.map
\ No newline at end of file
{"version":3,"file":"exportHandlers.js","sourceRoot":"","sources":["../../src/utils/exportHandlers.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;AAED,QAAA,cAAc,GAAG,UAAC,WAAkB;IAC/C,IAAM,cAAc,GAAG,WAAW;SAC/B,GAAG,CAAC,UAAA,UAAU;QACb,IAAM,kBAAkB,GAAG,IAAI,UAAU,EAAE,CAAA;QAC3C,IAAM,YAAY,GAAG,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAC/F,UAAA,CAAC,IAAI,OAAA,CAAC,KAAK,aAAa,EAAnB,CAAmB,CACzB,CAAA;QACD,OAAO,YAAY,CAAC,MAAM,CAAC,UAAC,IAAI,EAAE,OAAO;;YACvC,6BACK,IAAI,gBACN,OAAO,IAAG,kBAAkB,CAAC,OAAO,CAAC,OACvC;QACH,CAAC,EAAE,EAAE,CAAC,CAAA;IACR,CAAC,CAAC;SACD,MAAM,CAAC,UAAC,IAAI,EAAE,OAAO;QACpB,6BACK,OAAO,GACP,IAAI,EACR;IACH,CAAC,EAAE,EAAE,CAAC,CAAA;IACR,OAAO,cAAc,CAAA;AACvB,CAAC,CAAA"}
\ No newline at end of file
/** @format */
export declare const getToday: () => string;
"use strict";
/** @format */
Object.defineProperty(exports, "__esModule", { value: true });
exports.getToday = void 0;
var sdk_1 = require("../sdk");
// 获取今天的时间
exports.getToday = function () {
console.log(sdk_1.transformBeijingDate(Date.now()));
return sdk_1.dateFormatter(sdk_1.transformBeijingDate(Date.now()), 'yyyy/MM/dd');
};
//# sourceMappingURL=getToday.js.map
\ No newline at end of file
{"version":3,"file":"getToday.js","sourceRoot":"","sources":["../../src/utils/getToday.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAEd,8BAA4D;AAE5D,UAAU;AACG,QAAA,QAAQ,GAAG;IACtB,OAAO,CAAC,GAAG,CAAC,0BAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;IAC7C,OAAO,mBAAa,CAAC,0BAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,YAAY,CAAC,CAAA;AACtE,CAAC,CAAA"}
\ No newline at end of file
/** @format */
export * from './logger';
export * from './getToday';
export * from './exportHandlers';
"use strict";
/** @format */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./logger"), exports);
__exportStar(require("./getToday"), exports);
__exportStar(require("./exportHandlers"), exports);
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;AAGd,2CAAwB;AACxB,6CAA0B;AAC1B,mDAAgC"}
\ No newline at end of file
export declare const logger: (context: Context) => void;
export declare const recordErrorLog: (context: Context, baseInfos: IControllerInfos, errorMsg: string, stack: string) => Promise<any>;
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.recordErrorLog = exports.logger = void 0;
/** @format */
var sdk_1 = require("../sdk");
var db_1 = require("../db");
var utils_1 = require("../utils");
exports.logger = function (context) {
var _a, _b, _c;
var data = JSON.stringify(context.data);
console.log(context);
console.log("---------\u51FD\u6570: " + (context.fcName || '') + "." + (((_c = (_b = (_a = context === null || context === void 0 ? void 0 : context.cloud) === null || _a === void 0 ? void 0 : _a.dataspace) === null || _b === void 0 ? void 0 : _b.context) === null || _c === void 0 ? void 0 : _c.handler) || context.handler) + "------------");
console.log("---------\u8BF7\u6C42\u53C2\u6570: " + data + "------------");
};
// 记录错误日志
exports.recordErrorLog = function (context, baseInfos, errorMsg, stack) { return __awaiter(void 0, void 0, void 0, function () {
var openId, activityId, userInfo, userNick, logdao, functionName;
var _a, _b, _c;
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
openId = context.openId;
activityId = (context.data || {}).activityId;
userInfo = baseInfos.userInfo;
userNick = (userInfo || {}).userNick;
logdao = new sdk_1.BaseDao(context, db_1.ERROR_LOG_DB_NAME);
functionName = (context.fcName || '') + "." + (((_c = (_b = (_a = context === null || context === void 0 ? void 0 : context.cloud) === null || _a === void 0 ? void 0 : _a.dataspace) === null || _b === void 0 ? void 0 : _b.context) === null || _c === void 0 ? void 0 : _c.handler) || context.handler);
return [4 /*yield*/, logdao.insertOne({
openId: openId,
activityId: activityId,
errorMsg: errorMsg,
errorStack: stack,
functionName: functionName,
userNick: userNick,
fcInvokeId: context.fcInvokeId,
params: context.data,
createTime: Date.now(),
createDay: utils_1.getToday(),
catchType: 1
})];
case 1: return [2 /*return*/, _d.sent()];
}
});
}); };
//# sourceMappingURL=logger.js.map
\ No newline at end of file
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd,8BAAgC;AAChC,4BAAyC;AACzC,kCAAmC;AAEtB,QAAA,MAAM,GAAG,UAAC,OAAgB;;IACrC,IAAM,IAAI,GAAG,IAA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AE;wBACtB,SAAS,EAAE,gBAAQ,EAAE;wBACrB,SAAS,EAAE,CAAC;qBACb,CAAC,EAAA;oBAZF,sBAAO,SAYL,EAAA;;;KACH,CAAA"}
\ No newline at end of file
/** @format */
export declare const exportHandlers: (controllers: any[]) => {};
"use strict";
/** @format */
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.exportHandlers = void 0;
exports.exportHandlers = function (controllers) {
var handlersMapper = controllers
.map(function (controller) {
var controllerInstance = new controller();
var handlersKeys = Object.getOwnPropertyNames(Object.getPrototypeOf(controllerInstance)).filter(function (v) { return v !== 'constructor'; });
return handlersKeys.reduce(function (prev, current) {
var _a;
return __assign(__assign({}, prev), (_a = {}, _a[current] = controllerInstance[current], _a));
}, {});
})
.reduce(function (prev, current) {
return __assign(__assign({}, current), prev);
}, {});
return handlersMapper;
};
//# sourceMappingURL=exportHandlers.js.map
\ No newline at end of file
{"version":3,"file":"exportHandlers.js","sourceRoot":"","sources":["../../../src/utils/package/exportHandlers.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;AAED,QAAA,cAAc,GAAG,UAAC,WAAkB;IAC/C,IAAM,cAAc,GAAG,WAAW;SAC/B,GAAG,CAAC,UAAA,UAAU;QACb,IAAM,kBAAkB,GAAG,IAAI,UAAU,EAAE,CAAA;QAC3C,IAAM,YAAY,GAAG,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAC/F,UAAA,CAAC,IAAI,OAAA,CAAC,KAAK,aAAa,EAAnB,CAAmB,CACzB,CAAA;QACD,OAAO,YAAY,CAAC,MAAM,CAAC,UAAC,IAAI,EAAE,OAAO;;YACvC,6BACK,IAAI,gBACN,OAAO,IAAG,kBAAkB,CAAC,OAAO,CAAC,OACvC;QACH,CAAC,EAAE,EAAE,CAAC,CAAA;IACR,CAAC,CAAC;SACD,MAAM,CAAC,UAAC,IAAI,EAAE,OAAO;QACpB,6BACK,OAAO,GACP,IAAI,EACR;IACH,CAAC,EAAE,EAAE,CAAC,CAAA;IACR,OAAO,cAAc,CAAA;AACvB,CAAC,CAAA"}
\ No newline at end of file
/**
* 获取商家session
*
* @format
*/
export declare const getSellerSession: (context: Context, activityId?: string) => Promise<{
session?: undefined;
} | {
session: any;
}>;
"use strict";
/**
* 获取商家session
*
* @format
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSellerSession = void 0;
var db_1 = require("../../db");
var sdk_1 = require("../../sdk");
exports.getSellerSession = function (context, activityId) { return __awaiter(void 0, void 0, void 0, function () {
var activitydao, sellerdao, activityConfigResult, result;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!activityId) {
activityId = context.data.activityId;
}
activitydao = new sdk_1.BaseDao(context, db_1.ACTIVITY_CONFIG_DB_NAME);
sellerdao = new sdk_1.BaseDao(context, db_1.SELLER_INFO_DB_NAME);
return [4 /*yield*/, activitydao.find({ _id: activityId })];
case 1:
activityConfigResult = _a.sent();
if (!activityConfigResult || !activityConfigResult[0])
return [2 /*return*/, {}];
return [4 /*yield*/, sellerdao.find({
openId: activityConfigResult[0].openId
})
// console.log(`getSellerSession`, result)
];
case 2:
result = _a.sent();
// console.log(`getSellerSession`, result)
if (!result || !result[0])
return [2 /*return*/, {}];
return [2 /*return*/, {
session: result[0].accessToken
}];
}
});
}); };
//# sourceMappingURL=getSession.js.map
\ No newline at end of file
{"version":3,"file":"getSession.js","sourceRoot":"","sources":["../../../src/utils/package/getSession.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+BAAuE;AAEvE,iCAAmC;AAEtB,QAAA,gBAAgB,GAAG,UAAO,OAAgB,EAAE,UAAmB;;;;;gBAC1E,IAAI,CAAC,UAAU,EAAE;oBACf,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAA;iBACrC;gBACG,WAAW,GAAG,IAAI,aAAO,CAAC,OAAO,EAAE,4BAAuB,CAAC,CAAA;gBAC3D,SAAS,GAAG,IAAI,aAAO,CAAC,OAAO,EAAE,wBAAmB,CAAC,CAAA;gBAC9B,qBAAM,WAAW,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,EAAA;;gBAAlE,oBAAoB,GAAG,SAA2C;gBACtE,IAAI,CAAC,oBAAoB,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;oBAAE,sBAAO,EAAE,EAAA;gBAEnD,qBAAM,SAAS,CAAC,IAAI,CAAC;wBAChC,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC,MAAM;qBACvC,CAAC;oBACF,2CAA2C;kBADzC;;gBAFE,MAAM,GAAG,SAEX;gBACF,2CAA2C;gBAC3C,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;oBAAE,sBAAO,EAAE,EAAA;gBACpC,sBAAO;wBACL,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW;qBAC/B,EAAA;;;KACF,CAAA"}
\ No newline at end of file
/** @format */
export declare const getToday: () => string;
"use strict";
/** @format */
Object.defineProperty(exports, "__esModule", { value: true });
exports.getToday = void 0;
var sdk_1 = require("../../sdk");
// 获取今天的时间
exports.getToday = function () {
console.log(sdk_1.transformBeijingDate(Date.now()));
return sdk_1.dateFormatter(sdk_1.transformBeijingDate(Date.now()), 'yyyy/MM/dd');
};
//# sourceMappingURL=getToday.js.map
\ No newline at end of file
{"version":3,"file":"getToday.js","sourceRoot":"","sources":["../../../src/utils/package/getToday.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAEd,iCAA+D;AAE/D,UAAU;AACG,QAAA,QAAQ,GAAG;IACtB,OAAO,CAAC,GAAG,CAAC,0BAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;IAC7C,OAAO,mBAAa,CAAC,0BAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,YAAY,CAAC,CAAA;AACtE,CAAC,CAAA"}
\ No newline at end of file
/**
* 用户购买记录查询
*
* @format
*/
export declare const getUserOrderlist: (context: any, queryStartTime: any, queryEndTime?: any, session?: string) => Promise<any[]>;
"use strict";
/**
* 用户购买记录查询
*
* @format
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getUserOrderlist = void 0;
var dayjs = require("dayjs");
var sdk_1 = require("../../sdk");
var getSession_1 = require("./getSession");
var constants_1 = require("../../constants");
exports.getUserOrderlist = function (context, queryStartTime, queryEndTime, session) { return __awaiter(void 0, void 0, void 0, function () {
var results_1, currentTime, lastUpdateTime, params, orderResult, trade, e_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 4, , 5]);
results_1 = [];
currentTime = Date.now();
lastUpdateTime = dayjs().add(-3, 'month').valueOf();
console.log("lastUpdateTime", lastUpdateTime);
// 若倒推的3个月时间小于传入的查询开始时间, 则以查询开始时间作为最后更新时间
if (lastUpdateTime < queryStartTime) {
lastUpdateTime = queryStartTime;
}
if (!!session) return [3 /*break*/, 2];
return [4 /*yield*/, getSession_1.getSellerSession(context)];
case 1:
session = (_a.sent()).session;
_a.label = 2;
case 2:
params = {
startTime: sdk_1.dateFormatter(sdk_1.transformBeijingDate(lastUpdateTime)),
endTime: sdk_1.dateFormatter(sdk_1.transformBeijingDate(queryEndTime || currentTime)),
openId: context.openId,
session: session
};
return [4 /*yield*/, sdk_1.TBAPIS.getBuyerOrderList(context, params)];
case 3:
orderResult = _a.sent();
if (orderResult.total_results > 0) {
trade = orderResult.trades.trade;
trade.forEach(function (i) {
if (constants_1.TAOBAO_SUCCESS_ORDER_STATUS.includes(i.status)) {
i.orders.order.forEach(function (s) {
results_1.push({
payTime: i.pay_time,
itemId: s.num_iid,
time: i.created,
price: s.price,
orderId: s.oid,
img: s.pic_path,
title: s.title
});
});
}
});
}
console.log("\u5DF2\u652F\u4ED8\u7684\u8BA2\u5355\u5217\u8868", results_1);
return [2 /*return*/, results_1];
case 4:
e_1 = _a.sent();
console.log("\u9519\u8BEF", e_1);
return [2 /*return*/, []];
case 5: return [2 /*return*/];
}
});
}); };
//# sourceMappingURL=getUserOrderlist.js.map
\ No newline at end of file
{"version":3,"file":"getUserOrderlist.js","sourceRoot":"","sources":["../../../src/utils/package/getUserOrderlist.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6BAA8B;AAC9B,iCAAuE;AACvE,2CAA+C;AAC/C,6CAA6D;AAEhD,QAAA,gBAAgB,GAAG,UAAO,OAAO,EAAE,cAAc,EAAE,YAAa,EAAE,OAAgB;;;;;;gBAEvF,YAAU,EAAE,CAAA;gBACZ,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;gBAExB,cAAc,GAAG,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,CAAA;gBACvD,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAA;gBAC7C,yCAAyC;gBACzC,IAAI,cAAc,GAAG,cAAc,EAAE;oBACnC,cAAc,GAAG,cAAc,CAAA;iBAChC;qBACG,CAAC,OAAO,EAAR,wBAAQ;gBACC,qBAAM,6BAAgB,CAAC,OAAO,CAAC,EAAA;;gBAA1C,OAAO,GAAG,CAAC,SAA+B,CAAC,CAAC,OAAO,CAAA;;;gBAGjD,MAAM,GAAG;oBACX,SAAS,EAAE,mBAAa,CAAC,0BAAoB,CAAC,cAAc,CAAC,CAAC;oBAC9D,OAAO,EAAE,mBAAa,CAAC,0BAAoB,CAAC,YAAY,IAAI,WAAW,CAAC,CAAC;oBACzE,MAAM,EAAE,OAAO,CAAC,MAAM;oBACtB,OAAO,SAAA;iBACR,CAAA;gBACiB,qBAAM,YAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,EAAA;;gBAA7D,WAAW,GAAG,SAA+C;gBACjE,IAAI,WAAW,CAAC,aAAa,GAAG,CAAC,EAAE;oBACzB,KAAK,GAAK,WAAW,CAAC,MAAM,MAAvB,CAAuB;oBACpC,KAAK,CAAC,OAAO,CAAC,UAAA,CAAC;wBACb,IAAI,uCAA2B,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE;4BAClD,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,CAAC;gCACtB,SAAO,CAAC,IAAI,CAAC;oCACX,OAAO,EAAE,CAAC,CAAC,QAAQ;oCACnB,MAAM,EAAE,CAAC,CAAC,OAAO;oCACjB,IAAI,EAAE,CAAC,CAAC,OAAO;oCACf,KAAK,EAAE,CAAC,CAAC,KAAK;oCACd,OAAO,EAAE,CAAC,CAAC,GAAG;oCACd,GAAG,EAAE,CAAC,CAAC,QAAQ;oCACf,KAAK,EAAE,CAAC,CAAC,KAAK;iCACf,CAAC,CAAA;4BACJ,CAAC,CAAC,CAAA;yBACH;oBACH,CAAC,CAAC,CAAA;iBACH;gBACD,OAAO,CAAC,GAAG,CAAC,kDAAU,EAAE,SAAO,CAAC,CAAA;gBAChC,sBAAO,SAAO,EAAA;;;gBAEd,OAAO,CAAC,GAAG,CAAC,cAAI,EAAE,GAAC,CAAC,CAAA;gBACpB,sBAAO,EAAE,EAAA;;;;KAEZ,CAAA"}
\ No newline at end of file
/** @format */
/**
* 并发更新
* @param {接收数组或对象} daoqueryArr : [{dao: userdao, query:{id:_id}}, {dao: activityprizedao, query: {id:_id}}]
* @param {*} fn
* @param {*} times
*/
export declare const lockUpdate: (daoqueryArr: any, fn: any, times?: number) => Promise<any>;
/**
* 调用示例
*/
"use strict";
/** @format */
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.lockUpdate = void 0;
var constants_1 = require("../../constants");
/**
* 并发更新
* @param {接收数组或对象} daoqueryArr : [{dao: userdao, query:{id:_id}}, {dao: activityprizedao, query: {id:_id}}]
* @param {*} fn
* @param {*} times
*/
exports.lockUpdate = function (daoqueryArr, fn, times) {
if (times === void 0) { times = 5; }
return __awaiter(void 0, void 0, void 0, function () {
function waitFor(ms) {
return new Promise(function (resolve) {
setTimeout(resolve, ms);
});
}
var time, success, _loop_1, state_1, e_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (typeof daoqueryArr !== 'object' && !Array.isArray(daoqueryArr)) {
console.log("lockUpdate \u53C2\u6570\u9519\u8BEF");
return [2 /*return*/, false];
}
if (typeof daoqueryArr === 'object') {
daoqueryArr = [daoqueryArr];
}
time = 0;
console.log("\u8FDB\u5165update\u5E76\u53D1\u5904\u7406\u6B21\u6570", times);
success = false;
_a.label = 1;
case 1:
_a.trys.push([1, 5, , 6]);
_loop_1 = function () {
var updateRes, ret;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
updateRes = [];
daoqueryArr.forEach(function (daoquery) { return __awaiter(void 0, void 0, void 0, function () {
var canupdate;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, daoquery.dao.update(daoquery.query, { $set: { lockStatus: 2 } })];
case 1:
canupdate = _a.sent();
updateRes.push(canupdate);
return [2 /*return*/];
}
});
}); });
if (!!daoqueryArr.includes(0)) return [3 /*break*/, 2];
return [4 /*yield*/, fn()];
case 1:
ret = _a.sent();
daoqueryArr.forEach(function (daoquery) { return __awaiter(void 0, void 0, void 0, function () {
var ures;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, daoquery.dao.update(daoquery.query, { $set: { lockStatus: 1 } })];
case 1:
ures = _a.sent();
console.log("\u66F4\u65B0lockStatus\u4E3A0", ures);
return [2 /*return*/];
}
});
}); });
success = true;
return [2 /*return*/, { value: ret }];
case 2:
console.log("\u8FDB\u5165waitFor\u4E86\uFF0C\u9700\u7B49\u5F8530ms");
return [4 /*yield*/, waitFor(30)];
case 3:
_a.sent();
success = false;
_a.label = 4;
case 4: return [2 /*return*/];
}
});
};
_a.label = 2;
case 2:
if (!(time++ < times && !success)) return [3 /*break*/, 4];
return [5 /*yield**/, _loop_1()];
case 3:
state_1 = _a.sent();
if (typeof state_1 === "object")
return [2 /*return*/, state_1.value];
return [3 /*break*/, 2];
case 4: return [3 /*break*/, 6];
case 5:
e_1 = _a.sent();
console.log(e_1);
daoqueryArr.forEach(function (daoquery) { return __awaiter(void 0, void 0, void 0, function () {
var ures;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, daoquery.dao.update(daoquery.query, { $set: { lockStatus: 1 } })];
case 1:
ures = _a.sent();
console.log("\u66F4\u65B0lockStatus\u4E3A0", ures);
return [2 /*return*/];
}
});
}); });
success = false;
return [3 /*break*/, 6];
case 6:
// 稍后重试
if (!success) {
daoqueryArr.forEach(function (daoquery) { return __awaiter(void 0, void 0, void 0, function () {
var ures;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, daoquery.dao.update(daoquery.query, { $set: { lockStatus: 1 } })];
case 1:
ures = _a.sent();
console.log("\u64CD\u4F5C" + times + "\u6B21\u540E\u66F4\u65B0lockStatus\u4E3A0", ures);
return [2 /*return*/];
}
});
}); });
return [2 /*return*/, constants_1.CODE_TYPES.ERROR_UPDATE_RETRY];
}
return [2 /*return*/];
}
});
});
};
/**
* 调用示例
*/
// 扣库存
// let res = await lockUpdate({dao: this.activityprizedao, query: {_id}}, async ()=> {
// return await this.activityprizedao.update({_id}, {$set: {
// useStock: useStock + 1,
// updateTime: Date.now()
// }});
// });
// console.log(res);
// if (!res) {
// return CODE_TYPES.ERROR_UPDATE_RETRY;
// }
// return true;
//# sourceMappingURL=lockUpdate.js.map
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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