import { post } from '#/api/http'

import { BasicService } from '../basic'

class UserService extends BasicService {
  async updateStatus(id: any, status: any) {
    const url = '/sysUser/changeStatus'
    const entity = { id, status }
    const config = (await this.willUpdateSwitchKeyValues(url, entity)) as any
    return await post(url, entity, config)
  }

  protected findPageUrl(): string {
    return '/sysUser/list'
  }

  protected removeUrl(): string {
    throw new Error('Method not implemented.')
  }

  protected saveOrUpdateUrl(): string {
    throw new Error('Method not implemented.')
  }

  protected override switchKeyValues() {
    return [
      {
        key: 'status',
        trueValue: 0,
        falseValue: 1,
      },
    ]
  }
}

export const userService = new UserService()
