2024-08-20 12:11:31 +00:00
|
|
|
/**
|
|
|
|
* Created by HaijunZhang on 2019/7/23.
|
|
|
|
*/
|
|
|
|
import { request } from '@cmp/cmp-element'
|
|
|
|
import { wrapperParams } from 'utils/index'
|
|
|
|
import { IDepart } from '@/models/depart'
|
|
|
|
|
|
|
|
const baseUrl = '/sms/v1/departments'
|
|
|
|
|
|
|
|
export function getDepart(params: any) {
|
|
|
|
return request.get(baseUrl, {
|
|
|
|
params
|
|
|
|
})
|
|
|
|
}
|
|
|
|
export function getDepartDetail(id: number) {
|
|
|
|
return request.get(`${baseUrl}/${id}`)
|
|
|
|
}
|
2024-08-21 01:17:14 +00:00
|
|
|
export function createDepart(params: IDepart) {
|
2024-08-20 12:11:31 +00:00
|
|
|
return request.post(baseUrl, wrapperParams(params))
|
|
|
|
}
|
2024-08-21 01:17:14 +00:00
|
|
|
export function modifyDepart(params: IDepart) {
|
2024-08-20 12:11:31 +00:00
|
|
|
return request.put(`${baseUrl}/${params.id}`, wrapperParams(params))
|
|
|
|
}
|
2024-08-21 01:17:14 +00:00
|
|
|
export function removeDepart(id: number) {
|
2024-08-20 12:11:31 +00:00
|
|
|
return request.delete(`${baseUrl}/${id}`)
|
|
|
|
}
|