import request from '@/utils/request'
import { URL } from '@/config'

/**
 * @name 获取用户信息列表
 * @api api_url + '/admin/account/account-user-base/list'
 * @param { user_nickname } params 
 * @returns {
 * [
*   {
*      "user_id": 10068,                                  用户id  
*      "rights_group_id": "0",                            权限团体id
*      "user_is_admin": 0,                                是否管理员
*      "store_ids": "", 
*      "roles": null,                                     角色
*      "rid": null, 
*      "user_state": 2,                                   用户状态
*      "chain_ids": "",
*      "user_quickcode": "",                              
*      "user_nickname": "亚瑟",                           昵称
*      "user_account": "oqlUi7egFalSrAXxW_okycY9qvkM",    账号
*      "user_tel": "",                                    联系方式
*      "user_address": "",                                地址
*      "user_gender": 0,                                  性别
*      "user_idcard": "",                                 身份证
*      "user_sign": "",                                   签名
*      "ucc_id": 0,
*      "user_exp_total": 51,                              用户经验
*      "user_mobile": "",                                 手机
*      "user_province_id": 0,                             所在省份id
*      "user_realname": "",                               真实姓名
*      "user_is_new": 1,                                  是否新用户
*      "user_type_id": 0,                                 用户类型id
*      "user_level_id": 1001,                             等级id
*      "user_avatar": "",                                 头像
*      "user_group": 0,                                   用户组
*      "user_email": "",                                  邮箱
*      "user_withdraw_state": 0,                          用户退出状态
*      "user_intl": "",
*      "user_certification": 0,                           用户认证
*      "user_qq": "",                                     QQ
*      "user_ww": "",                                     
*      "user_birthday": "2000-01-01 00:00:00",            生日
*      "user_level_validity_time": 0,                     用户等级有效时间
*      "user_idcard_images": "",                          身份证图像
*      "user_county_id": 0,                               用户县id
*      "user_level_card": "",                             用户级卡
*      "user_city_id": 0,                                 用户所在城市id
*      "user_notename": "",
*      "user_reg_datetime": "2024-10-02 15:13:23",        注册日期时间
*      "user_reg_ip": "111.16.133.98",                    注册ip
*      "user_lastlogin_time": "2024-10-02 15:13:23",      最后登录时间
*      "user_lastlogin_ip": "111.16.133.98",              最后登录IP地址
*      "user_province_name": null,                        所在省名
*     "user_city_name": null,                             所在城市名称
*      "user_county_name": null,                          所在国家名称
*      "user_level_name": "普通会员",                      用户级别名称
*      "user_type_name": null,                            用户类型名称
*      "user_parent_id": null,                            用户父id
*      "rights_group_names": []                           权利组名称
*  }
*]
}
 */

export function getList(params) {
  return request({
    url: URL.account.user.base.getList,
    method: 'get',
    params,
  })
}

export function getUserDate(params) {
  return request({
    url: URL.account.user.base.getUserDate,
    method: 'get',
    params,
  })
}

export function getAccounts(params) {
  return request({
    url: URL.account.user.base.getAccounts,
    method: 'get',
    params,
  })
}

export function doEdit(data) {
  return request({
    url: URL.account.user.base.doEdit,
    method: 'post',
    data,
  })
}

export function doDelete(data) {
  return request({
    url: URL.account.user.base.doDelete,
    method: 'post',
    data,
  })
}

export function editState(data) {
  return request({
    url: URL.account.user.base.editState,
    method: 'post',
    data,
  })
}
