123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- import { defHttp } from '/@/utils/http/axios';
- import {
- GetTypeListModel,
- DeleteBatchesParams,
- TypeIdParams,
- AddTypeParams,
- EditTypeParams,
- GetAccountListModel,
- GetTypeModel,
- GetAccountModel,
- AccountIdParams,
- AddAccountParams,
- EditAccountParams,
- } from './model/moneyModel';
- enum Api {
- TypeUrl = '/money/type',
- AccountUrl = '/money/account',
- }
- /**
- * @description: GetTypeList
- */
- export function getTypeList(params) {
- console.log('-------------------getTypeList---------------');
- return defHttp.request<GetTypeListModel>({
- url: Api.TypeUrl,
- method: 'GET',
- params,
- });
- }
- /**
- * @description: addType
- */
- export function addType(params: AddTypeParams) {
- return defHttp.request<GetTypeListModel>({
- url: Api.TypeUrl,
- method: 'POST',
- params,
- });
- }
- /**
- * @description: 批量删除交易类型
- */
- export function deleteBatchesType(params: DeleteBatchesParams) {
- return defHttp.request<GetTypeListModel>({
- url: Api.TypeUrl,
- method: 'DELETE',
- params,
- });
- }
- /**
- * @description: 获取单个交易类型
- */
- export function getType(params: TypeIdParams) {
- return defHttp.request<GetTypeModel>({
- url: Api.TypeUrl + '/' + params.id,
- method: 'GET',
- });
- }
- /**
- * @description: 修改单个交易类型
- */
- export function editType(params: EditTypeParams) {
- return defHttp.request<GetTypeListModel>({
- url: Api.TypeUrl + '/' + params.id,
- method: 'PUT',
- params,
- });
- }
- /**
- * @description: 删除单个会员
- */
- export function deleteType(params: TypeIdParams) {
- return defHttp.request<GetTypeListModel>({
- url: Api.TypeUrl + '/' + params.id,
- method: 'DELETE',
- });
- }
- /**
- * @description: GetAccountList -----------------------------------------------
- */
- export function getAccountList(params) {
- console.log('-------------------getAccountList---------------');
- return defHttp.request<GetAccountListModel>({
- url: Api.AccountUrl,
- method: 'GET',
- params,
- });
- }
- /**
- * @description: addAccount
- */
- export function addAccount(params: AddAccountParams) {
- return defHttp.request<GetAccountListModel>({
- url: Api.AccountUrl,
- method: 'POST',
- params,
- });
- }
- /**
- * @description: 批量删除账户
- */
- export function deleteBatchesAccount(params: DeleteBatchesParams) {
- return defHttp.request<GetAccountListModel>({
- url: Api.AccountUrl,
- method: 'DELETE',
- params,
- });
- }
- /**
- * @description: 获取单个账户
- */
- export function getAccount(params: AccountIdParams) {
- return defHttp.request<GetAccountModel>({
- url: Api.AccountUrl + '/' + params.id,
- method: 'GET',
- });
- }
- /**
- * @description: 修改单个账户
- */
- export function editAccount(params: EditAccountParams) {
- return defHttp.request<GetAccountListModel>({
- url: Api.AccountUrl + '/' + params.id,
- method: 'PUT',
- params,
- });
- }
- /**
- * @description: 删除单个账户
- */
- export function deleteAccount(params: AccountIdParams) {
- return defHttp.request<GetAccountListModel>({
- url: Api.AccountUrl + '/' + params.id,
- method: 'DELETE',
- });
- }
|