merchant.ts 894 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { Request, Response } from 'express';
  2. /**
  3. * @author bianlanzhou
  4. * @since 2024-10-25
  5. * @desc 商户响应数据mock
  6. */
  7. /** 等待时间 */
  8. const waitTime = (time: number = 100) => {
  9. return new Promise((resolve) => {
  10. setTimeout(() => {
  11. resolve(true);
  12. }, time);
  13. });
  14. };
  15. /** 查询商户响应数据 */
  16. const queryMerchantRespData = {
  17. "success": true,
  18. "errCode": null,
  19. "errMessage": null,
  20. "data": [
  21. {
  22. "id": '1848565642249170945',
  23. "merchantName": "优逸客",
  24. }, {
  25. "id": '1848565642249170946',
  26. "merchantName": "信业帮",
  27. }
  28. ]
  29. }
  30. /** 查询商户 */
  31. const queryMerchant = async (req: Request, res: Response) => {
  32. await waitTime(2000);
  33. res.json(queryMerchantRespData);
  34. }
  35. export default {
  36. //查询商户
  37. 'GET /merchant/list': queryMerchant,
  38. };