username@email.com
2024-05-17 2586fc8f8313691bf079438ba7f780aac44c3f0f
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
68
69
70
71
72
73
74
/***********************************************************************
 *            Project: baifenBinfa
 *        ProjectName: 百分兵法管理系统                               
 *                Web: http://chuanyin.com                     
 *             Author:                                        
 *              Email:                               
 *         CreateTime: 202403/02   
 *        Description: 暂无
 ***********************************************************************/
 
 
using System.Collections.Generic;
using CoreCms.Net.IRepository;
using CoreCms.Net.IServices;
using SqlSugar;
 
namespace CoreCms.Net.Services.CodeGenerator
{
    public class CodeGeneratorServices : ICodeGeneratorServices
    {
        ICodeGeneratorRepository _dal;
 
        public CodeGeneratorServices(ICodeGeneratorRepository dal)
        {
            this._dal = dal;
        }
 
 
        /// <summary>
        /// 获取所有的表
        /// </summary>
        /// <returns></returns>
        public List<DbTableInfo> GetDbTables()
        {
            return _dal.GetDbTables();
        }
 
        /// <summary>
        /// 获取表下面所有的字段
        /// </summary>
        /// <param name="tableName"></param>
        /// <returns></returns>
        public List<DbColumnInfo> GetDbTablesColumns(string tableName)
        {
            return _dal.GetDbTablesColumns(tableName);
        }
 
 
        /// <summary>
        /// 自动生成代码
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="fileType"></param>
        /// <returns></returns>
        public byte[] CodeGen(string tableName, string fileType, bool isVue = false)
        {
            return _dal.CodeGen(tableName, fileType, isVue);
        }
 
 
 
        /// <summary>
        /// 自动生成类型的所有数据库代码
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="fileType"></param>
        /// <returns></returns>
        public byte[] CodeGenByAll(string fileType, bool isVue = false)
        {
            return _dal.CodeGenByAll(fileType, isVue);
        }
 
    }
}