2026-05-23 18:45:41 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: request supports shop.js by holding or executing the request page or API role.
|
|
|
|
|
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
*/
|
2026-04-20 16:02:57 +08:00
|
|
|
const request = require('../utils/request')
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
2026-05-23 18:45:41 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: listShops supports shop.js by holding or executing the list shops page or API role.
|
|
|
|
|
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
*/
|
2026-04-20 16:02:57 +08:00
|
|
|
listShops(params) {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/shops/list',
|
|
|
|
|
params
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2026-05-23 18:45:41 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: listAllShops supports shop.js by holding or executing the list all shops page or API role.
|
|
|
|
|
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
*/
|
2026-04-20 16:02:57 +08:00
|
|
|
listAllShops() {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/shops/list/all'
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2026-05-23 18:45:41 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: getShop supports shop.js by holding or executing the get shop page or API role.
|
|
|
|
|
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
*/
|
2026-04-20 16:02:57 +08:00
|
|
|
getShop(id) {
|
|
|
|
|
return request({
|
|
|
|
|
url: `/shops/${id}`
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2026-05-23 18:45:41 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: createShop supports shop.js by holding or executing the create shop page or API role.
|
|
|
|
|
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
*/
|
2026-04-20 16:02:57 +08:00
|
|
|
createShop(data) {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/shops/create',
|
|
|
|
|
method: 'POST',
|
|
|
|
|
data
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2026-05-23 18:45:41 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: updateShop supports shop.js by holding or executing the update shop page or API role.
|
|
|
|
|
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
*/
|
2026-04-20 16:02:57 +08:00
|
|
|
updateShop(id, data) {
|
|
|
|
|
return request({
|
|
|
|
|
url: `/shops/update/${id}`,
|
|
|
|
|
method: 'PUT',
|
|
|
|
|
data
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2026-05-23 18:45:41 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: updateShopStatus supports shop.js by holding or executing the update shop status page or API role.
|
|
|
|
|
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
*/
|
2026-04-20 16:02:57 +08:00
|
|
|
updateShopStatus(id, status) {
|
|
|
|
|
return request({
|
|
|
|
|
url: `/shops/status/${id}`,
|
|
|
|
|
method: 'PUT',
|
|
|
|
|
data: {
|
|
|
|
|
status
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2026-05-23 18:45:41 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: deleteShop supports shop.js by holding or executing the delete shop page or API role.
|
|
|
|
|
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
*/
|
2026-04-20 16:02:57 +08:00
|
|
|
deleteShop(id) {
|
|
|
|
|
return request({
|
|
|
|
|
url: `/shops/delete/${id}`,
|
|
|
|
|
method: 'DELETE'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|