李昊 před 4 roky
rodič
revize
e21edc212e

+ 6 - 1
gx_api/GxPress/Model/GxPress.Entity/tede2/Media/Media.cs

@@ -9,7 +9,12 @@ namespace GxPress.Entity.tede2.Media
     [DataTable("tede_media")]
     public class Media : Datory.Entity
     {
-
+        /// <summary>
+        /// 编号
+        /// </summary>
+        /// <value></value>
+        [DataColumn]
+        public string AutoNumber { get; set; }
         /// <summary>
         /// 媒体类型
         /// Article=1,

+ 2 - 0
gx_api/GxPress/Repository/GxPress.Repository.Implement/Media/MediaRepository.cs

@@ -12,6 +12,7 @@ using System.Transactions;
 using GxPress.Common.Exceptions;
 using GxPress.Common.Page;
 using GxPress.Request.Media;
+using System;
 
 namespace GxPress.Repository.Implement.Media
 {
@@ -91,6 +92,7 @@ namespace GxPress.Repository.Implement.Media
             {
                 using (var transactionScope = new TransactionScope())
                 {
+                    model.AutoNumber = DateTime.Now.Ticks.ToString();
                     var id = await _repository.InsertAsync(model);
                     if (id > 0)
                     {