您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

LuPartialFieldsParser.cs 818B

1234567891011121314151617181920212223
  1. using System.Linq;
  2. using Luticate2.Auth.Dbo;
  3. using Luticate2.Auth.Dbo.Fields;
  4. using Luticate2.Auth.Dbo.Result;
  5. namespace Luticate2.Auth.Business.Fields
  6. {
  7. public class LuPartialFieldsParser
  8. {
  9. public static LuResult<LuPartialFieldsDbo> Parse(string fields)
  10. {
  11. if (PartialResponse.Core.Fields.TryParse(fields, out var tempFields))
  12. {
  13. var partialFieldsDbo = new LuPartialFieldsDbo
  14. {
  15. Fields = tempFields.Values.Select(x => new LuFieldDbo {Parts = x.Parts.ToList()}).ToList()
  16. };
  17. return LuResult<LuPartialFieldsDbo>.Ok(partialFieldsDbo);
  18. }
  19. return LuResult<LuPartialFieldsDbo>.Error(LuStatus.InputError.ToInt(), "Failed to parse partial fields", "");
  20. }
  21. }
  22. }