feat(sgw): Implement Create or Update Banzone functionality with map integration
This commit is contained in:
36
src/services/slave/sgw/FishController.ts
Normal file
36
src/services/slave/sgw/FishController.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import {
|
||||
SGW_ROUTE_CREATE_OR_UPDATE_FISH,
|
||||
SGW_ROUTE_GET_FISH,
|
||||
} from '@/constants/slave/sgw/routes';
|
||||
import { request } from '@umijs/max';
|
||||
|
||||
export async function apiGetFishSpecies(
|
||||
body?: SgwModel.SearchFishPaginationBody,
|
||||
): Promise<SgwModel.FishSpeciesResponse> {
|
||||
return request<SgwModel.FishSpeciesResponse>(SGW_ROUTE_GET_FISH, {
|
||||
method: 'POST',
|
||||
data: body,
|
||||
});
|
||||
}
|
||||
|
||||
export async function apiCreateFishSpecies(body?: SgwModel.Fish) {
|
||||
return request<SgwModel.CreateFishResponse>(SGW_ROUTE_CREATE_OR_UPDATE_FISH, {
|
||||
method: 'POST',
|
||||
data: [body],
|
||||
getResponse: true,
|
||||
});
|
||||
}
|
||||
|
||||
export async function apiUpdateFishSpecies(body?: SgwModel.Fish) {
|
||||
return request(SGW_ROUTE_CREATE_OR_UPDATE_FISH, {
|
||||
method: 'PUT',
|
||||
data: body,
|
||||
getResponse: true,
|
||||
});
|
||||
}
|
||||
export async function apiDeleteFishSpecies(id?: string) {
|
||||
return request(`${SGW_ROUTE_CREATE_OR_UPDATE_FISH}/${id}`, {
|
||||
method: 'DELETE',
|
||||
getResponse: true,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user