import {ICommon_Model_User} from './../model/user'; import {ECommon_Services} from './../types'; import {ICommon_Route_Res_User_List, ICommon_Route_Res_User_Profile, ICommon_Route_Res_User_TeamList} from './response'; import {ECommon_HttpApi_Method} from "./types"; import {Permission_Types} from "../permission/permission"; const api={ baseUrl:"/user", service:ECommon_Services.User, routes:{ login:{//用户登录 method:ECommon_HttpApi_Method.POST, path:"/login", req:<{ username:string, password:string }>{}, res:>{}, ignoreValidate:true }, checkUser:{//检查用户是否可用 method:ECommon_HttpApi_Method.GET, path:"/check_user", req:<{ name:string }>{}, res:{}, ignoreValidate:true }, logout:{//登出 method:ECommon_HttpApi_Method.POST, path:"/logout", req:{}, res:{}, }, loginAdmin:{//管理员登录 method:ECommon_HttpApi_Method.POST, path:"/admin_login", req:<{ username:string, password:string }>{}, res:>{}, ignoreValidate:true }, logoutAdmin:{//管理员登出 method:ECommon_HttpApi_Method.POST, path:"/admin_logout", req:{}, res:{}, }, refresh:{//刷新用户信息 method:ECommon_HttpApi_Method.GET, path:"/refresh", req:{}, res:>{}, }, update:{//更新用户信息 method:ECommon_HttpApi_Method.PUT, path:"/item", req:> & {userId?:string}>{}, res:>{}, }, register:{ method:ECommon_HttpApi_Method.POST, path:"/register", req:<{ username:string, password:string }>{}, res:{}, ignoreValidate:true }, create:{//创建用户 method:ECommon_HttpApi_Method.POST, path:"/item", req:> & { username:string, password:string, role?:number }>{}, res:>{} }, remove:{//删除用户 method:ECommon_HttpApi_Method.DELETE, path:"/item", req:<{ userId:string }>{}, res:{}, }, active:{//禁用、启用用户 method:ECommon_HttpApi_Method.PUT, path:"/active", req:<{ active:number, userId:string }>{}, res:{}, }, list:{ method:ECommon_HttpApi_Method.GET, path:"/list", req:<{ keyword?:string, page:number, size:number }>{}, res:{}, }, resetPassword:{ method:ECommon_HttpApi_Method.PUT, path:"/reset_password", req:<{ userId?:string, password:string }>{}, res:{}, }, teamList:{ method:ECommon_HttpApi_Method.GET, path:"/team_list", req:<{ userId?:string, keyword?:string }>{}, res:{}, permission:[Permission_Types.Organization.READ] }, profile:{ method:ECommon_HttpApi_Method.GET, path:"/profile", req:<{ organizationUserId?:string }>{}, res:{}, }, infos:{ method:ECommon_HttpApi_Method.GET, path:"/infos", req:<{ userIds:string }>{}, res:[]>{}, }, filterUser:{ method:ECommon_HttpApi_Method.GET, path:"/filter", req:<{ name:string }>{}, res:<{ name:string, id:string, photo:string }[]>{}, }, confirmRegister:{ method:ECommon_HttpApi_Method.POST, path:"/register/confirm", req:<{ username:string, code:string }>{}, res:{}, ignoreValidate:true }, resendCode:{ method:ECommon_HttpApi_Method.POST, path:"/register/code", req:<{ username:string }>{}, res:{}, ignoreValidate:true }, resetCode:{ method:ECommon_HttpApi_Method.POST, path:"/reset/code", req:<{ username:string }>{}, res:{}, ignoreValidate:true }, reset:{ method:ECommon_HttpApi_Method.POST, path:"/reset", req:<{ username:string, password:string, code:string }>{}, res:{}, ignoreValidate:true }, } } export default api