import { AppUserModel, AppUserQueryParam } from '@/types'
import request from '@/until/request'

/**
 * 获取AppUser列表
 * @param data AppUserQueryParam
 */
// const QueryAppUserList = (data: AppUserQueryParam) =>
//     request({
//         url: '/AppUserAction/list/' + data.page + '/' + data.rows,
//         method: 'get'
// })

    /**
 * 获取AppUser列表
 * @param data AppUserQueryParam
 */
 const QueryAppUserList = (data: AppUserQueryParam) =>
 request({
     url: '/AppUserAction/list',
     method: 'post',
     data: data
 })

/**
* 新增AppUser
* @param data AppUserModel
*/
const AddAppUser = (data: AppUserModel) =>
    request({
        url: '/AppUserAction/saveAppUser',
        method: 'post',
        data: data
    })

/**
* 编辑AppUser
* @param data AppUserModel
*/
const EditAppUser = (data: AppUserModel) =>
    request({
        url: '/AppUserAction/updateAppUser',
        method: 'post',
        data: data
    })

/**
* 删除AppUser
* @param  id number
*/
const DeleteAppUser = (id: number) =>
    request({
        url: '/AppUserAction/deleteAppUser/' + id,
        method: 'get',
    })

/**
* AppUser登陆
* @param loginId string
* @param loginPwd string
*/
const Login = (loginId: string, loginPwd: string) =>
    request({
        url: '/AppUserAction/loginAppUser/' + loginId + "/" + loginPwd,
        method: 'get',
    })

export default {
    QueryAppUserList,
    AddAppUser,
    EditAppUser,
    DeleteAppUser,
    Login
}