Files
JayuCloud/JC-ArtList-WeChat/api/comment.js
T

41 lines
1.3 KiB
JavaScript
Raw Normal View History

/**
* Mini program API wrapper for this module.
* Call guide: require this module in a page, then invoke the matching method from page event handlers or lifecycle hooks.
*/
const request = require('../utils/request')
module.exports = {
2026-05-23 18:45:41 +08:00
/**
* Purpose: listByProduct supports comment.js by holding or executing the list by product 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.
*/
listByProduct(productId) {
return request({
url: `/comment/list/product/${productId}`
})
},
2026-05-23 18:45:41 +08:00
/**
* Purpose: create supports comment.js by holding or executing the create 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.
*/
create(data) {
return request({
url: '/comment/create',
method: 'POST',
data
})
},
2026-05-23 18:45:41 +08:00
/**
* Purpose: delete supports comment.js by holding or executing the delete 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.
*/
delete(id) {
return request({
url: `/comment/delete/${id}`,
method: 'DELETE'
})
}
}