import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询用户列表
export function listGroup(query) {
	return {
			"total": 9,
			"rows": [{"createTime":"2023-10-23 09:15:20","groupId":1,"remarks":"","groupName":"硬件组"},
					 {"createTime":"2023-10-23 09:15:32","groupId":2,"remarks":"","groupName":"嵌入式工程组"},
					 {"createTime":"2023-10-23 09:15:40","groupId":3,"remarks":"","groupName":"软件组"},
					 {"createTime":"2023-10-23 09:15:50","groupId":4,"remarks":"","groupName":"产品组"},
					 {"createTime":"2023-10-23 09:16:00","groupId":5,"remarks":"","groupName":"江苏组"},
					 {"createTime":"2023-10-23 17:17:08","groupId":6,"remarks":"商务人员","groupName":"商务组"},
					 {"createTime":"2023-11-03 13:50:08","groupId":7,"remarks":"财务人员","groupName":"财务组"},
					 {"createTime":"2023-12-06 17:30:41","groupId":8,"remarks":"","groupName":"采购组"},
					 {"createTime":"2023-12-11 15:21:59","groupId":9,"remarks":"","groupName":"安装交付组"}],
			"code": 200 
		}
  // return request({
  //   url: '/system/user/list',
  //   method: 'get',
  //   params: query
  // })
}

// 查询用户详细
export function getGroup(userId) {
  return request({
    url: '/system/user/' + parseStrEmpty(userId),
    method: 'get'
  })
}

// 新增用户
export function addGroup(data) {
  return request({
    url: '/system/user',
    method: 'post',
    data: data
  })
}

// 修改用户
export function updateGroup(data) {
  return request({
    url: '/system/user',
    method: 'put',
    data: data
  })
}

// 删除用户
export function delGroup(userId) {
  return request({
    url: '/system/user/' + userId,
    method: 'delete'
  })
}
