initial commit

This commit is contained in:
2022-11-11 17:03:31 +07:00
commit 065551deb3
85 changed files with 16767 additions and 0 deletions

19
repository/ask.js Normal file
View File

@@ -0,0 +1,19 @@
import {http} from "../utils/http";
const url = {
contacts: () => '/product/api/v5/customer-service'
}
const hooks = {}
const api = {
async getContacts() {
return await http.fetcher(url.contacts())
},
}
export const askRepository = {
url,
hooks,
api
}

31
repository/bots.js Normal file
View File

@@ -0,0 +1,31 @@
import {http} from "../utils/http";
import useSWR from "swr";
const url = {
findAllLockeyInLocations: (qrCode) => `/bots/find-all/Lockey/${qrCode}`,
findLocationByQrCode: (qrCode) => `/locations/findOne/${qrCode}`,
createOrder: () => `/bots/create-order`,
checkTransaction: (orderId) => `/bots/find/one-history/${orderId}`,
}
const hooks = {
useGetAllLockey(qrCode) {
return useSWR(url.findAllLockeyInLocations(qrCode), http.fetcher);
},
useGetLocationByQR(qrCode) {
return useSWR(url.findLocationByQrCode(qrCode), http.fetcher);
}
}
const api = {
async useCheckTransactionByOrderId(orderId) {
const res = await http.fetcher(url.checkTransaction(orderId));
return res
},
}
export const botsRepository = {
url,
hooks,
api
}

19
repository/order.js Normal file
View File

@@ -0,0 +1,19 @@
import {http} from "../utils/http";
const url = {
payment: () => '/usermanagement/api/v5/validate/check-phone-register'
}
const hooks = {}
const api = {
async usePayment(data) {
return await http.post(url.payment, data)
},
}
export const orderRepository = {
url,
hooks,
api
}