public async Task <UnifyResponseDto> Post(CreateSurveyDTO model) { if (await _service.CreateSureveyAsync(model)) { return(UnifyResponseDto.Sucess("添加成功")); } return(UnifyResponseDto.Fail()); }
public async Task <UnifyResponseDto> Post(LoginDTO model) { Guid userId = await _userSvc.GetUserIdAsync(model.username); if (await _service.VerifyPasswordAsync(userId, model.password)) { return(UnifyResponseDto.Sucess("登录成功")); } return(UnifyResponseDto.Fail(Model.DTO.Enum.StatusCode.AuthenticationFailed, "登录失败")); }
public async Task <UnifyResponseDto> Post(SignupDTO model) { if (!string.IsNullOrWhiteSpace(model.Password)) { if (await _service.CreateUserAsync(model)) { return(UnifyResponseDto.Sucess("注册成功")); } } return(UnifyResponseDto.Fail()); }