123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358 |
- import { Request, Response } from 'express';
- /**
- * @author bianlanzhou
- * @since 2024-11-06
- * @desc 消息中心mock
- */
- /** 等待时间 */
- const waitTime = (time: number = 100) => {
- return new Promise((resolve) => {
- setTimeout(() => {
- resolve(true);
- }, time);
- });
- };
- /** 分页查询短信签名响应数据 */
- const pageQuerySmsSignRespData = {
- "success": true,
- "errCode": null,
- "errMessage": null,
- "total": 1,
- "pageSize": 10,
- "pageIndex": 1,
- "data": [
- {
- "id": 1,
- "signatureName": "惠融数科签名",
- "signatureContent": "惠融数科",
- "createUsername": "刘涛",
- "modifyUsername": "张元英",
- "gmtCreate": "2024-10-21 09:33:51",
- "gmtModify": "2024-10-21 09:33:51",
- "status": "draft"
- }
- ],
- "totalPages": 1,
- "notEmpty": true,
- "empty": false
- }
- /** 分页查询短信签名响应数据 */
- const querySmsSignRespData = {
- "success": true,
- "errCode": null,
- "errMessage": null,
- "data": [
- {
- "id": 1,
- "signatureName": "惠融数科签名",
- "signatureContent": "惠融数科",
- "createUsername": "刘涛",
- "modifyUsername": "张元英",
- "gmtCreate": "2024-10-21 09:33:51",
- "gmtModify": "2024-10-21 09:33:51",
- "status": "draft"
- }
- ],
- "notEmpty": true,
- "empty": false
- }
- /** 分页查询短信模版响应数据 */
- const pageQuerySmsTemplateRespData = {
- "success": true,
- "errCode": null,
- "errMessage": null,
- "total": 1,
- "pageSize": 10,
- "pageIndex": 1,
- "data": [
- {
- "id": 1,
- "templateName": "惠融数科模版",
- "templateContent": "尊敬的xxx,您的手机号${phone}已经欠费,哈哈哈哈.",
- "createUsername": "刘涛",
- "modifyUsername": "张元英",
- "gmtCreate": "2024-10-21 09:33:51",
- "gmtModify": "2024-10-21 09:33:51",
- "status": "draft"
- }
- ],
- "totalPages": 1,
- "notEmpty": true,
- "empty": false
- }
- /** 查询短信模版响应数据 */
- const querySmsTemplateRespData = {
- "success": true,
- "errCode": null,
- "errMessage": null,
- "data": [
- {
- "id": 1,
- "templateName": "惠融数科模版",
- "templateContent": "尊敬的xxx,您的手机号${phone}已经欠费,哈哈哈哈.",
- "createUsername": "刘涛",
- "modifyUsername": "张元英",
- "gmtCreate": "2024-10-21 09:33:51",
- "gmtModify": "2024-10-21 09:33:51",
- "status": "draft"
- }
- ],
- "notEmpty": true,
- "empty": false
- }
- /** 分页查询短信服务响应数据 */
- const pageQuerySmsServiceRespData = {
- "success": true,
- "errCode": null,
- "errMessage": null,
- "total": 1,
- "pageSize": 10,
- "pageIndex": 1,
- "data": [
- {
- "id": 1,
- "serviceName": "促申请短信",
- "serviceCode": "apply-sms",
- "createUsername": "刘涛",
- "modifyUsername": "张元英",
- "gmtCreate": "2024-10-21 09:33:51",
- "gmtModify": "2024-10-21 09:33:51",
- "status": "draft"
- }
- ],
- "totalPages": 1,
- "notEmpty": true,
- "empty": false
- }
- /** 分页查询短信平台响应数据 */
- const pageQuerySmsPlatformRespData = {
- "success": true,
- "errCode": null,
- "errMessage": null,
- "total": 1,
- "pageSize": 10,
- "pageIndex": 1,
- "data": [
- {
- "id": 1,
- "platformName": "红树短信平台",
- "createUsername": "刘涛",
- "modifyUsername": "张元英",
- "gmtCreate": "2024-10-21 09:33:51",
- "gmtModify": "2024-10-21 09:33:51",
- "status": "draft"
- }
- ],
- "totalPages": 1,
- "notEmpty": true,
- "empty": false
- }
- /** 查询短信平台响应数据 */
- const querySmsPlatformRespData = {
- "success": true,
- "errCode": null,
- "errMessage": null,
- "data": [
- {
- "id": 1,
- "platformName": "红树短信平台",
- "createUsername": "刘涛",
- "modifyUsername": "张元英",
- "gmtCreate": "2024-10-21 09:33:51",
- "gmtModify": "2024-10-21 09:33:51",
- "status": "draft"
- }
- ],
- "notEmpty": true,
- "empty": false
- }
- /** 分页查询短信通道响应数据 */
- const pageQuerySmsChannelRespData = {
- "success": true,
- "errCode": null,
- "errMessage": null,
- "total": 1,
- "pageSize": 10,
- "pageIndex": 1,
- "data": [
- {
- "id": 1,
- "channelName": "红树短信平台-营销通道",
- "createUsername": "刘涛",
- "modifyUsername": "张元英",
- "gmtCreate": "2024-10-21 09:33:51",
- "gmtModify": "2024-10-21 09:33:51",
- "status": "draft"
- }
- ],
- "totalPages": 1,
- "notEmpty": true,
- "empty": false
- }
- /** 查询短信通道响应数据 */
- const querySmsChannelRespData = {
- "success": true,
- "errCode": null,
- "errMessage": null,
- "data": [
- {
- "id": 1,
- "channelName": "红树短信平台-营销通道",
- "createUsername": "刘涛",
- "modifyUsername": "张元英",
- "gmtCreate": "2024-10-21 09:33:51",
- "gmtModify": "2024-10-21 09:33:51",
- "status": "draft"
- }
- ],
- "notEmpty": true,
- "empty": false
- }
- /** 更新/插入短信签名响应数据 */
- const upsertSmsSignRespData = {
- "success": true,
- "errCode": null,
- "errMessage": null,
- "data": 1848565642249170945
- }
- /** 更新/插入短信模版响应数据 */
- const upsertSmsTemplateRespData = {
- "success": true,
- "errCode": null,
- "errMessage": null,
- "data": 1848565642249170945
- }
- /** 更新/插入短信平台响应数据 */
- const upsertSmsPlatformRespData = {
- "success": true,
- "errCode": null,
- "errMessage": null,
- "data": 1848565642249170945
- }
- /** 更新/插入短信通道响应数据 */
- const upsertSmsChannelRespData = {
- "success": true,
- "errCode": null,
- "errMessage": null,
- "data": 1848565642249170945
- }
- /** 分页查询短信签名 */
- const pageQuerySmsSign = async (req: Request, res: Response) => {
- await waitTime(2000);
- res.json(pageQuerySmsSignRespData);
- }
- /** 查询短信签名 */
- const querySmsSign = async (req: Request, res: Response) => {
- await waitTime(2000);
- res.json(querySmsSignRespData);
- }
- /** 更新/插入短信签名 */
- const upsertSmsSign = async (req: Request, res: Response) => {
- await waitTime(2000);
- res.json(upsertSmsSignRespData);
- }
- /** 分页查询短信模版 */
- const pageQuerySmsTemplate = async (req: Request, res: Response) => {
- await waitTime(2000);
- res.json(pageQuerySmsTemplateRespData);
- }
- /** 分页查询短信模版 */
- const querySmsTemplate = async (req: Request, res: Response) => {
- await waitTime(2000);
- res.json(querySmsTemplateRespData);
- }
- /** 更新/插入短信模版 */
- const upsertSmsTemplate = async (req: Request, res: Response) => {
- await waitTime(2000);
- res.json(upsertSmsTemplateRespData);
- }
- /** 分页查询短信服务 */
- const pageQuerySmsService = async (req: Request, res: Response) => {
- await waitTime(2000);
- res.json(pageQuerySmsServiceRespData);
- }
- /** 分页查询短信平台 */
- const pageQuerySmsPlatform = async (req: Request, res: Response) => {
- await waitTime(2000);
- res.json(pageQuerySmsPlatformRespData);
- }
- /** 查询短信平台 */
- const querySmsPlatform = async (req: Request, res: Response) => {
- await waitTime(2000);
- res.json(querySmsPlatformRespData);
- }
- /** 更新/插入短信模版 */
- const upsertSmsPlatform = async (req: Request, res: Response) => {
- await waitTime(2000);
- res.json(upsertSmsPlatformRespData);
- }
- /** 分页查询短信通道 */
- const pageQuerySmsChannel = async (req: Request, res: Response) => {
- await waitTime(2000);
- res.json(pageQuerySmsChannelRespData);
- }
- /** 查询短信通道 */
- const querySmsChannel = async (req: Request, res: Response) => {
- await waitTime(2000);
- res.json(querySmsChannelRespData);
- }
- /** 更新/插入短信通道 */
- const upsertSmsChannel = async (req: Request, res: Response) => {
- await waitTime(2000);
- res.json(upsertSmsChannelRespData);
- }
- export default {
- 'GET /sms/sign/page': pageQuerySmsSign,
- 'GET /sms/sign/list': querySmsSign,
- 'POST /sms/sign/upsert': upsertSmsSign,
- 'GET /sms/template/page': pageQuerySmsTemplate,
- 'GET /sms/template/list': querySmsTemplate,
- 'POST /sms/template/upsert': upsertSmsTemplate,
- 'GET /sms/service/page': pageQuerySmsService,
- 'GET /sms/platform/page': pageQuerySmsPlatform,
- 'GET /sms/platform/list': querySmsPlatform,
- 'POST /sms/platform/upsert': upsertSmsPlatform,
- 'GET /sms/channel/page': pageQuerySmsChannel,
- 'GET /sms/channel/list': querySmsChannel,
- 'POST /sms/channel/upsert': upsertSmsChannel,
- };
|