服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
18 小时以前 a960900364d19bbf0ad7923a57989609e7fce798
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
63
64
65
66
67
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tiger.Model.Extensions;
 
namespace Tiger.Model
{
    /// <summary>
    /// 数据库查询授权种类枚举
    /// </summary>
    public enum DbAuth
    {
        [Description("组织机构授权")]
        Org = 1,
        [Description("生产单元授权")]
        Prod = 2,
        [Description("仓库单元授权")]
        Wh = 4,
    }
 
    /// <summary>
    /// 数据库授权查询选项
    /// </summary>
    public class AuthOption : OptionBase
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        public string UserId { get; set; }
        /// <summary>
        /// 用户当前选择的组织机构编码
        /// </summary>
        public string CurOrg { get; set; }
        /// <summary>
        /// 按照组织机构授权查询
        /// </summary>
        public bool ByOrg { get; set; } = false;
        /// <summary>
        /// 要查询的组织机构编码,如果多个用","分割
        /// </summary>
        public string OrgCode { get; set; }
        /// <summary>
        /// 按照生产单元授权查询
        /// </summary>
        public bool ByProd { get; set; } = false;
        /// <summary>
        /// 要查询的生产单元编码,如果多个用","分割
        /// </summary>
        public string ProdCode { get; set; }
        /// <summary>
        /// 按照仓库单元授权查询
        /// </summary>
        public bool ByWh { get; set; } = false;
        /// <summary>
        /// 要查询的仓库单元编码,如果多个用","分割
        /// </summary>
        public string WhCode { get; set; }
        /// <summary>
        /// 授权查询枚举Options
        /// </summary>
        public DbAuth GetOptions() => (DbAuth)((ByOrg ? DbAuth.Org.GetValue() : 0) + (ByProd ? DbAuth.Prod.GetValue() : 0) + (ByWh ? DbAuth.Wh.GetValue() : 0));
    }
}