123
ningshuxia
2023-04-13 eb32b4263f6901bb7ac1915b400e4fe28db20ef0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using IStation.Untity;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace IStation.Application
{
    /// <summary>
    /// 是否存在多对象地图信息
    /// </summary>
    public class IsExistObjectsMapInfoInput: IValidatableObject
    {
        /// <summary>
        /// 客户标识
        /// </summary>    
        [Required, Range(1, long.MaxValue, ErrorMessage = "CorpID 必须大于0")]
        public long CorpID { get; set; }
 
        /// <summary>
        /// 对象类型
        /// </summary>    
        [Required, DataValidation(AllowEmptyStrings = false)]
        public string ObjectType { get; set; }
 
        /// <summary>
        /// 对象标识列表
        /// </summary>    
        [Required, DataValidation(AllowEmptyStrings = false)]
        public string ObjectIds { get; set; }
 
        /// <summary>
        /// 地图种类
        /// </summary>    
        [Required, DataValidation(AllowEmptyStrings = false)]
        public string Kind { get; set; }
 
        /// <summary>
        /// 目的
        /// </summary>    
        [Required, DataValidation(AllowEmptyStrings = false)]
        public string Purpose { get; set; }
 
        /// <summary>
        /// 
        /// </summary>
        public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
        {
            var ids = LongListHelper.ToList(ObjectIds);
            if (ids == null || ids.Count() < 1)
            {
                yield return new ValidationResult(
                        "ObjectIds 必须是用 , 隔开的ID列表"
                        , new[] { nameof(ObjectIds) }
                    );
 
            }
        }
    }
}