using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; using RIZO.Client.IDAL; namespace RIZO.Client.DAL { public class UserDal : WebDataAccess, IUserDal { public Task GetAll() { // 服务接口 return this.GetDatas($"{domain}user/all"); } public Task GetRolesByUserId(int userId) { return this.GetDatas($"{domain}user/roles/{userId}"); } public Task ResetPassword(string userId) { Dictionary param = new Dictionary(); param.Add("userId", new StringContent(userId)); return this.PostDatas($"{domain}user/resetpwd", param); } public Task SaveUser(string data) { StringContent content = new StringContent(data); content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json"); return this.PostDatas($"{domain}user/save", content); } } }