feat: login
This commit is contained in:
@@ -1,94 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import { request } from '@umijs/max';
|
||||
|
||||
/** 获取当前的用户 GET /api/currentUser */
|
||||
export async function currentUser(options?: { [key: string]: any }) {
|
||||
return request<{
|
||||
data: API.CurrentUser;
|
||||
}>('/api/currentUser', {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 退出登录接口 POST /api/login/outLogin */
|
||||
export async function outLogin(options?: { [key: string]: any }) {
|
||||
return request<Record<string, any>>('/api/login/outLogin', {
|
||||
method: 'POST',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 登录接口 POST /api/login/account */
|
||||
export async function login(body: API.LoginParams, options?: { [key: string]: any }) {
|
||||
return request<API.LoginResult>('/api/login/account', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 此处后端没有提供注释 GET /api/notices */
|
||||
export async function getNotices(options?: { [key: string]: any }) {
|
||||
return request<API.NoticeIconList>('/api/notices', {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取规则列表 GET /api/rule */
|
||||
export async function rule(
|
||||
params: {
|
||||
// query
|
||||
/** 当前的页码 */
|
||||
current?: number;
|
||||
/** 页面的容量 */
|
||||
pageSize?: number;
|
||||
},
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.RuleList>('/api/rule', {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 更新规则 PUT /api/rule */
|
||||
export async function updateRule(options?: { [key: string]: any }) {
|
||||
return request<API.RuleListItem>('/api/rule', {
|
||||
method: 'POST',
|
||||
data: {
|
||||
method: 'update',
|
||||
...(options || {}),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/** 新建规则 POST /api/rule */
|
||||
export async function addRule(options?: { [key: string]: any }) {
|
||||
return request<API.RuleListItem>('/api/rule', {
|
||||
method: 'POST',
|
||||
data: {
|
||||
method: 'post',
|
||||
...(options || {}),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除规则 DELETE /api/rule */
|
||||
export async function removeRule(options?: { [key: string]: any }) {
|
||||
return request<Record<string, any>>('/api/rule', {
|
||||
method: 'POST',
|
||||
data: {
|
||||
method: 'delete',
|
||||
...(options || {}),
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import { request } from '@umijs/max';
|
||||
|
||||
/** 发送验证码 POST /api/login/captcha */
|
||||
export async function getFakeCaptcha(
|
||||
params: {
|
||||
// query
|
||||
/** 手机号 */
|
||||
phone?: string;
|
||||
},
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.FakeCaptcha>('/api/login/captcha', {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
101
src/services/ant-design-pro/typings.d.ts
vendored
101
src/services/ant-design-pro/typings.d.ts
vendored
@@ -1,101 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
|
||||
declare namespace API {
|
||||
type CurrentUser = {
|
||||
name?: string;
|
||||
avatar?: string;
|
||||
userid?: string;
|
||||
email?: string;
|
||||
signature?: string;
|
||||
title?: string;
|
||||
group?: string;
|
||||
tags?: { key?: string; label?: string }[];
|
||||
notifyCount?: number;
|
||||
unreadCount?: number;
|
||||
country?: string;
|
||||
access?: string;
|
||||
geographic?: {
|
||||
province?: { label?: string; key?: string };
|
||||
city?: { label?: string; key?: string };
|
||||
};
|
||||
address?: string;
|
||||
phone?: string;
|
||||
};
|
||||
|
||||
type LoginResult = {
|
||||
status?: string;
|
||||
type?: string;
|
||||
currentAuthority?: string;
|
||||
};
|
||||
|
||||
type PageParams = {
|
||||
current?: number;
|
||||
pageSize?: number;
|
||||
};
|
||||
|
||||
type RuleListItem = {
|
||||
key?: number;
|
||||
disabled?: boolean;
|
||||
href?: string;
|
||||
avatar?: string;
|
||||
name?: string;
|
||||
owner?: string;
|
||||
desc?: string;
|
||||
callNo?: number;
|
||||
status?: number;
|
||||
updatedAt?: string;
|
||||
createdAt?: string;
|
||||
progress?: number;
|
||||
};
|
||||
|
||||
type RuleList = {
|
||||
data?: RuleListItem[];
|
||||
/** 列表的内容总数 */
|
||||
total?: number;
|
||||
success?: boolean;
|
||||
};
|
||||
|
||||
type FakeCaptcha = {
|
||||
code?: number;
|
||||
status?: string;
|
||||
};
|
||||
|
||||
type LoginParams = {
|
||||
username?: string;
|
||||
password?: string;
|
||||
autoLogin?: boolean;
|
||||
type?: string;
|
||||
};
|
||||
|
||||
type ErrorResponse = {
|
||||
/** 业务约定的错误码 */
|
||||
errorCode: string;
|
||||
/** 业务上的错误信息 */
|
||||
errorMessage?: string;
|
||||
/** 业务上的请求是否成功 */
|
||||
success?: boolean;
|
||||
};
|
||||
|
||||
type NoticeIconList = {
|
||||
data?: NoticeIconItem[];
|
||||
/** 列表的内容总数 */
|
||||
total?: number;
|
||||
success?: boolean;
|
||||
};
|
||||
|
||||
type NoticeIconItemType = 'notification' | 'message' | 'event';
|
||||
|
||||
type NoticeIconItem = {
|
||||
id?: string;
|
||||
extra?: string;
|
||||
key?: string;
|
||||
read?: boolean;
|
||||
avatar?: string;
|
||||
title?: string;
|
||||
status?: string;
|
||||
datetime?: string;
|
||||
description?: string;
|
||||
type?: NoticeIconItemType;
|
||||
};
|
||||
}
|
||||
153
src/services/login/index.ts
Normal file
153
src/services/login/index.ts
Normal file
@@ -0,0 +1,153 @@
|
||||
import { request } from "@umijs/max";
|
||||
import * as API from "./types";
|
||||
|
||||
export interface SmsCodeVO {
|
||||
mobile: string;
|
||||
scene: number;
|
||||
}
|
||||
|
||||
export interface SmsLoginVO {
|
||||
mobile: string;
|
||||
code: string;
|
||||
}
|
||||
|
||||
// 登录
|
||||
// export const login = (data: UserLoginVO) => {
|
||||
// return request.post({ url: '/system/auth/login', data })
|
||||
// }
|
||||
export async function login(
|
||||
body: API.UserLoginVO,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.TokenType>("/system/auth/login", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
// 注册
|
||||
// export const register = (data: RegisterVO) => {
|
||||
// return request.post({ url: "/system/auth/register", data });
|
||||
// };
|
||||
|
||||
// 使用租户名,获得租户编号
|
||||
// export const getTenantIdByName = (name: string) => {
|
||||
// return request.get({ url: "/system/tenant/get-id-by-name?name=" + name });
|
||||
// };
|
||||
|
||||
export async function getTenantIdByName(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: { name: string },
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request("/system/tenant/get-id-by-name", {
|
||||
method: "GET",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
// 使用租户域名,获得租户信息
|
||||
// export const getTenantByWebsite = (website: string) => {
|
||||
// return request.get({
|
||||
// url: "/system/tenant/get-by-website?website=" + website,
|
||||
// });
|
||||
// };
|
||||
export async function getTenantByWebsite(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: { website: string },
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request("/system/tenant/get-by-website", {
|
||||
method: "GET",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
// 登出
|
||||
// export const loginOut = () => {
|
||||
// return request.post({ url: "/system/auth/logout" });
|
||||
// };
|
||||
export async function loginOut(
|
||||
body: API.UserLoginVO,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request("/system/auth/logout", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
// 获取用户权限信息
|
||||
// export const getInfo = () => {
|
||||
// return request.get({ url: "/system/auth/get-permission-info" });
|
||||
// };
|
||||
export async function getInfo(options?: { [key: string]: any }) {
|
||||
return request<IResponse<{ user: API.UserVO }>>(
|
||||
"/system/auth/get-permission-info",
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
//获取登录验证码
|
||||
// export const sendSmsCode = (data: SmsCodeVO) => {
|
||||
// return request.post({ url: "/system/auth/send-sms-code", data });
|
||||
// };
|
||||
|
||||
// // 短信验证码登录
|
||||
// export const smsLogin = (data: SmsLoginVO) => {
|
||||
// return request.post({ url: "/system/auth/sms-login", data });
|
||||
// };
|
||||
|
||||
// 社交快捷登录,使用 code 授权码
|
||||
// export function socialLogin(type: string, code: string, state: string) {
|
||||
// return request.post({
|
||||
// url: "/system/auth/social-login",
|
||||
// data: {
|
||||
// type,
|
||||
// code,
|
||||
// state,
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
|
||||
// 社交授权的跳转
|
||||
// export const socialAuthRedirect = (type: number, redirectUri: string) => {
|
||||
// return request.get({
|
||||
// url:
|
||||
// "/system/auth/social-auth-redirect?type=" +
|
||||
// type +
|
||||
// "&redirectUri=" +
|
||||
// redirectUri,
|
||||
// });
|
||||
// };
|
||||
// 获取验证图片以及 token
|
||||
// export const getCode = (data: any) => {
|
||||
// debugger;
|
||||
// return request.postOriginal({ url: "system/captcha/get", data });
|
||||
// };
|
||||
|
||||
// 滑动或者点选验证
|
||||
// export const reqCheck = (data: any) => {
|
||||
// return request.postOriginal({ url: "system/captcha/check", data });
|
||||
// };
|
||||
|
||||
// 通过短信重置密码
|
||||
// export const smsResetPassword = (data: any) => {
|
||||
// return request.post({ url: "/system/auth/reset-password", data });
|
||||
// };
|
||||
41
src/services/login/oauth2/index.ts
Normal file
41
src/services/login/oauth2/index.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 获得授权信息
|
||||
export const getAuthorize = (clientId: string) => {
|
||||
return request.get({ url: '/system/oauth2/authorize?clientId=' + clientId })
|
||||
}
|
||||
|
||||
// 发起授权
|
||||
export const authorize = (
|
||||
responseType: string,
|
||||
clientId: string,
|
||||
redirectUri: string,
|
||||
state: string,
|
||||
autoApprove: boolean,
|
||||
checkedScopes: string[],
|
||||
uncheckedScopes: string[]
|
||||
) => {
|
||||
// 构建 scopes
|
||||
const scopes = {}
|
||||
for (const scope of checkedScopes) {
|
||||
scopes[scope] = true
|
||||
}
|
||||
for (const scope of uncheckedScopes) {
|
||||
scopes[scope] = false
|
||||
}
|
||||
// 发起请求
|
||||
return request.post({
|
||||
url: '/system/oauth2/authorize',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
params: {
|
||||
response_type: responseType,
|
||||
client_id: clientId,
|
||||
redirect_uri: redirectUri,
|
||||
state: state,
|
||||
auto_approve: autoApprove,
|
||||
scope: JSON.stringify(scopes)
|
||||
}
|
||||
})
|
||||
}
|
||||
38
src/services/login/types.ts
Normal file
38
src/services/login/types.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
export type UserLoginVO = {
|
||||
username: string
|
||||
password: string
|
||||
captchaVerification: string
|
||||
socialType?: string
|
||||
socialCode?: string
|
||||
socialState?: string
|
||||
}
|
||||
|
||||
export type TokenType = {
|
||||
id: number // 编号
|
||||
accessToken: string // 访问令牌
|
||||
refreshToken: string // 刷新令牌
|
||||
userId: number // 用户编号
|
||||
userType: number //用户类型
|
||||
clientId: string //客户端编号
|
||||
expiresTime: number //过期时间
|
||||
}
|
||||
|
||||
export type UserVO = {
|
||||
id: number
|
||||
username: string
|
||||
nickname: string
|
||||
deptId: number
|
||||
email: string
|
||||
mobile: string
|
||||
sex: number
|
||||
avatar: string
|
||||
loginIp: string
|
||||
loginDate: string
|
||||
}
|
||||
|
||||
export type RegisterVO = {
|
||||
tenantName: string
|
||||
username: string
|
||||
password: string
|
||||
captchaVerification: string
|
||||
}
|
||||
51
src/services/prodApi/category.ts
Normal file
51
src/services/prodApi/category.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import { request } from "@umijs/max";
|
||||
|
||||
/** 获取菜单页面的表 GET /product/category/categoryList */
|
||||
export async function getProductCategoryCategoryList(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.getProductCategoryCategoryListParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultListCategoryDto>(
|
||||
"/product/category/categoryList",
|
||||
{
|
||||
method: "GET",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 创建产品类目 创建产品类目 POST /product/category/create */
|
||||
export async function postProductCategoryCreate(
|
||||
body: API.CategorySaveReqVO,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultLong>("/product/category/create", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 更新产品类目 更新产品类目 PUT /product/category/update */
|
||||
export async function putProductCategoryUpdate(
|
||||
body: API.CategorySaveReqVO,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/category/update", {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
/* eslint-disable */
|
||||
// API 更新时间:
|
||||
// API 唯一标识:
|
||||
import * as api from './api';
|
||||
import * as login from './login';
|
||||
import * as product from "./product";
|
||||
import * as category from "./category";
|
||||
export default {
|
||||
api,
|
||||
login,
|
||||
product,
|
||||
category,
|
||||
};
|
||||
601
src/services/prodApi/product.ts
Normal file
601
src/services/prodApi/product.ts
Normal file
@@ -0,0 +1,601 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import { request } from "@umijs/max";
|
||||
|
||||
/** 创建商品 创建商品 POST /prod/create */
|
||||
export async function postProdCreate(
|
||||
body: API.ProdSaveReqVO,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultLong>("/prod/create", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 创建商品 创建商品 POST /product/prod/create */
|
||||
export async function postProductProdCreate(
|
||||
body: API.ProdSaveReqVO,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultLong>("/product/prod/create", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 创建商品服务配置 创建商品服务配置 POST /product/prod/createProdService */
|
||||
export async function postProductProdCreateProdService(
|
||||
body: API.ProdServiceVO,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/prod/createProdService", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除商品 删除商品 DELETE /product/prod/delete */
|
||||
export async function deleteProductProdOpenApiDelete(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.deleteProductProd_openAPI_deleteParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/prod/delete", {
|
||||
method: "DELETE",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 批量删除商品 批量删除商品 DELETE /product/prod/deleteSkuList */
|
||||
export async function deleteProductProdDeleteSkuList(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.deleteProductProdDeleteSkuListParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/prod/deleteSkuList", {
|
||||
method: "DELETE",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获得商品回收站分页列表 获得商品回收站分页列表 GET /product/prod/getProdRecycleBinPageList */
|
||||
export async function getProductProdGetProdRecycleBinPageList(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.getProductProdGetProdRecycleBinPageListParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultPageResultProdRestoreListVO>(
|
||||
"/product/prod/getProdRecycleBinPageList",
|
||||
{
|
||||
method: "GET",
|
||||
params: {
|
||||
// pageNo has a default value: 1
|
||||
pageNo: "1",
|
||||
// pageSize has a default value: 10
|
||||
pageSize: "10",
|
||||
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得商品服务信息 获得商品服务信息 GET /product/prod/getProdService */
|
||||
export async function getProductProdGetProdService(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.getProductProdGetProdServiceParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultProdServiceVO>(
|
||||
"/product/prod/getProdService",
|
||||
{
|
||||
method: "GET",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得商品分页 获得商品分页 GET /product/prod/page */
|
||||
export async function getProductProdPage(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.getProductProdPageParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultPageResultProdListVO>("/product/prod/page", {
|
||||
method: "GET",
|
||||
params: {
|
||||
// pageNo has a default value: 1
|
||||
pageNo: "1",
|
||||
// pageSize has a default value: 10
|
||||
pageSize: "10",
|
||||
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 恢复商品 恢复商品 POST /product/prod/restoreProdList */
|
||||
export async function postProductProdRestoreProdList(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.postProductProdRestoreProdListParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/prod/restoreProdList", {
|
||||
method: "POST",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 更新商品 更新商品 PUT /product/prod/update */
|
||||
export async function putProductProdUpdate(
|
||||
body: API.ProdSaveReqVO,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/prod/update", {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 批量上下架 批量上下架 DELETE /product/prod/updateSkuShelfList */
|
||||
export async function deleteProductProdUpdateSkuShelfList(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.deleteProductProdUpdateSkuShelfListParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/prod/updateSkuShelfList", {
|
||||
method: "DELETE",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改商品服务配置 修改商品服务配置 POST /product/prod/uptateProdService */
|
||||
export async function postProductProdUptateProdService(
|
||||
body: API.ProdServiceInfoVO,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/prod/uptateProdService", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 创建sku扩展服务配置 创建sku扩展服务配置 POST /product/sku/createSkuExtend */
|
||||
export async function postProductSkuCreateSkuExtend(
|
||||
body: API.SkuExtendVO,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/sku/createSkuExtend", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除单品SKU 删除单品SKU DELETE /product/sku/delete */
|
||||
export async function deleteProductSkuOpenApiDelete(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.deleteProductSku_openAPI_deleteParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/sku/delete", {
|
||||
method: "DELETE",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除规格值 删除规格值 PUT /product/sku/deleteProp */
|
||||
export async function putProductSkuDeleteProp(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.putProductSkuDeletePropParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/sku/deleteProp", {
|
||||
method: "PUT",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 批量删除SKU 批量删除SKU DELETE /product/sku/deleteSkuList */
|
||||
export async function deleteProductSkuDeleteSkuList(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.deleteProductSkuDeleteSkuListParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/sku/deleteSkuList", {
|
||||
method: "DELETE",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 禁用或者启用规格值 禁用规格值 PUT /product/sku/disableProp */
|
||||
export async function putProductSkuDisableProp(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.putProductSkuDisablePropParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/sku/disableProp", {
|
||||
method: "PUT",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获得单品SKU 获得单品SKU GET /product/sku/get */
|
||||
export async function getProductSkuGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.getProductSkuGetParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultSkuRespVO>("/product/sku/get", {
|
||||
method: "GET",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取规格回收站 获取规格回收站 GET /product/sku/getPropRecycleBinList */
|
||||
export async function getProductSkuGetPropRecycleBinList(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.getProductSkuGetPropRecycleBinListParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultPageResultProPropRecycleBinVO>(
|
||||
"/product/sku/getPropRecycleBinList",
|
||||
{
|
||||
method: "GET",
|
||||
params: {
|
||||
// pageNo has a default value: 1
|
||||
pageNo: "1",
|
||||
// pageSize has a default value: 10
|
||||
pageSize: "10",
|
||||
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取sku扩展服务配置信息 获取sku扩展服务配置信息 POST /product/sku/getSkuExtend */
|
||||
export async function postProductSkuGetSkuExtend(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.postProductSkuGetSkuExtendParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultSkuExtendVO>("/product/sku/getSkuExtend", {
|
||||
method: "POST",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获得SKU分页列表 获得SKU分页列表 GET /product/sku/getSkuPageList */
|
||||
export async function getProductSkuGetSkuPageList(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.getProductSkuGetSkuPageListParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultPageResultSkuDO>(
|
||||
"/product/sku/getSkuPageList",
|
||||
{
|
||||
method: "GET",
|
||||
params: {
|
||||
// pageNo has a default value: 1
|
||||
pageNo: "1",
|
||||
// pageSize has a default value: 10
|
||||
pageSize: "10",
|
||||
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取sku规格 获取sku规格 GET /product/sku/getSKuPropList */
|
||||
export async function getProductSkuGetSKuPropList(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.getProductSkuGetSKuPropListParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultSkuPropInfoVO>("/product/sku/getSKuPropList", {
|
||||
method: "GET",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获得SKU回收站分页列表 获得SKU回收站分页列表 GET /product/sku/getSkuRecycleBinPageList */
|
||||
export async function getProductSkuGetSkuRecycleBinPageList(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.getProductSkuGetSkuRecycleBinPageListParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultPageResultSkuRecycleBinVO>(
|
||||
"/product/sku/getSkuRecycleBinPageList",
|
||||
{
|
||||
method: "GET",
|
||||
params: {
|
||||
// pageNo has a default value: 1
|
||||
pageNo: "1",
|
||||
// pageSize has a default value: 10
|
||||
pageSize: "10",
|
||||
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 恢复规格 恢复规格 POST /product/sku/restorePropList */
|
||||
export async function postProductSkuRestorePropList(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.postProductSkuRestorePropListParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/sku/restorePropList", {
|
||||
method: "POST",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 恢复SKU 恢复SKU POST /product/sku/restoreSkuList */
|
||||
export async function postProductSkuRestoreSkuList(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.postProductSkuRestoreSkuListParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/sku/restoreSkuList", {
|
||||
method: "POST",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 更新单品SKU 更新单品SKU PUT /product/sku/update */
|
||||
export async function putProductSkuUpdate(
|
||||
body: API.SkuSaveReqVO,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/sku/update", {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改配送方式 修改配送方式 POST /product/sku/updateDeliver */
|
||||
export async function postProductSkuUpdateDeliver(
|
||||
body: API.SkuServiceDeliverDO[],
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/sku/updateDeliver", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 修物料配置 修物料配置 POST /product/sku/updateMaterial */
|
||||
export async function postProductSkuUpdateMaterial(
|
||||
body: API.SkuServiceMaterialDO[],
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/sku/updateMaterial", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改属性规格值 修改属性规格值 PUT /product/sku/updateProdProp */
|
||||
export async function putProductSkuUpdateProdProp(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.putProductSkuUpdateProdPropParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/sku/updateProdProp", {
|
||||
method: "PUT",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 新增统一保存sku规格 更新sku规格 PUT /product/sku/updateProp */
|
||||
export async function putProductSkuUpdateProp(
|
||||
body: API.SkuPropVO,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/sku/updateProp", {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改属性下面规格值 修改属性下面规格值 PUT /product/sku/updatePropValue */
|
||||
export async function putProductSkuUpdatePropValue(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.putProductSkuUpdatePropValueParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/sku/updatePropValue", {
|
||||
method: "PUT",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改扩展服务信息配置(遗体接运扩展服务,遗体清洁配置,追思告别配置,骨灰处理配置......) 修改扩展服务信息配置(遗体接运扩展服务,遗体清洁配置,追思告别配置,骨灰处理配置......) POST /product/sku/updateServiceDetails */
|
||||
export async function postProductSkuUpdateServiceDetails(
|
||||
body: API.SkuServiceDetailsDO[],
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/sku/updateServiceDetails", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改单品上下架 修改单品上下架 PUT /product/sku/updateSkuShelf */
|
||||
export async function putProductSkuUpdateSkuShelf(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.putProductSkuUpdateSkuShelfParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/sku/updateSkuShelf", {
|
||||
method: "PUT",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改单品上下架 修改单品上下架 POST /product/sku/updateSkuShelf */
|
||||
export async function postProductSkuUpdateSkuShelf(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.postProductSkuUpdateSkuShelfParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/sku/updateSkuShelf", {
|
||||
method: "POST",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 批量上下架 批量上下架 PUT /product/sku/updateSkuShelfList */
|
||||
export async function putProductSkuUpdateSkuShelfList(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.putProductSkuUpdateSkuShelfListParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/sku/updateSkuShelfList", {
|
||||
method: "PUT",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 批量上下架 批量上下架 POST /product/sku/updateSkuShelfList */
|
||||
export async function postProductSkuUpdateSkuShelfList(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.postProductSkuUpdateSkuShelfListParams,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>("/product/sku/updateSkuShelfList", {
|
||||
method: "POST",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改接运地址配置 修改接运地址配置 POST /product/sku/updateTransportAdress */
|
||||
export async function postProductSkuUpdateTransportAdress(
|
||||
body: API.SkuServiceTransportDO[],
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.CommonResultBoolean>(
|
||||
"/product/sku/updateTransportAdress",
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
2086
src/services/prodApi/typings.d.ts
vendored
Normal file
2086
src/services/prodApi/typings.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,12 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
// API 更新时间:
|
||||
// API 唯一标识:
|
||||
import * as pet from './pet';
|
||||
import * as store from './store';
|
||||
import * as user from './user';
|
||||
export default {
|
||||
pet,
|
||||
store,
|
||||
user,
|
||||
};
|
||||
@@ -1,153 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import { request } from '@umijs/max';
|
||||
|
||||
/** Update an existing pet PUT /pet */
|
||||
export async function updatePet(body: API.Pet, options?: { [key: string]: any }) {
|
||||
return request<any>('/pet', {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Add a new pet to the store POST /pet */
|
||||
export async function addPet(body: API.Pet, options?: { [key: string]: any }) {
|
||||
return request<any>('/pet', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Find pet by ID Returns a single pet GET /pet/${param0} */
|
||||
export async function getPetById(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.getPetByIdParams,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
const { petId: param0, ...queryParams } = params;
|
||||
return request<API.Pet>(`/pet/${param0}`, {
|
||||
method: 'GET',
|
||||
params: { ...queryParams },
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Updates a pet in the store with form data POST /pet/${param0} */
|
||||
export async function updatePetWithForm(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.updatePetWithFormParams,
|
||||
body: { name?: string; status?: string },
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
const { petId: param0, ...queryParams } = params;
|
||||
const formData = new FormData();
|
||||
|
||||
Object.keys(body).forEach((ele) => {
|
||||
const item = (body as any)[ele];
|
||||
|
||||
if (item !== undefined && item !== null) {
|
||||
formData.append(
|
||||
ele,
|
||||
typeof item === 'object' && !(item instanceof File) ? JSON.stringify(item) : item,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
return request<any>(`/pet/${param0}`, {
|
||||
method: 'POST',
|
||||
params: { ...queryParams },
|
||||
data: formData,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Deletes a pet DELETE /pet/${param0} */
|
||||
export async function deletePet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.deletePetParams & {
|
||||
// header
|
||||
api_key?: string;
|
||||
},
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
const { petId: param0, ...queryParams } = params;
|
||||
return request<any>(`/pet/${param0}`, {
|
||||
method: 'DELETE',
|
||||
headers: {},
|
||||
params: { ...queryParams },
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** uploads an image POST /pet/${param0}/uploadImage */
|
||||
export async function uploadFile(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.uploadFileParams,
|
||||
body: { additionalMetadata?: string; file?: string },
|
||||
file?: File,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
const { petId: param0, ...queryParams } = params;
|
||||
const formData = new FormData();
|
||||
|
||||
if (file) {
|
||||
formData.append('file', file);
|
||||
}
|
||||
|
||||
Object.keys(body).forEach((ele) => {
|
||||
const item = (body as any)[ele];
|
||||
|
||||
if (item !== undefined && item !== null) {
|
||||
formData.append(
|
||||
ele,
|
||||
typeof item === 'object' && !(item instanceof File) ? JSON.stringify(item) : item,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
return request<API.ApiResponse>(`/pet/${param0}/uploadImage`, {
|
||||
method: 'POST',
|
||||
params: { ...queryParams },
|
||||
data: formData,
|
||||
requestType: 'form',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Finds Pets by status Multiple status values can be provided with comma separated strings GET /pet/findByStatus */
|
||||
export async function findPetsByStatus(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.findPetsByStatusParams,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.Pet[]>('/pet/findByStatus', {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Finds Pets by tags Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. GET /pet/findByTags */
|
||||
export async function findPetsByTags(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.findPetsByTagsParams,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.Pet[]>('/pet/findByTags', {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import { request } from '@umijs/max';
|
||||
|
||||
/** Returns pet inventories by status Returns a map of status codes to quantities GET /store/inventory */
|
||||
export async function getInventory(options?: { [key: string]: any }) {
|
||||
return request<Record<string, any>>('/store/inventory', {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Place an order for a pet POST /store/order */
|
||||
export async function placeOrder(body: API.Order, options?: { [key: string]: any }) {
|
||||
return request<API.Order>('/store/order', {
|
||||
method: 'POST',
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Find purchase order by ID For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions GET /store/order/${param0} */
|
||||
export async function getOrderById(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.getOrderByIdParams,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
const { orderId: param0, ...queryParams } = params;
|
||||
return request<API.Order>(`/store/order/${param0}`, {
|
||||
method: 'GET',
|
||||
params: { ...queryParams },
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Delete purchase order by ID For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors DELETE /store/order/${param0} */
|
||||
export async function deleteOrder(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.deleteOrderParams,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
const { orderId: param0, ...queryParams } = params;
|
||||
return request<any>(`/store/order/${param0}`, {
|
||||
method: 'DELETE',
|
||||
params: { ...queryParams },
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
112
src/services/swagger/typings.d.ts
vendored
112
src/services/swagger/typings.d.ts
vendored
@@ -1,112 +0,0 @@
|
||||
declare namespace API {
|
||||
type ApiResponse = {
|
||||
code?: number;
|
||||
type?: string;
|
||||
message?: string;
|
||||
};
|
||||
|
||||
type Category = {
|
||||
id?: number;
|
||||
name?: string;
|
||||
};
|
||||
|
||||
type deleteOrderParams = {
|
||||
/** ID of the order that needs to be deleted */
|
||||
orderId: number;
|
||||
};
|
||||
|
||||
type deletePetParams = {
|
||||
api_key?: string;
|
||||
/** Pet id to delete */
|
||||
petId: number;
|
||||
};
|
||||
|
||||
type deleteUserParams = {
|
||||
/** The name that needs to be deleted */
|
||||
username: string;
|
||||
};
|
||||
|
||||
type findPetsByStatusParams = {
|
||||
/** Status values that need to be considered for filter */
|
||||
status: ('available' | 'pending' | 'sold')[];
|
||||
};
|
||||
|
||||
type findPetsByTagsParams = {
|
||||
/** Tags to filter by */
|
||||
tags: string[];
|
||||
};
|
||||
|
||||
type getOrderByIdParams = {
|
||||
/** ID of pet that needs to be fetched */
|
||||
orderId: number;
|
||||
};
|
||||
|
||||
type getPetByIdParams = {
|
||||
/** ID of pet to return */
|
||||
petId: number;
|
||||
};
|
||||
|
||||
type getUserByNameParams = {
|
||||
/** The name that needs to be fetched. Use user1 for testing. */
|
||||
username: string;
|
||||
};
|
||||
|
||||
type loginUserParams = {
|
||||
/** The user name for login */
|
||||
username: string;
|
||||
/** The password for login in clear text */
|
||||
password: string;
|
||||
};
|
||||
|
||||
type Order = {
|
||||
id?: number;
|
||||
petId?: number;
|
||||
quantity?: number;
|
||||
shipDate?: string;
|
||||
/** Order Status */
|
||||
status?: 'placed' | 'approved' | 'delivered';
|
||||
complete?: boolean;
|
||||
};
|
||||
|
||||
type Pet = {
|
||||
id?: number;
|
||||
category?: Category;
|
||||
name: string;
|
||||
photoUrls: string[];
|
||||
tags?: Tag[];
|
||||
/** pet status in the store */
|
||||
status?: 'available' | 'pending' | 'sold';
|
||||
};
|
||||
|
||||
type Tag = {
|
||||
id?: number;
|
||||
name?: string;
|
||||
};
|
||||
|
||||
type updatePetWithFormParams = {
|
||||
/** ID of pet that needs to be updated */
|
||||
petId: number;
|
||||
};
|
||||
|
||||
type updateUserParams = {
|
||||
/** name that need to be updated */
|
||||
username: string;
|
||||
};
|
||||
|
||||
type uploadFileParams = {
|
||||
/** ID of pet to update */
|
||||
petId: number;
|
||||
};
|
||||
|
||||
type User = {
|
||||
id?: number;
|
||||
username?: string;
|
||||
firstName?: string;
|
||||
lastName?: string;
|
||||
email?: string;
|
||||
password?: string;
|
||||
phone?: string;
|
||||
/** User Status */
|
||||
userStatus?: number;
|
||||
};
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import { request } from '@umijs/max';
|
||||
|
||||
/** Create user This can only be done by the logged in user. POST /user */
|
||||
export async function createUser(body: API.User, options?: { [key: string]: any }) {
|
||||
return request<any>('/user', {
|
||||
method: 'POST',
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Get user by user name GET /user/${param0} */
|
||||
export async function getUserByName(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.getUserByNameParams,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
const { username: param0, ...queryParams } = params;
|
||||
return request<API.User>(`/user/${param0}`, {
|
||||
method: 'GET',
|
||||
params: { ...queryParams },
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Updated user This can only be done by the logged in user. PUT /user/${param0} */
|
||||
export async function updateUser(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.updateUserParams,
|
||||
body: API.User,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
const { username: param0, ...queryParams } = params;
|
||||
return request<any>(`/user/${param0}`, {
|
||||
method: 'PUT',
|
||||
params: { ...queryParams },
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Delete user This can only be done by the logged in user. DELETE /user/${param0} */
|
||||
export async function deleteUser(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.deleteUserParams,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
const { username: param0, ...queryParams } = params;
|
||||
return request<any>(`/user/${param0}`, {
|
||||
method: 'DELETE',
|
||||
params: { ...queryParams },
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Creates list of users with given input array POST /user/createWithArray */
|
||||
export async function createUsersWithArrayInput(
|
||||
body: API.User[],
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<any>('/user/createWithArray', {
|
||||
method: 'POST',
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Creates list of users with given input array POST /user/createWithList */
|
||||
export async function createUsersWithListInput(body: API.User[], options?: { [key: string]: any }) {
|
||||
return request<any>('/user/createWithList', {
|
||||
method: 'POST',
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Logs user into the system GET /user/login */
|
||||
export async function loginUser(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.loginUserParams,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<string>('/user/login', {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Logs out current logged in user session GET /user/logout */
|
||||
export async function logoutUser(options?: { [key: string]: any }) {
|
||||
return request<any>('/user/logout', {
|
||||
method: 'GET',
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
0
src/services/system/index.ts
Normal file
0
src/services/system/index.ts
Normal file
119
src/services/system/permission/index.ts
Normal file
119
src/services/system/permission/index.ts
Normal file
@@ -0,0 +1,119 @@
|
||||
import { request } from "@umijs/max";
|
||||
|
||||
export interface PermissionAssignUserRoleReqVO {
|
||||
userId: number;
|
||||
roleIds: number[];
|
||||
}
|
||||
|
||||
export interface PermissionAssignRoleMenuReqVO {
|
||||
roleId: number;
|
||||
menuIds: number[];
|
||||
}
|
||||
|
||||
export interface PermissionAssignRoleDataScopeReqVO {
|
||||
roleId: number;
|
||||
dataScope: number;
|
||||
dataScopeDeptIds: number[];
|
||||
}
|
||||
|
||||
// export async function postProductProdRestoreProdList(
|
||||
// // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
// params: API.postProductProdRestoreProdListParams,
|
||||
// options?: { [key: string]: any }
|
||||
// ) {
|
||||
// return request<API.CommonResultBoolean>("/product/prod/restoreProdList", {
|
||||
// method: "POST",
|
||||
// params: {
|
||||
// ...params,
|
||||
// },
|
||||
// ...(options || {}),
|
||||
// });
|
||||
// }
|
||||
// export async function getRoleMenuList(
|
||||
// // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
// params: API.getProductCategoryCategoryListParams,
|
||||
// options?: { [key: string]: any }
|
||||
// ) {
|
||||
// return request<API.CommonResultListCategoryDto>(
|
||||
// "/product/category/categoryList",
|
||||
// {
|
||||
// method: "GET",
|
||||
// params: {
|
||||
// ...params,
|
||||
// },
|
||||
// ...(options || {}),
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
// 查询角色拥有的菜单权限
|
||||
// export const getRoleMenuList = async (roleId: number) => {
|
||||
// return await request.get({ url: '/system/permission/list-role-menus?roleId=' + roleId })
|
||||
// }
|
||||
export async function getRoleMenuList(roleId: number) {
|
||||
return request("/system/permission/list-role-menus", {
|
||||
method: "GET",
|
||||
params: {
|
||||
roleId,
|
||||
},
|
||||
});
|
||||
}
|
||||
// // 赋予角色菜单权限
|
||||
// export const assignRoleMenu = async (data: PermissionAssignRoleMenuReqVO) => {
|
||||
// return await request.post({ url: '/system/permission/assign-role-menu', data })
|
||||
// }
|
||||
export async function assignRoleMenu(
|
||||
params: PermissionAssignRoleMenuReqVO,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request("/system/permission/assign-role-menu", {
|
||||
method: "POST",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
// // 赋予角色数据权限
|
||||
// export const assignRoleDataScope = async (data: PermissionAssignRoleDataScopeReqVO) => {
|
||||
// return await request.post({ url: '/system/permission/assign-role-data-scope', data })
|
||||
// }
|
||||
export async function assignRoleDataScope(
|
||||
params: PermissionAssignRoleDataScopeReqVO,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request("/system/permission/assign-role-data-scope", {
|
||||
method: "POST",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
// // 查询用户拥有的角色数组
|
||||
// export const getUserRoleList = async (userId: number) => {
|
||||
// return await request.get({ url: '/system/permission/list-user-roles?userId=' + userId })
|
||||
// }
|
||||
export async function getUserRoleList(userId: number) {
|
||||
return request("/system/permission/list-user-roles", {
|
||||
method: "GET",
|
||||
params: {
|
||||
userId,
|
||||
},
|
||||
});
|
||||
}
|
||||
// // 赋予用户角色
|
||||
// export const assignUserRole = async (data: PermissionAssignUserRoleReqVO) => {
|
||||
// return await request.post({ url: '/system/permission/assign-user-role', data })
|
||||
// }
|
||||
export async function assignUserRole(
|
||||
params: PermissionAssignUserRoleReqVO,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request("/system/permission/assign-user-role", {
|
||||
method: "POST",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
0
src/services/system/typings.d.ts
vendored
Normal file
0
src/services/system/typings.d.ts
vendored
Normal file
Reference in New Issue
Block a user