From a8b475881959d4a88d821951a615f03e7d0d1725 Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期四, 07 八月 2025 13:28:30 +0800
Subject: [PATCH] feat:字典优化

---
 FlexJobApi.Core/Entities/Users/Enterprise.cs |  156 +++++++++++++++++++++++++++++++--------------------
 1 files changed, 95 insertions(+), 61 deletions(-)

diff --git a/FlexJobApi.Core/Entities/Users/Enterprise.cs b/FlexJobApi.Core/Entities/Users/Enterprise.cs
index 36b6d97..65ac6ef 100644
--- a/FlexJobApi.Core/Entities/Users/Enterprise.cs
+++ b/FlexJobApi.Core/Entities/Users/Enterprise.cs
@@ -1,4 +1,7 @@
-锘縰sing System;
+锘縰sing Furion.DatabaseAccessor;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Builders;
+using System;
 using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
 using System.Linq;
@@ -10,7 +13,7 @@
     /// <summary>
     /// 浼佷笟
     /// </summary>
-    public class Enterprise : CommonEntity
+    public class Enterprise : CommonEntity, IEntityTypeBuilder<Enterprise>
     {
         public Enterprise()
         {
@@ -19,103 +22,92 @@
         }
 
         /// <summary>
-        /// 浼佷笟璁よ瘉鏂瑰紡
+        /// 浼佷笟璁よ瘉Id
         /// </summary>
-        public EnumEnterpriseRealMethod? EnterpriseRealMethod { get; set; }
+        public Guid EnterpriseAuthId { get; set; }
 
         /// <summary>
-        /// 浼佷笟鍏ㄧО
+        /// 浼佷笟璁よ瘉
         /// </summary>
-        [Required]
-        [MaxLength(128)]
-        public string EnterpriseName { get; set; }
+        public EnterpriseAuth EnterpriseAuth { get; set; }
 
         /// <summary>
-        /// 缁熶竴绀句細淇$敤浠g爜
+        /// 鎵�鍦ㄧ渷浠界紪鍙�
         /// </summary>
-        [Required]
-        [MaxLength(18)]
-        public string SocietyCreditCode { get; set; }
+        public string ProvinceCode { get; set; }
 
         /// <summary>
-        /// 钀ヤ笟鎵х収鐓х墖Id
+        /// 鎵�鍦ㄧ渷浠�
         /// </summary>
-        public Guid? LicenseImageId { get; set; }
+        public DictionaryData Province { get; set; }
 
         /// <summary>
-        /// 钀ヤ笟鎵х収鐓х墖
+        /// 鎵�鍦ㄥ煄甯傜紪鍙�
         /// </summary>
-        public FileVirtualPath LicenseImage { get; set; }
+        public string CityCode { get; set; }
 
         /// <summary>
-        /// 娉曚汉濮撳悕
+        /// 鎵�鍦ㄥ煄甯�
+        /// </summary>
+        public DictionaryData City { get; set; }
+
+        /// <summary>
+        /// 鎵�灞炶涓氱紪鍙�
+        /// </summary>
+        public string IndustryTypeCode { get; set; }
+
+        /// <summary>
+        /// 鎵�灞炶涓�
+        /// </summary>
+        public DictionaryData IndustryType { get; set; }
+
+        /// <summary>
+        /// 涓昏惀涓氬姟
+        /// </summary>
+        public string MainBusiness { get; set; }
+
+        /// <summary>
+        /// 鑱旂郴浜�
         /// </summary>
         [MaxLength(32)]
-        public string LegalPerson { get; set; }
+        public string Contacts { get; set; }
 
         /// <summary>
-        /// 娉曚汉鎴栫粡鍔炰汉瀹炲悕鏂瑰紡
+        /// 鑱旂郴鐢佃瘽
         /// </summary>
-        public EnumPersonalRealMethod? PersonalRealMethod { get; set; }
+        [MaxLength(11)]
+        public string ContactPhoneNumber { get; set; }
 
         /// <summary>
-        /// 娉曚汉鎴栫粡鍔炰汉濮撳悕
+        /// 鑱旂郴閭
         /// </summary>
-        [MaxLength(32)]
-        public string Name { get; set; }
+        public string ContactEmail { get; set; }
 
         /// <summary>
-        /// 娉曚汉鎴栫粡鍔炰汉韬唤璇佸彿
+        /// 鏀粯閫氶亾
         /// </summary>
-        [MaxLength(18)]
-        public string Identity { get; set; }
+        public EnumPayAccess? PayAccess { get; set; }
 
         /// <summary>
-        /// 娉曚汉鎴栫粡鍔炰汉韬唤璇佷汉鍍忛潰Id
+        /// 寮�鎴锋�昏
         /// </summary>
-        public Guid? IdentityImgId { get; set; }
+        public string BankName { get; set; }
 
         /// <summary>
-        /// 娉曚汉鎴栫粡鍔炰汉韬唤璇佷汉鍍忛潰
+        /// 寮�鎴锋敮琛�
         /// </summary>
-        public FileVirtualPath IdentityImg { get; set; }
+        public string BankBranchName { get; set; }
 
         /// <summary>
-        /// 娉曚汉鎴栫粡鍔炰汉韬唤璇佸浗寰介潰Id
-        /// </summary>
-        public Guid? IdentityBackImgId { get; set; }
-
-        /// <summary>
-        /// 娉曚汉鎴栫粡鍔炰汉韬唤璇佸浗寰介潰
-        /// </summary>
-        public FileVirtualPath IdentityBackImg { get; set; }
-
-        /// <summary>
-        /// 娉曚汉鎴栫粡鍔炰汉閾惰鍗″彿
+        /// 閾惰璐︽埛
         /// </summary>
         [MaxLength(32)]
         public string BankCard { get; set; }
 
         /// <summary>
-        /// 娉曚汉鎴栫粡鍔炰汉閾惰鍗$収鐗嘔d
+        /// 鏄惁宸叉牎楠岄摱琛岃处鎴�
         /// </summary>
-        public Guid? BankCardImgId { get; set; }
-
-        /// <summary>
-        /// 娉曚汉鎴栫粡鍔炰汉鎵嬫満鍙�
-        /// </summary>
-        [MaxLength(11)]
-        public string PhoneNumber { get; set; }
-
-        /// <summary>
-        /// 鏄惁濮旀墭缁忓姙浜�
-        /// </summary>
-        public bool? Proxy { get; set; }
-
-        /// <summary>
-        /// 浼佷笟鎺堟潈涔�
-        /// </summary>
-        public string ProxyPowerAttorneyUrl { get; set; }
+        public bool IsCheckedBankCard { get; set; }
 
         /// <summary>
         /// 瀹炲悕閫氶亾
@@ -123,9 +115,29 @@
         public EnumRealAccess? RealAccess { get; set; }
 
         /// <summary>
-        /// 鏄惁瀹炲悕
+        /// 瀹炲悕璐圭敤
         /// </summary>
-        public bool IsReal { get; set; }
+        public decimal? RealVerifyCost { get; set; }
+
+        /// <summary>
+        /// 绛剧害璐圭敤
+        /// </summary>
+        public decimal? SignCost { get; set; }
+
+        /// <summary>
+        /// 涓�鍙d环
+        /// </summary>
+        public decimal? MergeSignCost { get; set; }
+
+        /// <summary>
+        /// 鐭俊閫氶亾
+        /// </summary>
+        public EnumSmsAccess? SmsAccess { get; set; }
+
+        /// <summary>
+        /// 鐭俊璐圭敤
+        /// </summary>
+        public decimal SmsCost { get; set; }
 
         /// <summary>
         /// 閮ㄩ棬
@@ -136,5 +148,27 @@
         /// 鐢ㄦ埛淇℃伅
         /// </summary>
         public List<UserInfo> UserInfos { get; set; }
+
+        public void Configure(EntityTypeBuilder<Enterprise> entityBuilder, DbContext dbContext, Type dbContextLocator)
+        {
+            entityBuilder
+                .HasOne(it => it.Province)
+                .WithMany()
+                .HasForeignKey(it => it.ProvinceCode)
+                .HasPrincipalKey(it => it.Code)
+                .OnDelete(DeleteBehavior.Restrict);
+            entityBuilder
+                .HasOne(it => it.City)
+                .WithMany()
+                .HasForeignKey(it => it.CityCode)
+                .HasPrincipalKey(it => it.Code)
+                .OnDelete(DeleteBehavior.Restrict);
+            entityBuilder
+                .HasOne(it => it.IndustryType)
+                .WithMany()
+                .HasForeignKey(it => it.IndustryTypeCode)
+                .HasPrincipalKey(it => it.Code)
+                .OnDelete(DeleteBehavior.Restrict);
+        }
     }
 }

--
Gitblit v1.9.1