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 | 143 ++++++++++++++++++++++------------------------- 1 files changed, 66 insertions(+), 77 deletions(-) diff --git a/FlexJobApi.Core/Entities/Users/Enterprise.cs b/FlexJobApi.Core/Entities/Users/Enterprise.cs index 1f3887b..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,45 +22,19 @@ } /// <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; } - - /// <summary> - /// 钀ヤ笟鎵х収鐓х墖 - /// </summary> - public string LicenseImage { get; set; } - - /// <summary> - /// 娉曚汉濮撳悕 - /// </summary> - [MaxLength(32)] - public string LegalPerson { get; set; } - - /// <summary> - /// 娉曚汉韬唤璇佸彿 - /// </summary> - [MaxLength(18)] - public string LegalIdentity { get; set; } - - /// <summary> - /// 鎵�鍦ㄧ渷浠絀d - /// </summary> - public Guid? ProvinceId { get; set; } + public string ProvinceCode { get; set; } /// <summary> /// 鎵�鍦ㄧ渷浠� @@ -65,9 +42,9 @@ public DictionaryData Province { get; set; } /// <summary> - /// 鎵�鍦ㄥ煄甯侷d + /// 鎵�鍦ㄥ煄甯傜紪鍙� /// </summary> - public Guid? CityId { get; set; } + public string CityCode { get; set; } /// <summary> /// 鎵�鍦ㄥ煄甯� @@ -75,9 +52,9 @@ public DictionaryData City { get; set; } /// <summary> - /// 鎵�灞炶涓欼d + /// 鎵�灞炶涓氱紪鍙� /// </summary> - public Guid? IndustryTypeId { get; set; } + public string IndustryTypeCode { get; set; } /// <summary> /// 鎵�灞炶涓� @@ -107,58 +84,30 @@ public string ContactEmail { get; set; } /// <summary> - /// 娉曚汉鎴栫粡鍔炰汉瀹炲悕鏂瑰紡 + /// 鏀粯閫氶亾 /// </summary> - public EnumPersonalRealMethod? PersonalRealMethod { get; set; } + public EnumPayAccess? PayAccess { get; set; } /// <summary> - /// 娉曚汉鎴栫粡鍔炰汉濮撳悕 + /// 寮�鎴锋�昏 /// </summary> - [MaxLength(32)] - public string Name { get; set; } + public string BankName { get; set; } /// <summary> - /// 娉曚汉鎴栫粡鍔炰汉韬唤璇佸彿 + /// 寮�鎴锋敮琛� /// </summary> - [MaxLength(18)] - public string Identity { get; set; } + public string BankBranchName { get; set; } /// <summary> - /// 娉曚汉鎴栫粡鍔炰汉韬唤璇佷汉鍍忛潰 - /// </summary> - public string IdentityImg { get; set; } - - /// <summary> - /// 娉曚汉鎴栫粡鍔炰汉韬唤璇佸浗寰介潰 - /// </summary> - public string IdentityBackImg { get; set; } - - /// <summary> - /// 娉曚汉鎴栫粡鍔炰汉閾惰鍗″彿 + /// 閾惰璐︽埛 /// </summary> [MaxLength(32)] public string BankCard { get; set; } /// <summary> - /// 娉曚汉鎴栫粡鍔炰汉閾惰鍗$収鐗� + /// 鏄惁宸叉牎楠岄摱琛岃处鎴� /// </summary> - public string BankCardImg { 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> /// 瀹炲悕閫氶亾 @@ -166,11 +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> /// 閮ㄩ棬 @@ -181,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