1234567891011121314151617181920212223242526272829 |
- import SourceService from "../service/source-service.js";
- import ApiResult from "../config/api.js";
- const SourceControl = {
- list: async (req, res) => {
- try {
- const data = await SourceService.list(req.body)
- res.send(new ApiResult().success(data))
- } catch (e) {
- res.send(new ApiResult().error(e))
- }
- },
- page: async (req, res) => {
- try {
- const data = await SourceService.page(req.body)
- res.send(new ApiResult().success(data))
- } catch (e) {
- res.send(new ApiResult().error(e))
- }
- },
- add: async (req, res) => {
- try {
- const data = await SourceService.add(req.body)
- res.send(new ApiResult().success(data))
- } catch (e) {
- res.send(new ApiResult().error(e))
- }
- }
- }
- export default SourceControl
|