import FetchRequest from "@/api/FetchRequest";
import type Setting from "@/mode/Setting";

class SettingApi {
  static url = "/api/sys/setting";

  /**
   * 获取用户设置
   * @param userId 用户id
   */
  static get(userId: string) {
    return FetchRequest.get(`${this.url}/${userId}`, true);
  }

  /**
   * 修改聊天设置
   *  @param setting 聊天设置
   */
  static update(setting: Setting) {
    return FetchRequest.put(this.url, JSON.stringify(setting), true);
  }
}

export default SettingApi;
