/**
 * @desc 注册
 */

import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'

export class Params {
    /** 用户名 */
    username: string
    /** 密码 */
    password: string
    /** 真实姓名 */
    realName: string
    /** 手机号 */
    mobile: string
    /** 头像 */
    avatar?: string
    /** 邮箱 */
    email?: string
    /** 是否启用 */
    enable?: boolean
}

export const init = new defs.ResultString()

export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
    return defHttp.request(
        {
            url: '/auth/register',
            method: 'POST',
            data: params,

            ...config,
        },
        options,
    )
}
