256 lines
4.1 KiB
TypeScript
256 lines
4.1 KiB
TypeScript
import request from "@/utils/request";
|
||
import { Account_BaseUrl } from "@/api/config";
|
||
const baseURL = Account_BaseUrl + "/admin/shopStaff";
|
||
const ShopStaffApi = {
|
||
getList(params: getListRequest) {
|
||
return request<any, getListResponse>({
|
||
url: `${baseURL}`,
|
||
method: "get",
|
||
params: params,
|
||
});
|
||
},
|
||
get(id: number | string) {
|
||
return request<any>({
|
||
url: `${baseURL}/detail`,
|
||
method: "get",
|
||
params: { id }
|
||
});
|
||
},
|
||
add(data: addRequest) {
|
||
return request<any>({
|
||
url: `${baseURL}`,
|
||
method: "post",
|
||
data,
|
||
});
|
||
},
|
||
edit(data: editRequest) {
|
||
return request<any>({
|
||
url: `${baseURL}`,
|
||
method: "put",
|
||
data,
|
||
});
|
||
},
|
||
delete(id: number | string) {
|
||
return request<any>({
|
||
url: `${baseURL}`,
|
||
method: "delete",
|
||
data: {
|
||
id
|
||
}
|
||
});
|
||
},
|
||
};
|
||
|
||
export default ShopStaffApi;
|
||
|
||
export interface getListRequest {
|
||
/**
|
||
* 员工编号
|
||
*/
|
||
code?: string;
|
||
/**
|
||
* 账号名
|
||
*/
|
||
name?: string;
|
||
[property: string]: any;
|
||
}
|
||
/**
|
||
* 分页数据
|
||
*
|
||
* CzgResult«Page«ShopStaff»»
|
||
*/
|
||
export interface getListResponse {
|
||
code?: number | null;
|
||
data?: PageShopStaff;
|
||
msg?: null | string;
|
||
[property: string]: any;
|
||
}
|
||
|
||
/**
|
||
* Page«ShopStaff»
|
||
*/
|
||
export interface PageShopStaff {
|
||
/**
|
||
* 每页数据数量最大限制。
|
||
*/
|
||
maxPageSize?: number | null;
|
||
/**
|
||
* 是否优化分页查询 COUNT 语句。
|
||
*/
|
||
optimizeCountQuery?: boolean | null;
|
||
/**
|
||
* 当前页码。
|
||
*/
|
||
pageNumber?: number | null;
|
||
/**
|
||
* 每页数据数量。
|
||
*/
|
||
pageSize?: number | null;
|
||
/**
|
||
* 当前页数据。
|
||
*/
|
||
records?: ShopStaff[] | null;
|
||
/**
|
||
* 总页数。
|
||
*/
|
||
totalPage?: number | null;
|
||
/**
|
||
* 总数据数量。
|
||
*/
|
||
totalRow?: number | null;
|
||
[property: string]: any;
|
||
}
|
||
|
||
/**
|
||
* 店铺员工 实体类。
|
||
*
|
||
* ShopStaff
|
||
*/
|
||
export interface ShopStaff {
|
||
/**
|
||
* 员工编号
|
||
*/
|
||
code?: null | string;
|
||
createTime?: null | string;
|
||
/**
|
||
* 优惠类型 1 折扣 0 金额
|
||
*/
|
||
discountType?: null | string;
|
||
/**
|
||
* 使用系统用户 sys_user id
|
||
*/
|
||
id?: number | null;
|
||
/**
|
||
* 是否允许管理端登录 0:不允许;1:允许
|
||
*/
|
||
isManage?: number | null;
|
||
/**
|
||
* 是否允许pc端登录 0:不允许;1:允许
|
||
*/
|
||
isPc?: number | null;
|
||
/**
|
||
* 最大优惠金额
|
||
*/
|
||
maxDiscountAmount?: number | null;
|
||
/**
|
||
* 员工名称
|
||
*/
|
||
name?: null | string;
|
||
/**
|
||
* shopId
|
||
*/
|
||
shopId?: number | null;
|
||
/**
|
||
* 1启用0不启用
|
||
*/
|
||
status?: boolean | null;
|
||
/**
|
||
* master商户账号staff员工
|
||
*/
|
||
type?: null | string;
|
||
updateTime?: null | string;
|
||
[property: string]: any;
|
||
}
|
||
|
||
/**
|
||
* 添加信息
|
||
*
|
||
* ShopStaffAddDTO
|
||
*/
|
||
export interface addRequest {
|
||
/**
|
||
* 登录账号
|
||
*/
|
||
accountName: null | string;
|
||
/**
|
||
* 登录密码
|
||
*/
|
||
accountPwd: null | string;
|
||
/**
|
||
* 员工编号
|
||
*/
|
||
code: null | string;
|
||
/**
|
||
* 优惠类型 1 折扣 0 金额
|
||
*/
|
||
discountType?: number | null;
|
||
/**
|
||
* 是否允许管理端登录
|
||
*/
|
||
isManage?: number | null;
|
||
/**
|
||
* 是否允许pc登录
|
||
*/
|
||
isPc?: number | null;
|
||
/**
|
||
* 最大优惠金额
|
||
*/
|
||
maxDiscountAmount?: number | null;
|
||
/**
|
||
* 员工姓名
|
||
*/
|
||
name?: null | string;
|
||
/**
|
||
* 手机号
|
||
*/
|
||
phone: null | string;
|
||
/**
|
||
* 角色id
|
||
*/
|
||
roleId: number | null;
|
||
/**
|
||
* 1启用0不启用
|
||
*/
|
||
status?: number | null;
|
||
[property: string]: any;
|
||
}
|
||
|
||
/**
|
||
* 添加信息
|
||
*
|
||
* ShopStaffEditDTO
|
||
*/
|
||
export interface editRequest {
|
||
/**
|
||
* 登录密码
|
||
*/
|
||
accountPwd?: null | string;
|
||
/**
|
||
* 员工编号
|
||
*/
|
||
code?: null | string;
|
||
/**
|
||
* 优惠类型 1 折扣 0 金额
|
||
*/
|
||
discountType?: number | null;
|
||
id: number | null;
|
||
/**
|
||
* 是否允许管理端登录
|
||
*/
|
||
isManage?: number | null;
|
||
/**
|
||
* 是否允许pc登录
|
||
*/
|
||
isPc?: number | null;
|
||
/**
|
||
* 最大优惠金额
|
||
*/
|
||
maxDiscountAmount?: number | null;
|
||
/**
|
||
* 员工姓名
|
||
*/
|
||
name?: null | string;
|
||
/**
|
||
* 手机号
|
||
*/
|
||
phone?: null | string;
|
||
/**
|
||
* 角色id
|
||
*/
|
||
roleId?: number | null;
|
||
/**
|
||
* 1启用0不启用
|
||
*/
|
||
status?: number | null;
|
||
[property: string]: any;
|
||
} |