import request from '@/utils/request';
import { AgreementVO, AgreementForm } from './types';

/**
 * 根据ID查询协议详情
 */
export const getAgreement = (id: number) => {
  return request<AgreementVO>({
    url: `/system/agreement/${id}`,
    method: 'get'
  });
};

/**
 * 修改协议（content 须为 base64 编码的 HTML 富文本）
 */
export const updateAgreement = (data: AgreementForm) => {
  return request<void>({
    url: '/system/agreement',
    method: 'put',
    data
  });
};
