Commit 3799c78c authored by qinhaitao's avatar qinhaitao

fix: 🐛 dist 删除

parent ec34f1e4
/** @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
};
var getConfig = function (context) {
var env = context.env;
return configs[env] || configs.online;
};
exports.getConfig = getConfig;
//# 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;AAEM,IAAM,SAAS,GAAG,UAAC,OAAgB;IACxC,IAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;IACvB,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,MAAM,CAAA;AACvC,CAAC,CAAA;AAHY,QAAA,SAAS,aAGrB"}
\ 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 OPEN_PRIZE_STATUS: {
WAIT_AWARD: number;
PROCESSING: number;
SUCCESS: number;
FAIL: number;
};
export declare const DRAW_STATUS: {
WAITAWARD: number;
PROCESSING: number;
SUCCESS: number;
FAIL: number;
EXPIRED: number;
RETRY: number;
};
export declare const LOGGER_TYPE: {
ERROR: number;
INFO: number;
};
export declare const PRIZE_TYPE: {
EQUITY: number;
CREDITS: number;
OBJECT: number;
THANK: number;
};
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 errorCode: {
'000000': string;
'000001': string;
'000002': string;
'000003': string;
'000004': string;
'000005': string;
'000006': string;
'000007': string;
'000008': string;
'000010': string;
'000011': string;
'000012': string;
'000013': string;
'000014': string;
'000015': string;
'000016': string;
'000017': string;
'000020': string;
'000021': string;
'000022': string;
'000023': string;
'000024': string;
'000025': string;
'000026': string;
'000027': string;
'000030': string;
'000031': string;
};
export declare const B_APP_NAME: string;
export declare const GOODSINFO = "detail_url,approve_status,num_iid,title,nick,type,cid,pic_url,num,props,valid_thru,list_time,price,has_discount,has_invoice,has_warranty,has_showcase,modified,delist_time,postage_id,seller_cids,outer_id,sold_quantity";
export declare const EIGHT_HOURS: number;
export declare const SEVEN_DAYS: number;
export declare const _48_HOURS: number;
export declare const DELETE_STATUS: {
EXIST: number;
DELETE: number;
};
export declare const TASK_TYPE_TEXT: {
member: string;
follow: string;
sign: string;
exchangeCredits: string;
invites: string;
orderGoods: string;
browseGoods: string;
jumpLink: string;
collectGoods: string;
};
export declare const TASK_CHECK_TYPE: {
value: {
list: string[];
reg: RegExp;
regName: string;
};
times: {
list: string[];
};
title: {
list: string[];
};
itemIds: {
list: string[];
};
taskRateType: {
list: string[];
};
link: {
list: string[];
};
};
export declare const PASS_URL_LIST: string[];
export declare const APP_SUB_CODE: string;
export declare const TEMPLATE_INFO: {
clients: string;
template_id: number;
template_version: string;
};
export declare const SHIP_STATUS: {
NO_ADDRESS: number;
NO_SHIP: number;
HAS_SHIP: number;
};
export declare const STOCK_TYPE: {
LIMIT: number;
NO_LIMIT: number;
};
"use strict";
/** @format */
Object.defineProperty(exports, "__esModule", { value: true });
exports.STOCK_TYPE = exports.SHIP_STATUS = exports.TEMPLATE_INFO = exports.APP_SUB_CODE = exports.PASS_URL_LIST = exports.TASK_CHECK_TYPE = exports.TASK_TYPE_TEXT = exports.DELETE_STATUS = exports._48_HOURS = exports.SEVEN_DAYS = exports.EIGHT_HOURS = exports.GOODSINFO = exports.B_APP_NAME = exports.errorCode = exports.CODE_TYPES = exports.PRIZE_TYPE = exports.LOGGER_TYPE = exports.DRAW_STATUS = exports.OPEN_PRIZE_STATUS = 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.OPEN_PRIZE_STATUS = {
// 待开奖
WAIT_AWARD: 1,
// 开奖中
PROCESSING: 2,
// 开奖成功
SUCCESS: 3,
// 开奖失败
FAIL: 4
};
// 领取奖品状态
exports.DRAW_STATUS = {
// 待领取
WAITAWARD: 1,
// 处理中
PROCESSING: 2,
// 领取成功
SUCCESS: 3,
// 领取失败
FAIL: 4,
// 已过期
EXPIRED: 5,
// 重新领取
RETRY: 6
};
// 日志类型: error,info
exports.LOGGER_TYPE = {
ERROR: 1,
INFO: 2
};
exports.PRIZE_TYPE = {
EQUITY: 1,
CREDITS: 2,
OBJECT: 3,
THANK: 5
};
exports.CODE_TYPES = Object.assign({}, sdk_1.DEFAULT_CODE_TYPES, exports.BusinessError);
exports.errorCode = {
'000000': 'ok',
'000001': '请填写活动名称',
'000002': '请填写活动副标题',
'000003': '活动名称不得大于12个字符',
'000004': '活动副标题不得大于16个字符',
'000005': '任务配置至少选择一项',
'000006': '浏览链接配置错误',
'000007': '奖品至少配置三名',
'000008': '浏览宝贝最多选择20个商品',
'000010': '请先生成规则',
'000011': '请配置活动时间',
'000012': '新建活动开始时间需小于当前时间',
'000013': '开始时间不得大于结束时间',
'000014': '奖品最多配置8个档位',
'000015': '查询列表错误',
'000016': '查询列表总数错误',
'000017': '更新奖品列表出错',
'000020': '删除活动失败',
'000021': '保存活动失败',
'000022': '删除活动id不存在',
'000023': '当前活动不存在',
'000024': '获取授权信息失败',
'000025': '保存授权信息失败',
'000026': '获取商家在售列表失败',
'000027': '获取商家ids列表失败',
'000030': '获取ename商品信息失败',
'000031': '奖品配置不正确'
};
// B端的APP NAME
exports.B_APP_NAME = 'promotioncenter-<%=bizCode%>';
exports.GOODSINFO = 'detail_url,approve_status,num_iid,title,nick,type,cid,pic_url,num,props,valid_thru,list_time,price,has_discount,has_invoice,has_warranty,has_showcase,modified,delist_time,postage_id,seller_cids,outer_id,sold_quantity';
exports.EIGHT_HOURS = 60 * 60 * 8 * 1000;
exports.SEVEN_DAYS = 7 * 24 * 60 * 60 * 1000;
exports._48_HOURS = 48 * 60 * 60 * 1000;
exports.DELETE_STATUS = {
EXIST: 1,
DELETE: 2
};
exports.TASK_TYPE_TEXT = {
member: '成为会员',
follow: '关注店铺',
sign: '签到',
exchangeCredits: '兑换积分',
invites: '邀请好友',
orderGoods: '下单商品',
browseGoods: '浏览商品',
jumpLink: '跳转链接',
collectGoods: '收藏商品'
};
exports.TASK_CHECK_TYPE = {
value: {
list: ['member', 'follow', 'sign', 'exchangeCredits', 'invites', 'orderGoods', 'jumpLink', 'collectGoods'],
reg: /[1-99]/,
regName: '1-99之内'
},
times: {
list: ['exchangeCredits', 'invites', 'orderGoods', 'browseGoods', 'jumpLink', 'collectGoods']
},
title: {
list: ['invites', 'orderGoods', 'browseGoods', 'jumpLink', 'collectGoods']
},
itemIds: {
list: ['orderGoods', 'browseGoods', 'collectGoods']
},
taskRateType: {
list: ['invites', 'orderGoods', 'browseGoods', 'collectGoods']
},
link: { list: ['jumpLink'] }
};
exports.PASS_URL_LIST = [
'1688.cn',
'1688.com',
'alibaba.cn',
'alibaba.com',
'aliexpress.com',
'alimama.cn',
'alimama.com',
'alipay.com.cn',
'alipay.com',
'alipay.net',
'aliplay.com',
'alisoft.cn',
'alisoft.com',
'aliyun.com',
'aliyun.net',
'koubei.cn',
'koubei.com',
'taobao.cn',
'taobao.com',
'taobao.net',
'tb.cn',
'tmall.com',
'zhifu.com',
'zhifubao.com',
'juhuasuan.com',
'tmall.hk',
'tmall.com.hk',
'jiyoujia.com',
'pailitao.com',
'cainiao.com',
'dingtalk.com',
'yushanfang.com',
'guoguo-app.com',
'alihealth.cn',
'miaostreet.com',
'uc123.com',
'uc.cn',
'ucweb.com',
'aliyun-inc.com',
'cainiaoyizhan.com',
'umeng.com',
'aliplus.com',
'aliplay.com',
'taopiaopiao.com',
'youku.com',
'tudou.com',
'xinlingshou.cn',
'fliggy.com',
'feizhu.com',
'feizhu.cn'
];
//saas订购码 根据需求改变
exports.APP_SUB_CODE = 'FW_GOODS-1001086450';
exports.TEMPLATE_INFO = {
clients: 'taobao,tmall',
template_id: 3000000002590532,
template_version: '0.0.3'
};
//物流状态
exports.SHIP_STATUS = {
NO_ADDRESS: 1,
NO_SHIP: 2,
HAS_SHIP: 3
};
exports.STOCK_TYPE = {
LIMIT: 1,
NO_LIMIT: 2
};
//# 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;IAC3B,iBAAiB;IACjB,kBAAkB,EAAE;QAClB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,0BAAM;KACnB;IACD,QAAQ;IACR,iBAAiB,EAAE;QACjB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,gCAAO;KACpB;IACD,QAAQ;IACR,sBAAsB,EAAE;QACtB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,gCAAO;KACpB;IACD,QAAQ;IACR,mBAAmB,EAAE;QACnB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,gCAAO;KACpB;IACD,QAAQ;IACR,aAAa,EAAE;QACb,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,gCAAO;KACpB;IACD,cAAc;IACd,uBAAuB,EAAE;QACvB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,aAAa;KAC1B;IACD,QAAQ;IACR,YAAY,EAAE;QACZ,IAAI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YAAY,EAAE,aAAa,EAAE,cAAc,CAAC;KAC/D;IACD,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE;CAC7B,CAAA;AAEY,QAAA,aAAa,GAAa;IACrC,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,gBAAgB;IAChB,YAAY;IACZ,aAAa;IACb,eAAe;IACf,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,OAAO;IACP,WAAW;IACX,WAAW;IACX,cAAc;IACd,eAAe;IACf,UAAU;IACV,cAAc;IACd,cAAc;IACd,cAAc;IACd,aAAa;IACb,cAAc;IACd,gBAAgB;IAChB,gBAAgB;IAChB,cAAc;IACd,gBAAgB;IAChB,WAAW;IACX,OAAO;IACP,WAAW;IACX,gBAAgB;IAChB,mBAAmB;IACnB,WAAW;IACX,aAAa;IACb,aAAa;IACb,iBAAiB;IACjB,WAAW;IACX,WAAW;IACX,gBAAgB;IAChB,YAAY;IACZ,YAAY;IACZ,WAAW;CACZ,CAAA;AAED,gBAAgB;AACH,QAAA,YAAY,GAAW,qBAAqB,CAAA;AAE5C,QAAA,aAAa,GAAG;IAC3B,OAAO,EAAE,cAAc;IACvB,WAAW,EAAE,gBAAgB;IAC7B,gBAAgB,EAAE,OAAO;CAC1B,CAAA;AAED,MAAM;AACO,QAAA,WAAW,GAAG;IACzB,UAAU,EAAE,CAAC;IACb,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,CAAC;CACZ,CAAA;AAEY,QAAA,UAAU,GAAG;IACxB,KAAK,EAAE,CAAC;IACR,QAAQ,EAAC,CAAC;CACX,CAAA"}
\ No newline at end of file
/** @format */
import { ActivityconfigService } from '../service';
export default class ActivityController {
/**
* 活动基本信息
*/
getActivityList(context: Context, {}: {}, [activityconfigService]: [ActivityconfigService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<{
list: any;
total: any;
pageSize: number;
pageNo: number;
}, true>>;
/**
* 活动详情
*/
getActivityDetail(context: Context, {}: {}, [activityconfigService]: [ActivityconfigService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, true>>;
/**
* 删除活动
*/
delActivity(context: Context, {}: {}, [activityconfigService]: [ActivityconfigService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<false, true> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<true, true>>;
/**
* 复制活动
*/
createCopyActivity(context: Context, {}: {}, [activityconfigService]: [ActivityconfigService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, true>>;
}
This diff is collapsed.
{"version":3,"file":"activity.controller.js","sourceRoot":"","sources":["../../src/controller/activity.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,4CAAoE;AACpE,0CAAoD;AACpD,8BAAqC;AACrC,sCAAkD;AAElD;IAAA;IAwGA,CAAC;IAvGC;;OAEG;IAEG,4CAAe,GAArB,UAAsB,OAAgB,EAAE,EAAE,EAAE,EAAgD;YAA/C,qBAAqB,QAAA;;;;;;wBACxD,MAAM,GAAK,OAAO,OAAZ,CAAY;wBAEb,qBAAM,qBAAqB,CAAC,uBAAuB,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,EAAA;;wBAAlF,MAAM,GAAG,SAAyE;wBACtF,IAAI,MAAM,EAAE;4BACV,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,UAAC,IAAqB;gCAClD,6BACK,IAA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,CAAC,CAAC;wBACf,sBAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,YAAY,EAAE,QAAQ,CAAC,EAAA;;;;;KAE/D;IAlGD;QADC,oBAAQ,CAAC,CAAC,+BAAqB,CAAC,CAAC;;;;6DAejC;IAOD;QAFC,uBAAW,CAAC,CAAC,YAAY,CAAC,CAAC;QAC3B,oBAAQ,CAAC,CAAC,+BAAqB,CAAC,CAAC;;;;+DAkBjC;IAOD;QAFC,uBAAW,CAAC,CAAC,YAAY,CAAC,CAAC;QAC3B,oBAAQ,CAAC,CAAC,+BAAqB,CAAC,CAAC;;;;yDAWjC;IAOD;QAFC,uBAAW,CAAC,CAAC,YAAY,CAAC,CAAC;QAC3B,oBAAQ,CAAC,CAAC,+BAAqB,CAAC,CAAC;;;;gEAqCjC;IACH,yBAAC;CAAA,AAxGD,IAwGC;kBAxGoB,kBAAkB"}
\ No newline at end of file
/** @format */
import { AwardsService } from '../service';
export default class BaseController {
/**
* 活动中奖名单
*/
findWinnerInfoList(context: Context, { session }: {
session: any;
}, [awardsService]: [AwardsService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<false, true> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<{
list: any;
total: any;
message: string;
pageNo: number;
pageSize: number;
}, true>>;
getAwardsList(context: Context, { session }: {
session: any;
}, [awardsService]: [AwardsService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<false, true> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<{
list: any;
total: any;
message: string;
pageNo: number;
pageSize: number;
}, true>>;
/**
* 导出活动中奖名单
*/
exportAwardsList(context: Context, { session }: {
session: any;
}, [awardsService]: [AwardsService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, true>>;
/**
* 导入发货
*/
downloadFile(context: Context, { session }: {
session: any;
}, [awardsService]: [AwardsService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<{
total: number;
data: any;
}, true>>;
}
This diff is collapsed.
{"version":3,"file":"awards.controller.js","sourceRoot":"","sources":["../../src/controller/awards.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,4CAA+E;AAC/E,0CAAoD;AAEpD,8BAAqC;AACrC,sCAA0C;AAC1C,wCAA2C;AAC3C,gCAAiC;AAEjC;IAAA;IAqNA,CAAC;IApNC;;OAEG;IAGG,2CAAkB,GAAxB,UAAyB,OAAgB,EAAE,EAAW,EAAE,EAAgC;YAA3C,OAAO,aAAA;YAAK,aAAa,QAAA;;;;;;wBAC9D,KAWF,OAAO,CAAC,IAAI,EAVd,kBAAe,EAAf,UAAU,mBAAG,EAAE,KAAA,EACf,eAAc,EAAd,OAAO,mBAAG,IAAI,KAAA,EACd,gBAAa,EAAb,QAAQ,mBAAG,EAAE,KAAA,EACb,kBAAiB,EAAjB,UAAU,mBAAG,IAAI,KAAA,EACjB,iBAAgB,EAAhB,SAAS,mBAAG,IAAI,KAAA,EAChB,qBAAoB,EAApB,aAAa,mBAAG,IAAI,KAAA,EACpB,cAAU,EAAV,MAAM,mBAAG,CAAC,KAAA,EACV,gBAAa,EAAb,QAAQ,mBAAG,EAAE,KAAA,EACb,SAAS,eAAA,EACT,OAAO,aAAA,CACO;wBAGA,qBAAM,aAAa,CAAC,wBAAwB,CAAC;gCAC3D,UAAU,YAAA;gCACV,OAAO,SAAA;gCACP,QAAQ,UAAA;gCACR,UAAU,YAAA;gCACV,IAAI,EAAE,SAAS;gCACf,aAAa,eAAA;gCACb,MAAM,QAAA;gCACN,QAAQ,UAAA;gCACR,SAAS,WAAA;gCACT,OAAO,SAAA;6BACR,CAAC,EAAA;;wBAXE,SAAS,GAAG,SAWd;wBAEF,OAAO,CAAC,GAAG,CAAC,gBAAc,IAAI,CAAC,SAAS,CAAC,SAA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,CAAC,CAAC,YAAY,CAAC,CAAC;QAC3B,oBAAQ,CAAC,CAAC,uBAAa,CAAC,CAAC;;;;4DA+BzB;IAKD;QAFC,uBAAW,CAAC,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACpC,oBAAQ,CAAC,CAAC,uBAAa,CAAC,CAAC;;;;uDAgCzB;IAOD;QAFC,uBAAW,CAAC,CAAC,OAAO,CAAC,CAAC;QACtB,oBAAQ,CAAC,CAAC,uBAAa,CAAC,CAAC;;;;0DAyFzB;IAOD;QAFC,uBAAW,CAAC,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QACvC,oBAAQ,CAAC,CAAC,uBAAa,CAAC,CAAC;;;;sDAuCzB;IACH,qBAAC;CAAA,AArND,IAqNC;kBArNoB,cAAc"}
\ No newline at end of file
/** @format */
import { SellerService } from '../service';
export default class BaseController {
/**
* 保存授权信息
*/
sellerSave(context: Context, {}: {}, [sellerService]: [SellerService]): 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 BaseController = /** @class */ (function () {
function BaseController() {
}
/**
* 保存授权信息
*/
BaseController.prototype.sellerSave = function (context, _a, _b) {
var sellerService = _b[0];
return __awaiter(this, void 0, void 0, function () {
var openId, accessToken, appKey, userNick, appOwnerOpenId, isPrimaryAccount, primaryUserNick, sellerInfo, hasSellerInfo, result;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
openId = context.openId, accessToken = context.accessToken, appKey = context.appKey, userNick = context.userNick, appOwnerOpenId = context.appOwnerOpenId;
isPrimaryAccount = userNick.indexOf(':') === -1;
console.log(userNick, isPrimaryAccount, 'userNick------');
if (!!isPrimaryAccount) return [3 /*break*/, 2];
primaryUserNick = userNick.split(':')[0];
return [4 /*yield*/, sellerService.getSellerInfoByUserNick(primaryUserNick)];
case 1:
sellerInfo = _c.sent();
if (sellerInfo) {
accessToken = sellerInfo.accessToken;
}
_c.label = 2;
case 2: return [4 /*yield*/, sellerService.findSellerInfo(openId)];
case 3:
hasSellerInfo = _c.sent();
if (!hasSellerInfo) return [3 /*break*/, 5];
return [4 /*yield*/, sellerService.updateSellerInfo(openId, { accessToken: accessToken })];
case 4:
_c.sent();
return [2 /*return*/, sdk_1.resultsModel.success(true)];
case 5: return [4 /*yield*/, sellerService.saveSellerInfo({
accessToken: accessToken,
openId: openId,
appKey: appKey,
userNick: userNick,
appOwnerOpenId: appOwnerOpenId
})];
case 6:
result = _c.sent();
return [2 /*return*/, sdk_1.resultsModel.success(result)];
}
});
});
};
__decorate([
decorator_1.paramsCheck(['activityId']),
decorator_1.services([service_1.SellerService]),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object, Object, Array]),
__metadata("design:returntype", Promise)
], BaseController.prototype, "sellerSave", 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGd,0CAAoD;AAEpD,8BAAqC;AACrC,sCAA0C;AAC1C;IAAA;IAuCA,CAAC;IAtCC;;OAEG;IAGG,mCAAU,GAAhB,UAAiB,OAAgB,EAAE,EAAE,EAAE,EAAg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B,oBAAQ,CAAC,CAAC,uBAAa,CAAC,CAAC;;;;oDAiCzB;IACH,qBAAC;CAAA,AAvCD,IAuCC;kBAvCoB,cAAc"}
\ No newline at end of file
/** @format */
export default class RuleController {
/**
* 生成活动规则
*/
generateRule(context: Context, {}: {}): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<string, true>>;
}
"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 utils_1 = require("../utils");
var sdk_1 = require("../sdk");
var constants_2 = require("../constants");
var RuleController = /** @class */ (function () {
function RuleController() {
}
/**
* 生成活动规则
*/
RuleController.prototype.generateRule = function (context, _a) {
return __awaiter(this, void 0, void 0, function () {
var _b, _c, title, _d, startTime, _e, endTime, _f, prizeList, resultRule, startTimeDate, endTimeDate, prizeStr;
return __generator(this, function (_g) {
_b = context.data, _c = _b.title, title = _c === void 0 ? '' : _c, _d = _b.startTime, startTime = _d === void 0 ? '' : _d, _e = _b.endTime, endTime = _e === void 0 ? '' : _e, _f = _b.prizeList, prizeList = _f === void 0 ? [] : _f;
if (title.length > 12)
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.PARAMS_ERROR, '活动名称不可超过12个字')];
if (startTime > endTime)
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.PARAMS_ERROR, '开始时间不得大于结束时间')];
if (prizeList.length === 0)
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.PARAMS_ERROR, '奖品至少配置一个')];
resultRule = '';
startTimeDate = utils_1.formatTime(new Date(+startTime + constants_2.EIGHT_HOURS), 'yyyy-MM-dd hh:mm:ss');
endTimeDate = utils_1.formatTime(new Date(+endTime + constants_2.EIGHT_HOURS), 'yyyy-MM-dd hh:mm:ss');
resultRule = "1.\u6D3B\u52A8\u65F6\u95F4\uFF1A" + startTimeDate + "--" + endTimeDate + "\uFF1B\n2.\u6D3B\u52A8\u7ED3\u675F\u6839\u636E\u6392\u884C\u699C\u6392\u540D\u83B7\u5F97\u5BF9\u5E94\u7684\u5956\u52B1\uFF0C\u6BCF\u4E2A\u4EBA\u53D6\u6D3B\u52A8\u4E2D\u5355\u5C40\u6700\u9AD8\u5206\uFF1B\n3.\u6BCF\u59293\u6B21\u514D\u8D39\u53C2\u4E0E\u8D44\u683C\uFF0C\u8D85\u8FC7\u6B21\u6570\u540E\u9080\u8BF7\u7FA4\u5185\u597D\u53CB\u53C2\u4E0E\u6E38\u620F\u53EF\u83B7\u5F97\u989D\u5916\u6B21\u6570(\u6BCF\u4E2A\u7528\u6237\u53EF\u52A9\u529B\u4E00\u6B21)\uFF1B\n4.\u53C2\u4E0E\u7B7E\u5230\u53EF\u83B7\u5F97\u9053\u5177\uFF0C\u6BCF\u5C40\u7ED3\u675F\u6E38\u620F\u540E\u53EF\u4F7F\u7528\u9053\u5177\uFF1B\n5.\u5B8C\u6210\u4EFB\u52A1\u6BCF\u5929\u53EF\u83B7\u5F97\u989D\u5916\u7684\u590D\u6D3B\u673A\u4F1A\uFF0C\u6BCF\u5C40\u53EA\u80FD\u4F7F\u7528\u4E00\u5F20\u590D\u6D3B\u5361\uFF1B\n\n";
prizeStr = prizeList.reduce(function (s, v) {
var rankArr = v.rank.split('-');
if (rankArr[0] == rankArr[1]) {
return (s += "\u7B2C" + rankArr[0] + "\u540D: " + v.name + "\n");
}
else {
return (s += "\u7B2C" + v.rank + "\u540D: " + v.name + "\n");
}
}, '奖品:\n');
resultRule += prizeStr;
return [2 /*return*/, sdk_1.resultsModel.success(resultRule)];
});
});
};
__decorate([
decorator_1.paramsCheck(['title', 'startTime', 'endTime', 'prizeList']),
decorator_1.services([]),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object, Object]),
__metadata("design:returntype", Promise)
], RuleController.prototype, "generateRule", null);
return RuleController;
}());
exports.default = RuleController;
//# sourceMappingURL=rule.controller.js.map
\ No newline at end of file
{"version":3,"file":"rule.controller.js","sourceRoot":"","sources":["../../src/controller/rule.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,4CAA2C;AAC3C,0CAAoD;AACpD,kCAAqC;AACrC,8BAAqC;AACrC,0CAA0C;AAC1C;IAAA;IA4BA,CAAC;IA3BC;;OAEG;IAGG,qCAAY,GAAlB,UAAmB,OAAgB,EAAE,EAAE;;;;gBAC/B,KAA+D,OAAO,CAAC,IAAI,EAAzE,aAAU,EAAV,KAAK,mBAAG,EAAE,KAAA,EAAE,iBAAc,EAAd,SAAS,mBAAG,EAAE,KAAA,EAAE,eAAY,EAAZ,OAAO,mBAAG,EAAE,KAAA,EAAE,iBAAc,EAAd,SAAS,mBAAG,EAAE,KAAA,CAAiB;gBAEjF,IAAI,KAAK,CAAC,MAAM,GAAG,EAAE;oBAAE,sBAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,YAAY,EAAE,cAAc,CAAC,EAAA;gBACzF,IAAI,SAAS,GAAG,OAAO;oBAAE,sBAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,YAAY,EAAE,cAAc,CAAC,EAAA;gBAC3F,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;oBAAE,sBAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,YAAY,EAAE,UAAU,CAAC,EAAA;gBAEtF,UAAU,GAAW,EAAE,CAAA;gBACrB,aAAa,GAAG,kBAAU,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,GAAG,uBAAW,CAAC,EAAE,qBAAqB,CAAC,CAAA;gBACrF,WAAW,GAAG,kBAAU,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,GAAG,uBAAW,CAAC,EAAE,qBAAqB,CAAC,CAAA;gBACvF,UAAU,GAAG,qCAAU,aAAa,UAAK,WAAW,sxBAAwJ,CAAA;gBACtM,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,UAAC,CAAC,EAAE,CAAC;oBACrC,IAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;oBACjC,IAAI,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE;wBAC5B,OAAO,CAAC,CAAC,IAAI,WAAI,OAAO,CAAC,CAAC,CAAC,iBAAO,CAAC,CAAC,IAAI,OAAI,CAAC,CAAA;qBAC9C;yBAAM;wBACL,OAAO,CAAC,CAAC,IAAI,WAAI,CAAC,CAAC,IAAI,iBAAO,CAAC,CAAC,IAAI,OAAI,CAAC,CAAA;qBAC1C;gBACH,CAAC,EAAE,OAAO,CAAC,CAAA;gBACX,UAAU,IAAI,QAAQ,CAAA;gBACtB,sBAAO,kBAAY,CAAC,OAAO,CAAC,UAAU,CAAC,EAAA;;;KACxC;IArBD;QAFC,uBAAW,CAAC,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;QAC3D,oBAAQ,CAAC,EAAE,CAAC;;;;sDAsBZ;IACH,qBAAC;CAAA,AA5BD,IA4BC;kBA5BoB,cAAc"}
\ No newline at end of file
/** @format */
import { ActivityconfigService } from '../service';
export interface ISavePrizeParams {
prizeList?: Array<IActivityPrize>;
}
export interface ISaveActivityContext extends Context {
data: IActivityBaseInfo & ISavePrizeParams;
}
export default class ActivitSaveController {
/**
* 保存活动
*/
saveActivityInfo(context: ISaveActivityContext, {}: {}, [activityconfigService]: [ActivityconfigService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<false, true> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<true, true>>;
}
"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 __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 };
}
};
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
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 saveValidate_1 = require("../utils/saveValidate");
var ActivitSaveController = /** @class */ (function () {
function ActivitSaveController() {
}
/**
* 保存活动
*/
// @paramsCheck(['title', 'startTime', 'endTime', 'tasks', 'rule'])
ActivitSaveController.prototype.saveActivityInfo = function (context, _a, _b) {
var activityconfigService = _b[0];
return __awaiter(this, void 0, void 0, function () {
var _c, _d, title, _e, activityId, startTime, endTime, _f, tasks, rule, prizeList, data, openId, baseData, allPrizeList, result, result, _g, bothIds, deleteIds, prizeResult;
return __generator(this, function (_h) {
switch (_h.label) {
case 0:
_c = context.data, _d = _c.title, title = _d === void 0 ? '' : _d, _e = _c.activityId, activityId = _e === void 0 ? '' : _e, startTime = _c.startTime, endTime = _c.endTime, _f = _c.tasks, tasks = _f === void 0 ? {} : _f, rule = _c.rule, prizeList = _c.prizeList, data = __rest(_c, ["title", "activityId", "startTime", "endTime", "tasks", "rule", "prizeList"]);
openId = context.openId;
baseData = __assign(__assign({ title: title,
startTime: startTime,
endTime: endTime,
rule: rule,
openId: openId,
tasks: tasks }, data), {
// 奖品过期时间, 根据需求领奖是否有过期时间
awardReceiveExpiredTime: endTime + constants_1._48_HOURS });
allPrizeList = __spreadArrays(prizeList.map(function (v, i) { return (__assign(__assign({}, v), { level: i + 1 })); }));
if (!!activityId) return [3 /*break*/, 2];
return [4 /*yield*/, activityconfigService.saveNewActivity(baseData, allPrizeList, openId)];
case 1:
result = _h.sent();
if (result || result === 0) {
return [2 /*return*/, sdk_1.resultsModel.success(true)];
}
else {
console.log(result, '保存活动失败');
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.SYSTEM_ERROR, '保存活动失败')];
}
return [3 /*break*/, 9];
case 2: return [4 /*yield*/, activityconfigService.updateBaseConfigInfo(activityId, baseData)
// 找到更新的和删除的奖品id
];
case 3:
result = _h.sent();
return [4 /*yield*/, activityconfigService.diffPrizeList(activityId, allPrizeList)
// 将删除的奖品逻辑删除
];
case 4:
_g = _h.sent(), bothIds = _g.bothIds, deleteIds = _g.deleteIds;
if (!(deleteIds === null || deleteIds === void 0 ? void 0 : deleteIds.length)) return [3 /*break*/, 6];
return [4 /*yield*/, activityconfigService.deletePrizeByIds(deleteIds)];
case 5:
result = _h.sent();
_h.label = 6;
case 6:
if (!(allPrizeList === null || allPrizeList === void 0 ? void 0 : allPrizeList.length)) return [3 /*break*/, 8];
return [4 /*yield*/, activityconfigService.insertAndUpdatePrize(activityId, allPrizeList, bothIds)];
case 7:
prizeResult = _h.sent();
if (prizeResult.failed.length) {
console.log(prizeResult.failed, '更新奖品失败');
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.SYSTEM_ERROR, '保存活动失败')];
}
_h.label = 8;
case 8:
if (result || result === 0) {
return [2 /*return*/, sdk_1.resultsModel.success(true)];
}
else {
console.log(result, '保存活动失败');
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.SYSTEM_ERROR, '保存活动失败')];
}
_h.label = 9;
case 9: return [2 /*return*/];
}
});
});
};
__decorate([
decorator_1.paramsValidate(saveValidate_1.saveParams),
decorator_1.services([service_1.ActivityconfigService]),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object, Object, Array]),
__metadata("design:returntype", Promise)
], ActivitSaveController.prototype, "saveActivityInfo", null);
return ActivitSaveController;
}());
exports.default = ActivitSaveController;
//# sourceMappingURL=save.controller.js.map
\ No newline at end of file
{"version":3,"file":"save.controller.js","sourceRoot":"","sources":["../../src/controller/save.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,4CAAsD;AACtD,0CAAoE;AACpE,8BAAqC;AACrC,sCAAkD;AAClD,sDAAkD;AAgBlD;IAAA;IA+EA,CAAC;IA9EC;;OAEG;IACH,mEAAmE;IAG7D,gDAAgB,GAAtB,UAAuB,OAA6B,EAA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BaseController {
/**
* 保存授权信息
*/
sellerSave(context: Context, {}: {}, [sellerService]: [SellerService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, true>>;
sellerSaasSave(context: Context, {}: {}, [sellerService, taobaoTopService, InstanceService]: [SellerService, TaobaoTopService, InstanceService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<{
deadline: any;
}, true>>;
}
This diff is collapsed.
{"version":3,"file":"seller.controller.js","sourceRoot":"","sources":["../../src/controller/seller.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,0CAAuC;AACvC,8BAAqC;AACrC,sCAA6E;AAC7E,0CAAwD;AACxD;IAAA;IA+JA,CAAC;IA9JC;;OAEG;IAEG,mCAAU,GAAhB,UAAiB,OAAgB,EAAE,EAAE,EAAE,EAAgC;YAA/B,aAAa,QAAA;;;;;;wBAC7C,MAAM,GAAoD,OAAO,OAA3D,EAAE,WAAW,GAAuC,OAAO,YAA9C,EAAE,MAAM,GAA+B,OAAO,OAAtC,EAAE,QAAQ,GAAqB,OAAO,SAA5B,EAAE,cAAc,GAAK,OAAO,eAAZ,CAAY;wBAEnE,gBAAgB,GAAY,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAA;wBAE5D,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAA;6BAGrD,CAAC,gBAAgB,EAAjB,wBAAiB;wBACf,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;wBAC3B,qBAAM,aAAa,CAAC,uBAAuB,CAAC,eAAe,CAAC,EAAA;;wBAAzE,UAAU,GAAG,SAA4D;wBAC7E,IAAI,UA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CAAC,GAAG;6BAChC,CAAC,EAAA;;wBAHF,SAGE,CAAA;;6BAEJ,sBAAO,kBAAY,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,EAAE,EAAE,CAAC,EAAA;;;;KAClE;IAzJD;QADC,oBAAQ,CAAC,CAAC,uBAAa,CAAC,CAAC;;;;oDAkCzB;IAGD;QADC,oBAAQ,CAAC,CAAC,uBAAa,EAAE,0BAAgB,EAAE,yBAAe,CAAC,CAAC;;;;wDAsH5D;IACH,qBAAC;CAAA,AA/JD,IA+JC;kBA/JoB,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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AAW,CAAC,UAAU,CAAC,YAAY,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,C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,SAAI,MAAM,CAAC,OAAO,CAAC,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 { TaobaoTopService } from '../service';
export default class BaseController {
/**
* 通过状态获取top商品列表
*/
findItemListByStatus(context: Context, { session }: {
session: any;
}, [taobaoTopService]: [TaobaoTopService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<{
pageNo: number;
pageSize: number;
totalPages: number;
totalCount: any;
list: any;
}, true>>;
/**
* 通过状态获取top商品列表
*/
findItemListByIds(context: Context, { session }: {
session: any;
}, [taobaoTopService]: [TaobaoTopService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<{
list: any;
totalCount: any;
}, true>>;
/**
* 通过ename获取权益信息
*/
queryBenefitByEname(context: Context, { session }: {
session: any;
}, [taobaoTopService]: [TaobaoTopService]): Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, true>>;
}
"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 service_1 = require("../service");
var BaseController = /** @class */ (function () {
function BaseController() {
}
/**
* 通过状态获取top商品列表
*/
BaseController.prototype.findItemListByStatus = function (context, _a, _b) {
var session = _a.session;
var taobaoTopService = _b[0];
return __awaiter(this, void 0, void 0, function () {
var _c, _d, approveStatus, _e, title, _f, pageNo, _g, pageSize, result;
return __generator(this, function (_h) {
switch (_h.label) {
case 0:
_c = context.data, _d = _c.approveStatus, approveStatus = _d === void 0 ? 'onsale' : _d, _e = _c.title, title = _e === void 0 ? '' : _e, _f = _c.pageNo, pageNo = _f === void 0 ? 1 : _f, _g = _c.pageSize, pageSize = _g === void 0 ? 10 : _g;
return [4 /*yield*/, taobaoTopService.getItemListByStatus(session, {
approveStatus: approveStatus,
title: title,
pageNo: pageNo,
pageSize: pageSize
})];
case 1:
result = _h.sent();
return [2 /*return*/, result];
}
});
});
};
/**
* 通过状态获取top商品列表
*/
BaseController.prototype.findItemListByIds = function (context, _a, _b) {
var session = _a.session;
var taobaoTopService = _b[0];
return __awaiter(this, void 0, void 0, function () {
var itemIds;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
itemIds = context.data.itemIds;
return [4 /*yield*/, taobaoTopService.getItemListByIds(itemIds, session)];
case 1: return [2 /*return*/, _c.sent()];
}
});
});
};
/**
* 通过ename获取权益信息
*/
BaseController.prototype.queryBenefitByEname = function (context, _a, _b) {
var session = _a.session;
var taobaoTopService = _b[0];
return __awaiter(this, void 0, void 0, function () {
var ename;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
ename = context.data.ename;
return [4 /*yield*/, taobaoTopService.getPrizeByEname(session, ename)];
case 1: return [2 /*return*/, _c.sent()];
}
});
});
};
__decorate([
decorator_1.paramsCheck(['approveStatus', 'title', 'pageNo', 'pageSize']),
decorator_1.services([service_1.TaobaoTopService]),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object, Object, Array]),
__metadata("design:returntype", Promise)
], BaseController.prototype, "findItemListByStatus", null);
__decorate([
decorator_1.paramsCheck(['itemIds']),
decorator_1.services([service_1.TaobaoTopService]),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object, Object, Array]),
__metadata("design:returntype", Promise)
], BaseController.prototype, "findItemListByIds", null);
__decorate([
decorator_1.paramsCheck(['ename']),
decorator_1.services([service_1.TaobaoTopService]),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object, Object, Array]),
__metadata("design:returntype", Promise)
], BaseController.prototype, "queryBenefitByEname", null);
return BaseController;
}());
exports.default = BaseController;
//# sourceMappingURL=taobaoItem.controller.js.map
\ No newline at end of file
{"version":3,"file":"taobaoItem.controller.js","sourceRoot":"","sources":["../../src/controller/taobaoItem.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGd,0CAAoD;AAGpD,sCAA6C;AA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C7D,oBAAQ,CAAC,CAAC,0BAAgB,CAAC,CAAC;;;;8DAU5B;IAOD;QAFC,uBAAW,CAAC,CAAC,SAAS,CAAC,CAAC;QACxB,oBAAQ,CAAC,CAAC,0BAAgB,CAAC,CAAC;;;;2DAI5B;IAOD;QAFC,uBAAW,CAAC,CAAC,OAAO,CAAC,CAAC;QACtB,oBAAQ,CAAC,CAAC,0BAAgB,CAAC,CAAC;;;;6DAI5B;IACH,qBAAC;CAAA,AApCD,IAoCC;kBApCoB,cAAc"}
\ 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,EAA4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AC;;;;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;
export declare const ACTIVITY_INSTANCE: string;
"use strict";
/** @format */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ACTIVITY_INSTANCE = 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';
exports.ACTIVITY_INSTANCE = 'miniapp_instantiate';
//# 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;AAErD,QAAA,iBAAiB,GAAW,qBAAqB,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");
var 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)]);
};
};
};
exports.paramsCheck = paramsCheck;
//# 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;AAClC,IAAM,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;AAdY,QAAA,WAAW,eAcvB"}
\ No newline at end of file
/** @format */
export * from './check';
export * from './services';
export * from './noCatch';
export * from './validate';
"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" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
/** @format */
__exportStar(require("./check"), exports);
__exportStar(require("./services"), exports);
__exportStar(require("./noCatch"), exports);
__exportStar(require("./validate"), 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;AACzB,6CAA0B"}
\ 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;
var 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 })])];
});
});
};
};
exports.noCatch = noCatch;
//# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEP,IAAM,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;AANY,QAAA,OAAO,WAMnB"}
\ 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");
var service_1 = require("../service");
function initBaseInfo(context, baseInfos) {
return __awaiter(this, void 0, void 0, function () {
var session;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!!baseInfos.session) return [3 /*break*/, 2];
return [4 /*yield*/, new service_1.TaobaoTopService(context).getAccessTokenByOpenId()];
case 1:
session = (_a.sent()).session;
baseInfos.session = session;
_a.label = 2;
case 2: return [2 /*return*/, baseInfos];
}
});
});
}
var services = function (services) {
return function (target, name, descriptor) {
var method = descriptor.value;
descriptor.value = function () {
var _a, _b, _c;
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return __awaiter(this, void 0, void 0, function () {
var context, _d, otherArgs, servicesInstance, baseInfos, ret, error_1;
return __generator(this, function (_e) {
switch (_e.label) {
case 0:
context = args[0], _d = args[1], otherArgs = _d === void 0 ? {} : _d;
servicesInstance = services.map(function (v) { return new v(context); });
return [4 /*yield*/, initBaseInfo(context, otherArgs)
// 默认全局try catch 如果有noCatch参数则直接执行
];
case 1:
baseInfos = _e.sent();
// 默认全局try catch 如果有noCatch参数则直接执行
if (baseInfos.noCatch) {
delete baseInfos.noCatch;
return [2 /*return*/, method.apply(target, [context, baseInfos, servicesInstance])];
}
_e.label = 2;
case 2:
_e.trys.push([2, 4, , 6]);
utils_1.logger(context);
return [4 /*yield*/, method.apply(target, [context, baseInfos, servicesInstance])];
case 3:
ret = _e.sent();
return [3 /*break*/, 6];
case 4:
error_1 = _e.sent();
console.log('error', error_1);
return [4 /*yield*/, utils_1.recordErrorLog(context, baseInfos, error_1.toString(), error_1.stack)];
case 5:
_e.sent();
ret = sdk_1.resultsModel.error(constants_1.CODE_TYPES.SYSTEM_ERROR, (((_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) + "\u7CFB\u7EDF\u9519\u8BEF");
return [3 /*break*/, 6];
case 6: return [2 /*return*/, ret];
}
});
});
};
};
};
exports.services = services;
//# 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,kCAAiD;AACjD,8BAAqC;AACrC,0CAAyC;AACzC,sCAA6C;AAC7C,SAAe,YAAY,CAAC,OAAgB,EAAE,SAA2B;;;;;;yBACnE,CAAC,SAAS,CAAC,OAAO,EAAlB,wBAAkB;oBAEA,qBAAM,IAAI,0BAAgB,CAAC,OAAO,CAAC,CAAC,sBAAsB,EAAE,EAAA;;oBAAxE,OAAO,GAAK,CAAA,SAA4D,CAAA,QAAjE;oBACf,SAAS,CAAC,OAAO,GAAG,OAAO,CAAA;;wBAG7B,sBAAO,SAAS,EAAA;;;;CACjB;AAEM,IAAM,QAAQ,GAAG,UAAC,QAAe;IACtC,OAAO,U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K,0CAAE,SAAS,0CAAE,OAAO,0CAAE,OAAO,KAAI,OAAO,CAAC,OAAO,8BAAM,CACxE,CAAA;;gCAEH,sBAAO,GAAG,EAAA;;;;SACX,CAAA;IACH,CAAC,CAAA;AACH,CAAC,CAAA;AA5BY,QAAA,QAAQ,YA4BpB"}
\ No newline at end of file
import { Rules } from 'async-validator';
export declare const paramsValidate: (validators: Rules) => (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);
};
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.paramsValidate = void 0;
/** @format */
var sdk_1 = require("../sdk");
var constants_1 = require("../constants");
var async_validator_1 = require("async-validator");
var paramsValidate = function (validators) {
return function (target, name, descriptor) {
var method = descriptor.value;
descriptor.value = function () {
var _a;
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return __awaiter(this, void 0, void 0, function () {
var context, _b, otherArgs, errors;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
context = args[0], _b = args[1], otherArgs = _b === void 0 ? {} : _b;
return [4 /*yield*/, validateParams(validators, context.data)];
case 1:
errors = (_c.sent()).errors;
console.log(errors);
if (errors)
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.SYSTEM_ERROR, (_a = errors === null || errors === void 0 ? void 0 : errors[0]) === null || _a === void 0 ? void 0 : _a.message)];
return [2 /*return*/, method.apply(target, [context, __assign({}, otherArgs)])];
}
});
});
};
};
};
exports.paramsValidate = paramsValidate;
var validateParams = function (validators, data) {
var validator = new async_validator_1.default(validators);
return new Promise(function (resolve) {
validator.validate(data, {}, function (errors, fields) {
console.log('errors', errors);
console.log('fields', fields);
if (errors) {
resolve({});
}
else {
resolve({ errors: errors, fields: fields });
}
});
});
};
//# sourceMappingURL=validate.js.map
\ No newline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,EAAE,MAAM;YAC1C,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;YAC7B,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;YAC7B,IAAI,MAAM,EAAE;gBACV,OAAO,CAAC,EAAE,CAAC,CAAA;aACZ;iBAAM;gBACL,OAAO,CAAC,EAAE,MAAM,QAAA,EAAE,MAAM,QAAA,EAAE,CAAC,CAAA;aAC5B;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}
\ No newline at end of file
/** @format */
declare const _default: {
getActivityList: (context: Context, {}: {}, [activityconfigService]: [import("./service").ActivityconfigService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<{
list: any;
total: any;
pageSize: number;
pageNo: number;
}, true>>;
getActivityDetail: (context: Context, {}: {}, [activityconfigService]: [import("./service").ActivityconfigService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, true>>;
delActivity: (context: Context, {}: {}, [activityconfigService]: [import("./service").ActivityconfigService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<false, true> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<true, true>>;
saveActivityInfo: (context: import("./controller/save.controller").ISaveActivityContext, {}: {}, [activityconfigService]: [import("./service").ActivityconfigService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<false, true> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<true, true>>;
sellerSave: (context: Context, {}: {}, [sellerService]: [import("./service").SellerService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, true>>;
findWinnerInfoList: (context: Context, { session }: {
session: any;
}, [awardsService]: [import("./service").AwardsService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<false, true> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<{
list: any;
total: any;
message: string;
pageNo: number;
pageSize: number;
}, true>>;
exportAwardsList: (context: Context, { session }: {
session: any;
}, [awardsService]: [import("./service").AwardsService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, true>>;
downloadFile: (context: Context, { session }: {
session: any;
}, [awardsService]: [import("./service").AwardsService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<{
total: number;
data: any;
}, true>>;
findItemListByStatus: (context: Context, { session }: {
session: any;
}, [taobaoTopService]: [import("./service").TaobaoTopService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<{
pageNo: number;
pageSize: number;
totalPages: number;
totalCount: any;
list: any;
}, true>>;
findItemListByIds: (context: Context, { session }: {
session: any;
}, [taobaoTopService]: [import("./service").TaobaoTopService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<{
list: any;
totalCount: any;
}, true>>;
queryBenefitByEname: (context: Context, { session }: {
session: any;
}, [taobaoTopService]: [import("./service").TaobaoTopService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, true>>;
createCopyActivity: (context: Context, {}: {}, [activityconfigService]: [import("./service").ActivityconfigService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, true>>;
getAwardsList: (context: Context, { session }: {
session: any;
}, [awardsService]: [import("./service").AwardsService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<false, true> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<{
list: any;
total: any;
message: string;
pageNo: number;
pageSize: number;
}, true>>;
};
export default _default;
"use strict";
/** @format */
Object.defineProperty(exports, "__esModule", { value: true });
var activity_controller_1 = require("./controller/activity.controller");
var seller_controller_1 = require("./controller/seller.controller");
var awards_controller_1 = require("./controller/awards.controller");
var rule_controller_1 = require("./controller/rule.controller");
var taobaoItem_controller_1 = require("./controller/taobaoItem.controller");
var save_controller_1 = require("./controller/save.controller");
var _a = new activity_controller_1.default(), getActivityList = _a.getActivityList, getActivityDetail = _a.getActivityDetail, delActivity = _a.delActivity, createCopyActivity = _a.createCopyActivity;
var _b = new seller_controller_1.default(), sellerSaasSave = _b.sellerSaasSave, sellerSave = _b.sellerSave;
var _c = new awards_controller_1.default(), findWinnerInfoList = _c.findWinnerInfoList, exportAwardsList = _c.exportAwardsList, getAwardsList = _c.getAwardsList, downloadFile = _c.downloadFile;
var generateRule = new rule_controller_1.default().generateRule;
var _d = new taobaoItem_controller_1.default(), findItemListByStatus = _d.findItemListByStatus, findItemListByIds = _d.findItemListByIds, queryBenefitByEname = _d.queryBenefitByEname;
var saveActivityInfo = new save_controller_1.default().saveActivityInfo;
exports.default = {
getActivityList: getActivityList,
getActivityDetail: getActivityDetail,
delActivity: delActivity,
saveActivityInfo: saveActivityInfo,
sellerSave: sellerSave,
findWinnerInfoList: findWinnerInfoList,
exportAwardsList: exportAwardsList,
downloadFile: downloadFile,
findItemListByStatus: findItemListByStatus,
findItemListByIds: findItemListByIds,
queryBenefitByEname: queryBenefitByEname,
createCopyActivity: createCopyActivity,
getAwardsList: getAwardsList
};
//# 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,wEAAiE;AACjE,oEAA6D;AAC7D,oEAA6D;AAC7D,gEAAyD;AACzD,4EAAqE;AACrE,gEAAyD;AAEnD,IAAA,KAAyE,IAAI,6BAAkB,EAAE,EAA/F,eAAe,qBAAA,EAAE,iBAAiB,uBAAA,EAAE,WAAW,iBAAA,EAAC,kBAAkB,wBAA6B,CAAA;AACjG,IAAA,KAAiC,IAAI,2BAAgB,EAAE,EAArD,cAAc,oBAAA,EAAE,UAAU,gBAA2B,CAAA;AACvD,IAAA,KAKF,IAAI,2BAAgB,EAAE,EAJxB,kBAAkB,wBAAA,EAClB,gBAAgB,sBAAA,EAChB,aAAa,mBAAA,EACb,YAAY,kBACY,CAAA;AAClB,IAAA,YAAY,GAAK,IAAI,yBAAc,EAAE,aAAzB,CAAyB;AACvC,IAAA,KAAmE,IAAI,+BAAoB,EAAE,EAA3F,oBAAoB,0BAAA,EAAE,iBAAiB,uBAAA,EAAE,mBAAmB,yBAA+B,CAAA;AAC3F,IAAA,gBAAgB,GAAK,IAAI,yBAAc,EAAE,iBAAzB,CAAyB;AAEjD,kBAAe;IACb,eAAe,iBAAA;IACf,iBAAiB,mBAAA;IACjB,WAAW,aAAA;IACX,gBAAgB,kBAAA;IAChB,UAAU,YAAA;IACV,kBAAkB,oBAAA;IAClB,gBAAgB,kBAAA;IAChB,YAAY,cAAA;IACZ,oBAAoB,sBAAA;IACpB,iBAAiB,mBAAA;IACjB,mBAAmB,qBAAA;IACnB,kBAAkB,oBAAA;IAClB,aAAa,eAAA;CACd,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;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,8BAAgC;AAChC,kCAAmC;AACnC,4BAAsC;AAEtC;IAGE,2BAAY,OAAgB;QAC1B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,aAAO,CAAC,OAAO,EAAE,mBAAc,CAAC,CAAA;IACvD,CAAC;IACD;;;OAGG;IACG,qCAAS,GAAf,UAAgB,QAAiB,EAAE,KAAc;;;;;;wBAC3C,KAAmB,IAAI,CAAC,OAAO,EAA7B,MAAM,YAAA,EAAE,IAAI,UAAA,CAAiB;wBAC7B,UAAU,GAAiC,IAAI,WAArC,EAAE,QAAQ,GAAuB,IAAI,SAA3B,EAAE,MAAM,GAAe,IAAI,OAAnB,EAAE,QAAQ,GAAK,IAAI,SAAT,CAAS;wBAE9C,qBAAM,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;gCACpC,MAAM,QAAA;gCACN,UAAU,YAAA;gCACV,QAAQ,UAAA;gCACR,MAAM,QAAA;gCACN,cAAc,EAAE,CAAC,CAAC,QAAQ;gCAC1B,QAAQ,UAAA;gCACR,QAAQ,UAAA;gCACR,KAAK,OAAA;gCACL,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE;gCACtB,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE;gCACtB,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE;gCACtB,SAAS,EAAE,gBAAQ,EAAE;6BACtB,CAAC,EAAA;4BAbF,sBAAO,SAaL,EAAA;;;;KACH;IAEK,0CAAc,GAApB;;;;;;wBACM,KAAmB,IAAI,CAAC,OAAO,EAA7B,MAAM,YAAA,EAAE,IAAI,UAAA,CAAiB;wBAC7B,UAAU,GAAK,IAAI,WAAT,CAAS;wBAClB,qBAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;gCAChC,MAAM,QAAA;gCACN,UAAU,YAAA;6BACX,CAAC,EAAA;4BAHF,sBAAO,SAGL,EAAA;;;;KACH;IACH,wBAAC;AAAD,CAAC,AAvCD,IAuCC"}
\ No newline at end of file
/** @format */
export default class ActivityConfigService {
activityconfigDao: IBaseDao;
activityconfigPrizeDao: IBaseDao;
constructor(context: Context);
saveNewActivity(baseConfig: IActivityBaseInfo, prize: Array<IActivityPrize>, openId: string): Promise<any>;
updateBaseConfigInfo(id: string, data: IActivityBaseInfo): Promise<any>;
getPrizeInfoById(id: any): Promise<any>;
updateDeleteStatusById(id: any): Promise<any>;
deletePrizeByIds(ids: string[]): Promise<any>;
insertAndUpdatePrize(activityId: string, allPrizeList: Array<IActivityPrize>, bothIds: string[]): Promise<{
success: any[];
failed: any[];
}>;
updateOnePrizeById(id: any, data: IActivityPrize): Promise<any>;
insertPrizeByActivityId(activityId: any, data: any): Promise<any>;
getAllOldPrizeList(activityId: string): Promise<any>;
diffPrizeList(activityId: string, pirzeList: Array<IActivityPrize>): Promise<{
deleteIds: string[];
bothIds: string[];
}>;
updateActivity(activityId: any, data: any, prizeNoId: any): Promise<[unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown]>;
getActivityListByOpenId(openId: string, { pageSize, pageNo }: {
pageSize?: number;
pageNo?: number;
}): Promise<{
list: any;
total: any;
pageSize: number;
pageNo: number;
}>;
getActivityInfoByActivityId(activityId: string): Promise<{
baseConfig: any;
prizeConfig: any;
}>;
deleteActivityByActivityId(activityId: string): Promise<any>;
getNodifyList(serverTime: any): Promise<any>;
update2Process(_id: any): Promise<boolean>;
update2Success(_id: any): Promise<boolean>;
update2Fail(_id: any, message: any): Promise<boolean>;
/**
* 组装奖品数据
*
* @param {Array<IActivityPrize>} prizeConfig
* @returns
* @memberof ActivityConfigService
*/
formatPrizeConfig(prizeConfig: Array<IActivityPrize>): {};
setPrizeProbalityRange(prizes: IActivityPrize[]): IActivityPrize[];
}
This diff is collapsed.
export = ActivitySellerService;
declare class ActivitySellerService {
constructor(context: any);
activityinstanceDao: any;
saveInstanceInfo(instanceInfo: any): Promise<any>;
findInstanceInfo(openId: any): Promise<any>;
updateInstanceInfo(openId: any, updateinfo: any): Promise<any>;
getMiniAppInstanceInfoByNick(userNick: any): Promise<any>;
}
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 };
}
};
var BaseDao = require("../dao/base.dao");
var ACTIVITY_INSTANCE = require("../config/db_config").ACTIVITY_INSTANCE;
module.exports = /** @class */ (function () {
function ActivitySellerService(context) {
this.activityinstanceDao = new BaseDao(context, ACTIVITY_INSTANCE);
}
//保存商家授权信息
ActivitySellerService.prototype.saveInstanceInfo = function (instanceInfo) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.activityinstanceDao.insertOne(__assign(__assign({}, instanceInfo), { updateTime: Date.now(), createTime: Date.now() }))];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
//查找商家授权信息
ActivitySellerService.prototype.findInstanceInfo = function (openId) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.activityinstanceDao.find({
openId: openId,
})];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
//更新商家授权信息
ActivitySellerService.prototype.updateInstanceInfo = function (openId, updateinfo) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.activityinstanceDao.update({
openId: openId,
}, {
$set: __assign(__assign({}, updateinfo), { updateTime: Date.now() }),
})];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
ActivitySellerService.prototype.getMiniAppInstanceInfoByNick = function (userNick) {
return __awaiter(this, void 0, void 0, function () {
var res;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.activityinstanceDao.find({
userNick: userNick,
})];
case 1:
res = _a.sent();
if (res && res[0]) {
return [2 /*return*/, res[0]];
}
return [2 /*return*/, false];
}
});
});
};
return ActivitySellerService;
}());
//# sourceMappingURL=activityinstance.service.js.map
\ No newline at end of file
{"version":3,"file":"activityinstance.service.js","sourceRoot":"","sources":["../../src/service/activityinstance.service.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAM,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACnC,IAAA,iBAAiB,GAAK,OAAO,CAAC,qBAAqB,CAAC,kBAAnC,CAAoC;AAE7D,MAAM,CAAC,OAAO;IACZ,+BAAY,OAAO;QACjB,IAAI,CAAC,mBAAmB,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;IACrE,CAAC;IAED,UAAU;IACJ,gDAAgB,GAAtB,UAAuB,YAAY;;;;4BAC1B,qBAAM,IAAI,CAAC,mBAAmB,CAAC,SAAS,uBAC1C,YAAY,KACf,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,EACtB,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,IACtB,EAAA;4BAJF,sBAAO,SAIL,EAAC;;;;KACJ;IAED,UAAU;IACJ,gDAAgB,GAAtB,UAAuB,MAAM;;;;4BACpB,qBAAM,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC;4BACzC,MAAM,QAAA;yBACP,CAAC,EAAA;4BAFF,sBAAO,SAEL,EAAC;;;;KACJ;IAED,UAAU;IACJ,kDAAkB,GAAxB,UAAyB,MAAM,EAAE,UAAU;;;;4BAClC,qBAAM,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAC1C;4BACE,MAAM,QAAA;yBACP,EACD;4BACE,IAAI,wBACC,UAAU,KACb,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GACvB;yBACF,CACF,EAAA;4BAVD,sBAAO,SAUN,EAAC;;;;KACH;IAEK,4DAA4B,GAAlC,UAAmC,QAAQ;;;;;4BAC/B,qBAAM,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC;4BAC5C,QAAQ,UAAA;yBACT,CAAC,EAAA;;wBAFE,GAAG,GAAG,SAER;wBACF,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE;4BACjB,sBAAO,GAAG,CAAC,CAAC,CAAC,EAAC;yBACf;wBACD,sBAAO,KAAK,EAAC;;;;KACd;IACH,4BAAC;AAAD,CAAC,AA7CgB,GA6ChB,CAAC"}
\ No newline at end of file
export = ActivitySellerService;
declare class ActivitySellerService {
constructor(context: any);
activitysellerDao: any;
saveSellerInfo(sellerInfo: any): Promise<any>;
findSellerInfo(openId: any): Promise<any>;
getSellerInfoByUserNick(userNick: any): Promise<any>;
updateSellerInfo(openId: any, sellerInfo: any): Promise<any>;
}
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 };
}
};
var BaseDao = require("../dao/base.dao");
var ACTIVITY_SELLER_SAVE = require("../config/db_config").ACTIVITY_SELLER_SAVE;
module.exports = /** @class */ (function () {
function ActivitySellerService(context) {
this.activitysellerDao = new BaseDao(context, ACTIVITY_SELLER_SAVE);
}
//保存商家授权信息
ActivitySellerService.prototype.saveSellerInfo = function (sellerInfo) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.activitysellerDao.insertOne(__assign(__assign({}, sellerInfo), { updateTime: Date.now(), createTime: Date.now() }))];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
//查找商家授权信息
ActivitySellerService.prototype.findSellerInfo = function (openId) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.activitysellerDao.find({
openId: openId,
})];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
//查找商家授权信息
ActivitySellerService.prototype.getSellerInfoByUserNick = function (userNick) {
return __awaiter(this, void 0, void 0, function () {
var res;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.activitysellerDao.find({
userNick: userNick,
})];
case 1:
res = _a.sent();
if (res && res[0]) {
return [2 /*return*/, res[0]];
}
return [2 /*return*/, false];
}
});
});
};
//更新商家授权信息
ActivitySellerService.prototype.updateSellerInfo = function (openId, sellerInfo) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
console.log(openId, sellerInfo, "openId, sellerInfo");
return [4 /*yield*/, this.activitysellerDao.update({
openId: openId,
}, {
$set: __assign(__assign({}, sellerInfo), { updateTime: Date.now() }),
})];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
return ActivitySellerService;
}());
//# sourceMappingURL=activityseller.service.js.map
\ No newline at end of file
{"version":3,"file":"activityseller.service.js","sourceRoot":"","sources":["../../src/service/activityseller.service.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAM,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACnC,IAAA,oBAAoB,GAAK,OAAO,CAAC,qBAAqB,CAAC,qBAAnC,CAAoC;AAEhE,MAAM,CAAC,OAAO;IACZ,+BAAY,OAAO;QACjB,IAAI,CAAC,iBAAiB,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;IACtE,CAAC;IAED,UAAU;IACJ,8CAAc,GAApB,UAAqB,UAAU;;;;4BACtB,qBAAM,IAAI,CAAC,iBAAiB,CAAC,SAAS,uBACxC,UAAU,KACb,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,EACtB,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,IACtB,EAAA;4BAJF,sBAAO,SAIL,EAAC;;;;KACJ;IAED,UAAU;IACJ,8CAAc,GAApB,UAAqB,MAAM;;;;4BAClB,qBAAM,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC;4BACvC,MAAM,QAAA;yBACP,CAAC,EAAA;4BAFF,sBAAO,SAEL,EAAC;;;;KACJ;IAED,UAAU;IACJ,uDAAuB,GAA7B,UAA8B,QAAQ;;;;;4BAC1B,qBAAM,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC;4BAC1C,QAAQ,UAAA;yBACT,CAAC,EAAA;;wBAFE,GAAG,GAAG,SAER;wBACF,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE;4BACjB,sBAAO,GAAG,CAAC,CAAC,CAAC,EAAC;yBACf;wBACD,sBAAO,KAAK,EAAC;;;;KACd;IAED,UAAU;IACJ,gDAAgB,GAAtB,UAAuB,MAAM,EAAE,UAAU;;;;;wBACvC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,oBAAoB,CAAC,CAAC;wBAC/C,qBAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,CACxC;gCACE,MAAM,EAAE,MAAM;6BACf,EACD;gCACE,IAAI,wBACC,UAAU,KACb,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GACvB;6BACF,CACF,EAAA;4BAVD,sBAAO,SAUN,EAAC;;;;KACH;IACH,4BAAC;AAAD,CAAC,AA/CgB,GA+ChB,CAAC"}
\ No newline at end of file
export = ActivityTopService;
declare class ActivityTopService {
constructor(context: any);
activitySellerDao: any;
activityBaseDao: any;
context: any;
getAccessToken(activityId: any): Promise<{
session: any;
}>;
getAccessTokenByOpenId(): Promise<{
session: any;
}>;
getItemListByIds(activityId: any, itemIds: any): Promise<any>;
getPrizeByEname(activityId: any, ename: any): Promise<any>;
getVipUrlByActivity(activityId: any): Promise<any>;
getShopId(): Promise<any>;
getItemListByStatus(): Promise<any>;
getTemplateInstantiate(): Promise<any>;
pushOnlineInstance(instanceInfo: any): Promise<any>;
getSubRelationship(nick: any): Promise<any>;
updateMiniInstance(instanceInfo: any): Promise<any>;
}
This diff is collapsed.
{"version":3,"file":"activitytop.service.js","sourceRoot":"","sources":["../../src/service/activitytop.service.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAM,IAAA,KAGF,OAAO,CAAC,qBAAqB,CAAC,EAFhC,oBAAoB,0BAAA,EACpB,oBAAoB,0BACY,CAAC;AAC7B,IAAA,KAGF,OAAO,CAAC,yBAAyB,CAAC,EAFpC,iBAAiB,uBAAA,EACjB,sBAAsB,4BACc,CAAC;AACjC,IAAA,KAOF,OAAO,CAAC,oBAAoB,CAAC,EAN/B,UAAU,gBAAA,EACV,SAAS,eAAA,EACT,UAAU,gB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Service {
context: Context;
awardsDao: IBaseDao;
constructor(context: Context);
addWaitAwardsList(list: any): Promise<boolean>;
setUserShipStatus(activityId: any, prizeId: any, shipCompany: any, shipNum: any): Promise<any>;
getAwardListByActivityId({ activityId, title, pageNo, pageSize, prizeId, userNick, type, prizeDataType, shipStatus, startTime, endTime, isExport }: {
activityId?: string;
title?: string;
pageNo?: number;
pageSize?: number;
prizeId?: any;
userNick?: string;
type?: any;
prizeDataType?: any;
shipStatus?: any;
startTime?: any;
endTime?: any;
isExport?: boolean;
}): Promise<false | {
list: any;
total: any;
message: string;
pageNo: number;
pageSize: number;
}>;
}
This diff is collapsed.
{"version":3,"file":"awards.service.js","sourceRoot":"","sources":["../../src/service/awards.service.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,UAAU;AAEV,8BAAgC;AAChC,4BAAsC;AAEtC,0CAAmE;AACnE;IAGE,uBAAY,OAAgB;QAC1B,IAAI,CAAC,SAAS,GAAG,IAAI,aAAO,CAAC,OAAO,EAAE,mBAAc,CAAC,CAAA;IACvD,CAAC;IAED,aAAa;IACP,yCAAiB,GAAvB,UAAwB,IAAI;;;;;;wBAC1B,IAAI,CAAC,IAAI,CAAC,MAAM;4BAAE,sBAAO,IAAI,EAAA;wBAC7B,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,UAAA,CAAC;4BACf,6BACK,CAAC,KACJ,UAAU,EAAE,uBAAW,CAAC,SAAS,EACjC,OAAO,EAAE,EAAE,IACZ;wBACH,CAAC,CAAC,CAAA;;;;wBAEA,qBAAM,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,EAAA;;wBAArC,SAAqC,CAAA;wBACrC,sBAAO,IAAI,EAAA;;;wBAEX,OAAO,CAAC,GAAG,CAAC,mFAAgB,GAAG,CAAC,CAAA;wBAChC,sBAAO,KAAK,EAAA;;;;;KAEf;IAEK,yCAAiB,GAAvB,UAA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gCAC5C,KAAK,EAAE,QAAQ;gCACf,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,QAAQ;gCAC7B,IAAI,EAAE;oCACJ,KAAK,EAAE,CAAC,CAAC;oCACT,QAAQ,EAAE,CAAC,CAAC;iCACb;6BACF,CAAC,EAAA;;wBAPI,IAAI,GAAG,SAOX;wBACY,qBAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,EAAA;;wBAAzC,KAAK,GAAG,SAAiC;wBAC/C,sBAAO;gCACL,IAAI,MAAA;gCACJ,KAAK,OAAA;gCACL,OAAO,EAAE,IAAI;gCACb,MAAM,QAAA;gCACN,QAAQ,UAAA;6BACT,EAAA;;;;KACF;IACH,oBAAC;AAAD,CAAC,AAzHD,IAyHC"}
\ 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 ActivityconfigService } from './activityconfig.service';
export { default as TaobaoTopService } from './taobaoTop.service';
export { default as SellerService } from './seller.service';
export { default as InstanceService } from './instance.service';
export { default as AwardsService } from './awards.service';
"use strict";
/** @format */
Object.defineProperty(exports, "__esModule", { value: true });
exports.AwardsService = exports.InstanceService = exports.SellerService = exports.TaobaoTopService = exports.ActivityconfigService = void 0;
var activityconfig_service_1 = require("./activityconfig.service");
Object.defineProperty(exports, "ActivityconfigService", { enumerable: true, get: function () { return activityconfig_service_1.default; } });
var taobaoTop_service_1 = require("./taobaoTop.service");
Object.defineProperty(exports, "TaobaoTopService", { enumerable: true, get: function () { return taobaoTop_service_1.default; } });
var seller_service_1 = require("./seller.service");
Object.defineProperty(exports, "SellerService", { enumerable: true, get: function () { return seller_service_1.default; } });
var instance_service_1 = require("./instance.service");
Object.defineProperty(exports, "InstanceService", { enumerable: true, get: function () { return instance_service_1.default; } });
var awards_service_1 = require("./awards.service");
Object.defineProperty(exports, "AwardsService", { enumerable: true, get: function () { return awards_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,mEAA2E;AAAlE,+HAAA,OAAO,OAAyB;AACzC,yDAAiE;AAAxD,qHAAA,OAAO,OAAoB;AACpC,mDAA2D;AAAlD,+GAAA,OAAO,OAAiB;AACjC,uDAA+D;AAAtD,mHAAA,OAAO,OAAmB;AACnC,mDAA2D;AAAlD,+GAAA,OAAO,OAAiB"}
\ No newline at end of file
/** @format */
export default class InstanceService {
activityinstanceDao: IBaseDao;
context: Context;
constructor(context: Context);
saveInstanceInfo(instanceInfo: any): Promise<any>;
findInstanceInfo(openId: string): Promise<any>;
updateInstanceInfo(openId: string, updateinfo: any): Promise<any>;
getMiniAppInstanceInfoByNick(userNick: string): Promise<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);
};
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 InstanceService = /** @class */ (function () {
function InstanceService(context) {
this.activityinstanceDao = new sdk_1.BaseDao(context, db_1.ACTIVITY_INSTANCE);
}
//保存商家授权信息
InstanceService.prototype.saveInstanceInfo = function (instanceInfo) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.activityinstanceDao.insertOne(__assign(__assign({}, instanceInfo), { updateTime: Date.now(), createTime: Date.now() }))];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
//查找商家授权信息
InstanceService.prototype.findInstanceInfo = function (openId) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.activityinstanceDao.find({ openId: openId })];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
//更新商家授权信息
InstanceService.prototype.updateInstanceInfo = function (openId, updateinfo) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.activityinstanceDao.update({ openId: openId }, {
$set: __assign(__assign({}, updateinfo), { updateTime: Date.now() })
})];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
InstanceService.prototype.getMiniAppInstanceInfoByNick = function (userNick) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.activityinstanceDao.find({ userNick: userNick })];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
return InstanceService;
}());
exports.default = InstanceService;
//# sourceMappingURL=instance.service.js.map
\ No newline at end of file
{"version":3,"file":"instance.service.js","sourceRoot":"","sources":["../../src/service/instance.service.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,8BAAgC;AAChC,4BAAyC;AAEzC;IAGE,yBAAY,OAAgB;QAC1B,IAAI,CAAC,mBAAmB,GAAG,IAAI,aAAO,CAAC,OAAO,EAAE,sBAAiB,CAAC,CAAA;IACpE,CAAC;IAED,UAAU;IACJ,0CAAgB,GAAtB,UAAuB,YAAY;;;;4BAC1B,qBAAM,IAAI,CAAC,mBAAmB,CAAC,SAAS,uBAC1C,YAAY,KACf,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,EACtB,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,IACtB,EAAA;4BAJF,sBAAO,SAIL,EAAA;;;;KACH;IAED,UAAU;IACJ,0CAAgB,GAAtB,UAAuB,MAAc;;;;4BAC5B,qBAAM,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,MAAM,QAAA,EAAE,CAAC,EAAA;4BAAtD,sBAAO,SAA+C,EAAA;;;;KACvD;IAED,UAAU;IACJ,4CAAkB,GAAxB,UAAyB,MAAc,EAAE,UAAU;;;;4BAC1C,qBAAM,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAC1C,EAAE,MAAM,QAAA,EAAE,EACV;4BACE,IAAI,wBACC,UAAU,KACb,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GACvB;yBACF,CACF,EAAA;4BARD,sBAAO,SAQN,EAAA;;;;KACF;IAEK,sDAA4B,GAAlC,UAAmC,QAAgB;;;;4BAC1C,qBAAM,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,QAAQ,UAAA,EAAE,CAAC,EAAA;4BAAxD,sBAAO,SAAiD,EAAA;;;;KACzD;IACH,sBAAC;AAAD,CAAC,AArCD,IAqCC"}
\ No newline at end of file
export = RankopenprizeService;
declare class RankopenprizeService {
constructor(context: any);
rankopenprizeDao: any;
addWaitAwardsList(list: any): Promise<boolean>;
getAwardslistByActivityId(activityId: any): Promise<any>;
}
This diff is collapsed.
{"version":3,"file":"rankopenprize.service.js","sourceRoot":"","sources":["../../src/service/rankopenprize.service.js"],"names":[],"mappings":"AAAA,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEV,IAAM,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACnC,IAAA,WAAW,GAAK,OAAO,CAAC,oBAAoB,CAAC,YAAlC,CAAmC;AAE9C,IAAA,UAAU,GAAK,OAAO,CAAC,qBAAqB,CAAC,WAAnC,CAAoC;AACtD,IAAM,MAAM,GAAG,UAAU,CAAC;AAC1B;IACE,8BAAY,OAAO;QACjB,IAAI,CAAC,gBAAgB,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACvD,CAAC;IAED,aAAa;IACP,gDAAiB,GAAvB,UAAwB,IAAI;;;;;;wBAC1B,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;4BAChB,sBAAO,IAAI,EAAC;yBACb;wBACD,IAAI,CAAC,GAAG,CAAC,UAAC,CAAC;4BACT,CAAC,CAAC,CAAC,UAAU,GAAG,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;wBAC3D,CAAC,CAAC,CAAC;;;;wBAED,qBAAM,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,EAAA;;wBAA5C,SAA4C,CAAC;wBAC7C,sBAAO,IAAI,EAAC;;;wBAEZ,OAAO,CAAC,GAAG,CAAC,mFAAgB,GAAG,CAAC,CAAC;wBACjC,sBAAO,KAAK,EAAC;;;;;KAEhB;IAED,eAAe;IACT,wDAAyB,GAA/B,UAAgC,UAAU;;;;;wBACxC,IAAI,CAAC,UAAU,EAAE;4BACf,sBAAO,KAAK,EAAC;yBACd;wBACM,qBAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,CACrC;gCACE,UAAU,EAAE,UAAU;6BACvB,EACD;gCACE,IAAI,EAAE;oCACJ,KAAK,EAAE,CAAC,CAAC;oCACT,QAAQ,EAAE,CAAC,CAAC;iCACb;6BACF,CACF,EAAA;4BAVD,sBAAO,SAUN,EAAC;;;;KACH;IACH,2BAAC;AAAD,CAAC,AAvCD,IAuCC;AAED,MAAM,CAAC,OAAO,GAAG,oBAAoB,CAAC"}
\ No newline at end of file
/** @format */
export default class ActivitySellerService {
context: Context;
sellerdao: IBaseDao;
constructor(context: Context);
saveSellerInfo(sellerInfo: ISellerSaveInfo): Promise<any>;
findSellerInfo(openId: string): Promise<any>;
getSellerInfoByUserNick(userNick: string): Promise<any>;
updateSellerInfo(openId: string, sellerInfo: object): Promise<any>;
}
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.
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