// 权限相关
import request from "@/Utils/requestUtils.js";
import $common from "@/Utils/commonUtils.js";
import $api from "@/Apis/api";

export const authorService = {
  queryAuthority: function (obj) {
    return request.post($api.author.queryAuthority, obj);
  },
  addAuthority: function (data) {
    return request.post($api.author.addAuthority, data);
  },
  updateAuthority: function (data) {
    return request.post($api.author.updateAuthority, data);
  },
  deleteAuthority: function (authorityId) {
    return request.get($api.author.deleteAuthority, {
      params: { authorityId: authorityId },
    });
  },
  setWebPageAuthoritOutputConfig: function (authorityId) {
    return request.get($api.author.setWebPageAuthoritOutputConfig, {
      params: { authorityId: authorityId },
    });
  },
  addWebpageAuthority: function (obj) {
    return request.post($api.author.addWebpageAuthority, {
      authorityId: obj.authorityId,
      ids: obj.ids,
      webId: obj.webId,
    });
  },
  queryButtonWebpageAuthorityConfig: function (obj) {
    return request.post($api.author.queryButtonWebpageAuthorityConfig, obj);
  },
  addButtonWebpageAuthority: function (obj) {
    return request.post($api.author.addButtonWebpageAuthority, obj);
  },
  queryFieldWebpageAuthorityConfig: function (obj) {
    return request.post($api.author.queryFieldWebpageAuthorityConfig, obj);
  },
  addFieldWebpageAuthority: function (obj) {
    return request.post($api.author.addFieldWebpageAuthority, obj);
  },
  userPageList: function (obj) {
    return request.post($api.author.userPageList, obj);
  },
  setAuthorityUser: function (obj) {
    return request.post($api.author.setAuthorityUser, obj);
  },
  getAuthorityUserList: function (obj) {
    return request.post($api.author.getAuthorityUserList, obj);
  },
  checkIsAgent: function () {
    return request.get($api.author.checkIsAgent);
  },
};
