import $http from "@/utils/httpRequest.js";

export const role = {
  //角色列表
  roleList: (data) => {
    return $http.request({
      url: `/merchant-api/role/list`,
      method: "get",
      params: data,
    });
  },
  //新增角色列表
  addRoleList: (data) => {
    return $http.request({
      url: `/merchant-api/role/add`,
      method: "post",
      data,
    });
  },
  //编辑角色列表
  updateRoleList: (data) => {
    return $http.request({
      url: `/merchant-api/role/update`,
      method: "post",
      data,
    });
  },
  //删除角色列表
  deleteRoleList: (data) => {
    return $http.request({
      url: `/merchant-api/role/delete`,
      method: "post",
      data,
    });
  },
  //更新角色权限
  updatePermissionUpdate: (data) => {
    return $http.request({
      url: `/merchant-api/role/permission/update`,
      method: "put",
      data,
    });
  },
  //获取角色权限列表
  getRoleList: (data) => {
    return $http.request({
      url: `/merchant-api/role/permission/list`,
      method: "get",
      params: data,
    });
  },
};
