├── .dockerignore ├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── Sikiro.sln ├── samples ├── Sikiro.Chloe.Cap.Samples │ ├── AppDbContext.cs │ ├── Controllers │ │ └── ValuesController.cs │ ├── Db │ │ ├── BusinessPlatformContext.cs │ │ ├── Test.cs │ │ └── Test1.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Sikiro.Chloe.Cap.Samples.csproj │ ├── Startup.cs │ ├── __entity.xml │ ├── appsettings.Development.json │ └── appsettings.json ├── Sikiro.Chloe.Cap.SamplesB │ ├── AppDbContext.cs │ ├── Controllers │ │ └── ValuesController.cs │ ├── Db │ │ ├── BusinessPlatformContext.cs │ │ ├── Test.cs │ │ └── Test1.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Sikiro.Chloe.Cap.SamplesB.csproj │ ├── Startup.cs │ ├── __entity.xml │ ├── appsettings.Development.json │ └── appsettings.json ├── Sikiro.MongoDB.Demo │ ├── Goods.cs │ ├── Program.cs │ └── Sikiro.MongoDB.Demo.csproj ├── 基础设施服务解决方案 │ ├── Id发号 │ │ ├── GS.Infrastructure.Id │ │ │ ├── Controllers │ │ │ │ └── IdController.cs │ │ │ ├── GS.Infrastructure.Id.xml │ │ │ ├── Models │ │ │ │ ├── FormatConvert.cs │ │ │ │ └── FormatType.cs │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ │ └── launchSettings.json │ │ │ ├── Sikiro.Infrastructure.Id.csproj │ │ │ ├── Sikiro.Infrastructure.Id.xml │ │ │ ├── Startup.cs │ │ │ ├── appsettings.Development.json │ │ │ ├── appsettings.Testing.json │ │ │ ├── appsettings.json │ │ │ ├── appsettings.pro.json │ │ │ ├── log4net.config │ │ │ └── skyapm.json │ │ ├── GS.Interface.Id.Test │ │ │ ├── IdTest.cs │ │ │ └── Sikiro.Interface.Id.Test.csproj │ │ └── GS.Interface.Id │ │ │ ├── IId.cs │ │ │ └── Sikiro.Interface.Id.csproj │ ├── README.md │ ├── 搜索 │ │ └── Sikiro.ES.Api │ │ │ ├── Attribute │ │ │ ├── ChineseAttribute.cs │ │ │ ├── EmailAttribute.cs │ │ │ ├── GolbalExceptionAttribute.cs │ │ │ ├── IdCardAttribute.cs │ │ │ ├── MobileAttribute.cs │ │ │ ├── PasswordAttribute.cs │ │ │ └── TableColsAttribute.cs │ │ │ ├── Controllers │ │ │ ├── BaseController.cs │ │ │ ├── SearchKeyController.cs │ │ │ └── UserViewDurationController.cs │ │ │ ├── Extention │ │ │ ├── DependenceExtension.cs │ │ │ ├── ModelStateExtensions.cs │ │ │ └── TrimModelBinder.cs │ │ │ ├── Model │ │ │ ├── BaseRequest.cs │ │ │ ├── EsConst.cs │ │ │ ├── SearchKey │ │ │ │ ├── Entity │ │ │ │ │ └── SearchKey.cs │ │ │ │ ├── Enum │ │ │ │ │ └── ESearchKey.cs │ │ │ │ ├── SearchKeyCountRequest.cs │ │ │ │ ├── SearchKeyGetRequest.cs │ │ │ │ ├── SearchKeyGetResponse.cs │ │ │ │ ├── SearchKeyPostRequest.cs │ │ │ │ └── SearchKeyRanameRequest.cs │ │ │ └── UserViewDuration │ │ │ │ ├── Entity │ │ │ │ └── UserViewDuration.cs │ │ │ │ ├── MQ │ │ │ │ ├── UserViewDurationConsumer.cs │ │ │ │ └── UserViewDurationMessage.cs │ │ │ │ ├── UserViewDurationRecordGetRequest.cs │ │ │ │ ├── UserViewDurationRecordGetResponse.cs │ │ │ │ └── UserViewRecordGetRequest.cs │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ ├── PublishProfiles │ │ │ │ └── FolderProfile.pubxml │ │ │ └── launchSettings.json │ │ │ ├── Sikiro.ES.Api.csproj │ │ │ ├── Sikiro.ES.Api.xml │ │ │ ├── Startup.cs │ │ │ ├── appsettings.Development.json │ │ │ ├── appsettings.json │ │ │ └── log4net.config │ └── 消息推送 │ │ ├── GS.Infrastructure.Msg │ │ ├── Controllers │ │ │ ├── CodeController.cs │ │ │ └── TestController.cs │ │ ├── Dockerfile │ │ ├── Entitys │ │ │ └── SmsRecord.cs │ │ ├── GS.Infrastructure.Msg.xml │ │ ├── Program.cs │ │ ├── Properties │ │ │ ├── PublishProfiles │ │ │ │ └── FolderProfile.pubxml │ │ │ └── launchSettings.json │ │ ├── Service │ │ │ └── SmsService.cs │ │ ├── Sikiro.Infrastructure.Msg.csproj │ │ ├── Startup.cs │ │ ├── appsettings.Development.json │ │ ├── appsettings.Testing.json │ │ ├── appsettings.json │ │ ├── appsettings.pro.json │ │ ├── log4net.config │ │ └── skyapm.json │ │ ├── GS.Interface.Msg.Test │ │ ├── ICodeTest.cs │ │ └── Sikiro.Interface.Msg.Test.csproj │ │ └── GS.Interface.Msg │ │ ├── ICode.cs │ │ ├── IMsg.cs │ │ └── Sikiro.Interface.Msg.csproj ├── 客户系统解决方案-新分层 │ ├── Sikiro.Application.Customer │ │ ├── 2.Sikiro.Application.Customer.csproj │ │ ├── Ao │ │ │ ├── SendSmsAo.cs │ │ │ ├── UserLogonInputAo.cs │ │ │ ├── UserLogonOutputAo.cs │ │ │ ├── UserRegisterInputAo.cs │ │ │ ├── UserUpdatePhoneAo.cs │ │ │ ├── UserUpdatePwdAo.cs │ │ │ └── VaildSmsAo.cs │ │ └── UserApplication.cs │ ├── Sikiro.Common.Utils │ │ ├── 5.Sikiro.Common.Utils.csproj │ │ ├── AdministratorData.cs │ │ ├── EnumberHelper.cs │ │ ├── HttpContextExtension.cs │ │ ├── MoneyExtension.cs │ │ ├── ObjectExtension.cs │ │ ├── RegularExpression.cs │ │ └── StringExtension.cs │ ├── Sikiro.Entity.Customer │ │ ├── 4.Sikiro.Entity.Customer.csproj │ │ ├── DBContext │ │ │ └── PersonPlatformContext.cs │ │ ├── User.cs │ │ └── __entity.xml │ ├── Sikiro.InnerApi.Customer │ │ ├── 1.Sikiro.InnerApi.Customer.csproj │ │ ├── Controllers │ │ │ ├── BaseController.cs │ │ │ └── UserController.cs │ │ ├── Extention │ │ │ ├── DependenceExtension.cs │ │ │ └── ModelStateExtensions.cs │ │ ├── GS.InnerApi.Customer.xml │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Startup.cs │ │ ├── appsettings.Development.json │ │ ├── appsettings.Production.json │ │ ├── appsettings.Tes.json │ │ ├── appsettings.json │ │ ├── log4net.config │ │ └── skyapm.json │ ├── Sikiro.Interface.Customer │ │ ├── 0.Sikiro.Interface.Customer.csproj │ │ ├── ICustomer.cs │ │ ├── IUser.cs │ │ └── User │ │ │ ├── BindingWxRequest.cs │ │ │ ├── ChangePayPwdUserRequest.cs │ │ │ ├── CheckingPayPasswordRequest.cs │ │ │ ├── FinancialBalancePayRequest.cs │ │ │ ├── FinancialRechargeRequest.cs │ │ │ ├── GetPhoneUserRequest.cs │ │ │ ├── GetPhoneUserResponse.cs │ │ │ ├── GetUserInfoResponse.cs │ │ │ ├── GetUserRequest.cs │ │ │ ├── GetUserResponse.cs │ │ │ ├── LogonCheckRequest.cs │ │ │ ├── LogonCheckResponse.cs │ │ │ ├── RandomPasswordResponse.cs │ │ │ ├── RegisterUserRequest.cs │ │ │ ├── RegisterWxUserRequest.cs │ │ │ ├── ResetUserPasswordRequest.cs │ │ │ ├── ResetUserPasswordResponse.cs │ │ │ ├── SearchUserRequest.cs │ │ │ ├── SearchUserResponse.cs │ │ │ ├── SetPayPwdUserRequest.cs │ │ │ ├── UpdateArea.cs │ │ │ ├── UpdateAreaRequest.cs │ │ │ ├── UpdateBusinessManagerRequest.cs │ │ │ ├── UpdateEmailRequest.cs │ │ │ ├── UpdateMemberGradesRequest.cs │ │ │ ├── UpdateNickNameRequest.cs │ │ │ ├── UpdatePhoneUserRequest.cs │ │ │ ├── UpdatePwdUserRequest.cs │ │ │ ├── UpdateRealNameRequest.cs │ │ │ ├── UpdateRetrievePwdUserRequest.cs │ │ │ ├── UpdateUserLableRequest.cs │ │ │ ├── UpdateUserLogoRequest.cs │ │ │ ├── UpdateUserNameRequest.cs │ │ │ ├── UpdateUserStatusRequest.cs │ │ │ └── WxLogonCheckRequest.cs │ ├── Sikiro.Service.Customer │ │ ├── 3.Sikiro.Service.Customer.csproj │ │ ├── BaseService.cs │ │ ├── Bo │ │ │ └── SearchUserBo.cs │ │ ├── Enums │ │ │ └── PersonEnum.cs │ │ └── UserService.cs │ └── Sikiro.WebApi.Customer │ │ ├── 1.Sikiro.WebApi.Customer.csproj │ │ ├── Attribute │ │ ├── ChineseAttribute.cs │ │ ├── EmailAttribute.cs │ │ ├── GolbalExceptionAttribute.cs │ │ ├── IdCardAttribute.cs │ │ ├── MobileAttribute.cs │ │ ├── PasswordAttribute.cs │ │ └── TableColsAttribute.cs │ │ ├── Controllers │ │ ├── BaseController.cs │ │ └── UserController.cs │ │ ├── Extention │ │ ├── ConstString.cs │ │ ├── DependenceExtension.cs │ │ ├── ModelStateExtensions.cs │ │ ├── StartupExtension.cs │ │ └── TrimModelBinder.cs │ │ ├── GS.WebApi.Customer.xml │ │ ├── Models │ │ ├── Enums │ │ │ └── PersonEnum.cs │ │ ├── PageList │ │ │ └── PageListResponse.cs │ │ └── User │ │ │ ├── Request │ │ │ ├── EmailRequest.cs │ │ │ ├── NickNameRequest.cs │ │ │ ├── RealNameRequest.cs │ │ │ ├── SendSmsRequest.cs │ │ │ ├── UserBindingWxRequest.cs │ │ │ ├── UserChangePayPwdRequest.cs │ │ │ ├── UserCheckingPayPasswordRequest.cs │ │ │ ├── UserLogoRequest.cs │ │ │ ├── UserLogonRequest.cs │ │ │ ├── UserNameRequest.cs │ │ │ ├── UserRegisterRequest.cs │ │ │ ├── UserSetPayPwdRequest.cs │ │ │ ├── UserUpdatePhoneRequest.cs │ │ │ ├── UserUpdatePwdRequest.cs │ │ │ ├── UserWxLogonCheckRequest.cs │ │ │ ├── UserWxRegisterRequest.cs │ │ │ └── VaildSmsRequest.cs │ │ │ └── Response │ │ │ ├── UserGetPhoneResponse.cs │ │ │ ├── UserGetResponse.cs │ │ │ └── UserLogonResponse.cs │ │ ├── Program.cs │ │ ├── Properties │ │ ├── PublishProfiles │ │ │ └── FolderProfile.pubxml │ │ └── launchSettings.json │ │ ├── Startup.cs │ │ ├── appsettings.Development.json │ │ ├── appsettings.Production.json │ │ ├── appsettings.Test.json │ │ ├── appsettings.json │ │ ├── log4net.config │ │ └── skyapm.json └── 客户系统解决方案 │ ├── GS.Common.Utils │ ├── 4.Sikiro.Common.Utils.csproj │ ├── AdministratorData.cs │ ├── EnumberHelper.cs │ ├── HttpContextExtension.cs │ ├── MoneyExtension.cs │ ├── ObjectExtension.cs │ ├── RegularExpression.cs │ └── StringExtension.cs │ ├── 业务API服务 │ ├── GS.Entity.Customer │ │ ├── 3.Sikiro.Entity.Customer.csproj │ │ ├── DBContext │ │ │ └── PersonPlatformContext.cs │ │ ├── User.cs │ │ └── __entity.xml │ ├── GS.InnerApi.Customer │ │ ├── 1.Sikiro.InnerApi.Customer.csproj │ │ ├── Controllers │ │ │ ├── BaseController.cs │ │ │ └── UserController.cs │ │ ├── Extention │ │ │ ├── DependenceExtension.cs │ │ │ └── ModelStateExtensions.cs │ │ ├── GS.InnerApi.Customer.xml │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Sikiro.InnerApi.Customer.xml │ │ ├── Startup.cs │ │ ├── appsettings.Development.json │ │ ├── appsettings.Production.json │ │ ├── appsettings.Tes.json │ │ ├── appsettings.json │ │ ├── log4net.config │ │ └── skyapm.json │ ├── GS.Interface.Customer │ │ ├── 0.Sikiro.Interface.Customer.csproj │ │ ├── ICustomer.cs │ │ ├── IUser.cs │ │ └── User │ │ │ ├── BindingWxRequest.cs │ │ │ ├── ChangePayPwdUserRequest.cs │ │ │ ├── CheckingPayPasswordRequest.cs │ │ │ ├── FinancialBalancePayRequest.cs │ │ │ ├── FinancialRechargeRequest.cs │ │ │ ├── GetPhoneUserRequest.cs │ │ │ ├── GetPhoneUserResponse.cs │ │ │ ├── GetUserInfoResponse.cs │ │ │ ├── GetUserRequest.cs │ │ │ ├── GetUserResponse.cs │ │ │ ├── LogonCheckRequest.cs │ │ │ ├── LogonCheckResponse.cs │ │ │ ├── RandomPasswordResponse.cs │ │ │ ├── RegisterUserRequest.cs │ │ │ ├── RegisterWxUserRequest.cs │ │ │ ├── ResetUserPasswordRequest.cs │ │ │ ├── ResetUserPasswordResponse.cs │ │ │ ├── SearchUserRequest.cs │ │ │ ├── SearchUserResponse.cs │ │ │ ├── SetPayPwdUserRequest.cs │ │ │ ├── UpdateArea.cs │ │ │ ├── UpdateAreaRequest.cs │ │ │ ├── UpdateBusinessManagerRequest.cs │ │ │ ├── UpdateEmailRequest.cs │ │ │ ├── UpdateMemberGradesRequest.cs │ │ │ ├── UpdateNickNameRequest.cs │ │ │ ├── UpdatePhoneUserRequest.cs │ │ │ ├── UpdatePwdUserRequest.cs │ │ │ ├── UpdateRealNameRequest.cs │ │ │ ├── UpdateRetrievePwdUserRequest.cs │ │ │ ├── UpdateUserLableRequest.cs │ │ │ ├── UpdateUserLogoRequest.cs │ │ │ ├── UpdateUserNameRequest.cs │ │ │ ├── UpdateUserStatusRequest.cs │ │ │ └── WxLogonCheckRequest.cs │ └── GS.Service.Customer │ │ ├── 2.Sikiro.Service.Customer.csproj │ │ ├── BaseService.cs │ │ ├── Bo │ │ └── SearchUserBo.cs │ │ ├── Enums │ │ └── PersonEnum.cs │ │ └── UserService.cs │ └── 聚合API服务 │ └── GS.WebApi.Customer │ ├── Attribute │ ├── ChineseAttribute.cs │ ├── EmailAttribute.cs │ ├── GolbalExceptionAttribute.cs │ ├── IdCardAttribute.cs │ ├── MobileAttribute.cs │ ├── PasswordAttribute.cs │ └── TableColsAttribute.cs │ ├── Controllers │ ├── BaseController.cs │ └── UserController.cs │ ├── Extention │ ├── ConstString.cs │ ├── DependenceExtension.cs │ ├── ModelStateExtensions.cs │ ├── StartupExtension.cs │ └── TrimModelBinder.cs │ ├── GS.WebApi.Customer.xml │ ├── Models │ ├── Enums │ │ └── PersonEnum.cs │ ├── PageList │ │ └── PageListResponse.cs │ └── User │ │ ├── Request │ │ ├── EmailRequest.cs │ │ ├── NickNameRequest.cs │ │ ├── RealNameRequest.cs │ │ ├── SendSmsRequest.cs │ │ ├── UserBindingWxRequest.cs │ │ ├── UserChangePayPwdRequest.cs │ │ ├── UserCheckingPayPasswordRequest.cs │ │ ├── UserLogoRequest.cs │ │ ├── UserLogonRequest.cs │ │ ├── UserNameRequest.cs │ │ ├── UserRegisterRequest.cs │ │ ├── UserSetPayPwdRequest.cs │ │ ├── UserUpdatePhoneRequest.cs │ │ ├── UserUpdatePwdRequest.cs │ │ ├── UserWxLogonCheckRequest.cs │ │ ├── UserWxRegisterRequest.cs │ │ └── VaildSmsRequest.cs │ │ └── Response │ │ ├── UserGetPhoneResponse.cs │ │ ├── UserGetResponse.cs │ │ └── UserLogonResponse.cs │ ├── Program.cs │ ├── Properties │ ├── PublishProfiles │ │ └── FolderProfile.pubxml │ └── launchSettings.json │ ├── Sikiro.WebApi.Customer.csproj │ ├── Startup.cs │ ├── appsettings.Development.json │ ├── appsettings.Production.json │ ├── appsettings.Test.json │ ├── appsettings.json │ ├── log4net.config │ └── skyapm.json └── src ├── DotNetCore.CAP.MySql ├── CAP.EFOptions.cs ├── CAP.MySqlCapOptionsExtension.cs ├── CAP.MySqlOptions.cs ├── CAP.Options.Extensions.cs ├── DotNetCore.CAP.MySql.csproj ├── ICapPublisher.MySql.cs ├── ICapTransaction.MySql.cs ├── ICollectProcessor.MySql.cs ├── IDbContextTransaction.CAP.cs ├── IMonitoringApi.MySql.cs ├── IStorage.MySql.cs ├── IStorageConnection.MySql.cs └── IStorageTransaction.MySql.cs ├── Sikiro.Bus.Extension ├── BaseConsumer.cs ├── BusExtension.cs ├── ConsumerExtension.cs ├── EasyNetQEntity.cs ├── IBusConsumer.cs ├── IocExtension.cs └── Sikiro.Bus.Extension.csproj ├── Sikiro.Chloe.Cap ├── CapOptionsExtensions.cs ├── CapTransactionExtensions.cs ├── ConnectionParser │ ├── ConnectionConfiguration.cs │ ├── ConnectionStringGrammar.cs │ ├── IConnectionStringParser.cs │ ├── Preconditions.cs │ └── Sprache │ │ ├── Failure.cs │ │ ├── IFailure.cs │ │ ├── IResultOfT.cs │ │ ├── ISuccess.cs │ │ ├── Input.cs │ │ ├── Parse.cs │ │ ├── ParseException.cs │ │ ├── ParserOfT.cs │ │ ├── ResultHelper.cs │ │ └── Success.cs ├── Properties │ └── PublishProfiles │ │ └── FolderProfile.pubxml ├── Sikiro.Chloe.Cap.csproj └── TransactionExtension.cs ├── Sikiro.Chloe.Extension ├── IocExtension.cs ├── MySqlConnectionFactory.cs ├── QueryExtension.cs ├── Sikiro.Chloe.Extension.csproj └── Transcation.cs ├── Sikiro.Elasticsearch.Extension ├── ElasticClientExtension.cs ├── ElasticsearchEntity.cs ├── IocExtension.cs ├── ResponseExtension.cs ├── SearchRequestExtension.cs ├── Sikiro.Elasticsearch.Extension.csproj └── TypeExtension.cs ├── Sikiro.MicroService.Extension ├── Attributes │ └── GolbalExceptionAttribute.cs ├── Consul │ └── ConsulExtensions.cs ├── Sikiro.MicroService.Extension.csproj ├── SkyApm │ ├── Diagnostics │ │ ├── MongoTracingDiagnosticProcessor.cs │ │ └── SkyWalkingBuilderExtensions.cs │ ├── IgnoreSamplingInterceptor.cs │ └── SkyApmExtension.cs └── WebApiClient │ ├── BaseController.cs │ ├── DependencyInjectionExtensions.cs │ └── HttpApiFactoryBuilder.cs ├── Sikiro.Nosql.Mongo ├── Base │ ├── MongoAttribute.cs │ ├── MongoEntity.cs │ └── Types.cs ├── Diagnostics │ ├── ExcuteData.cs │ ├── ExcuteExceptionData.cs │ └── MongoDiagnosticListenerExtensions.cs ├── Extension │ ├── AttributeHelper.cs │ ├── EnumerableExtension.cs │ ├── LambdaExpressExtension.cs │ ├── MongoExtension.cs │ ├── MongoSortExpression.cs │ ├── MongoUpdateExpression.cs │ └── ReflectionExtension.cs ├── MongoHelper.cs ├── MongoRepository.cs ├── Properties │ └── PublishProfiles │ │ └── FolderProfile.pubxml └── Sikiro.Nosql.Mongo.csproj ├── Sikiro.Nosql.Redis ├── Base │ ├── RedisENum.cs │ ├── RedisExpression.cs │ └── RedisExtensions.cs ├── RedisRepository.cs └── Sikiro.Nosql.Redis.csproj ├── Sikiro.Tookits ├── Base │ ├── ApiResult.cs │ ├── DropDownItem.cs │ ├── Enum │ │ ├── ApiResultCode.cs │ │ ├── ESort.cs │ │ └── ServiceResultCode.cs │ ├── ExceptionMsg.cs │ ├── PageList.cs │ ├── PageListParams.cs │ ├── ServiceResult.cs │ ├── Sort.cs │ └── Types.cs ├── Extension │ ├── EncryptExtension.cs │ ├── EnumExtension.cs │ ├── EnumerableExtensions.cs │ ├── ExceptionExtension.cs │ ├── HttpContextExtension.cs │ ├── HttpExtension.cs │ ├── MapperExtension.cs │ ├── ObjectExtension.cs │ ├── ReflectionExtension.cs │ ├── SerializeExtension.cs │ ├── StringExtension.cs │ ├── TimeSpanExtension.cs │ └── TryConvertExtension.cs ├── Files │ ├── ExcelClient.cs │ ├── ExcelClientExtension.cs │ ├── ExcelNoMapAttribute.cs │ ├── ExcelOption.cs │ ├── ImportEntity.cs │ └── TookitsFilesException.cs ├── Helper │ ├── AttributeHelper.cs │ ├── ExpressionBuilder.cs │ ├── GuidHelper.cs │ ├── HttpWebHelper.cs │ ├── LoggerHelper.cs │ └── RandomHelper.cs ├── Interfaces │ ├── ICache.cs │ └── IDepend.cs ├── Sikiro.Tookits.csproj └── Snowflake │ ├── DisposableAction.cs │ ├── IdWorker.cs │ └── TimeExtensions.cs ├── SkyApm.Diagnostics.AspNetCore ├── Handlers │ ├── DefaultHostingDiagnosticHandler.cs │ ├── GrpcHostingDiagnosticHandler.cs │ └── IHostingDiagnosticHandler.cs ├── HostingDiagnosticProcessor.cs ├── HttpContextDiagnosticStrings.cs ├── HttpRequestCarrierHeaderCollection.cs ├── Properties │ └── PublishProfiles │ │ └── FolderProfile.pubxml ├── SkyApm.Diagnostics.AspNetCore.csproj └── SkyWalkingBuilderExtensions.cs └── SkyApm.Diagnostics.HttpClient ├── Handlers ├── DefaultRequestDiagnosticHandler.cs ├── GrpcRequestDiagnosticHandler.cs └── IRequestDiagnosticHandler.cs ├── HttpClientDiagnosticProcessor.cs ├── HttpClientICarrierHeaderCollection.cs ├── Properties └── PublishProfiles │ └── FolderProfile.pubxml ├── SkyApm.Diagnostics.HttpClient.csproj └── SkyWalkingBuilderExtensions.cs /.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/bin 16 | **/charts 17 | **/docker-compose* 18 | **/Dockerfile* 19 | **/node_modules 20 | **/npm-debug.log 21 | **/obj 22 | **/secrets.dev.yaml 23 | **/values.dev.yaml 24 | LICENSE 25 | README.md -------------------------------------------------------------------------------- /samples/Sikiro.Chloe.Cap.Samples/AppDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | 3 | namespace GS.Chloe.Cap.Samples 4 | { 5 | public class Person 6 | { 7 | public int Id { get; set; } 8 | 9 | public string Name { get; set; } 10 | } 11 | 12 | public class AppDbContext : DbContext 13 | { 14 | public const string ConnectionString = "Server=im.gshichina.com;Port=5002;Database=business_platform;Uid=ge;Pwd=shi2019"; 15 | 16 | public DbSet Persons { get; set; } 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/Sikiro.Chloe.Cap.Samples/Db/BusinessPlatformContext.cs: -------------------------------------------------------------------------------- 1 | using Chloe.Infrastructure; 2 | using Chloe.MySql; 3 | 4 | namespace Sikiro.Chloe.Cap.Samples.Db 5 | { 6 | /// 7 | /// 企业平台 8 | /// 9 | public class BusinessPlatformContext : MySqlContext 10 | { 11 | public BusinessPlatformContext(IDbConnectionFactory dbConnectionFactory) : base(dbConnectionFactory) 12 | { 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /samples/Sikiro.Chloe.Cap.Samples/Db/Test.cs: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * 本文件由根据实体插件自动生成,请勿更改 4 | * =========================== */ 5 | 6 | using Chloe.Annotations; 7 | 8 | namespace Sikiro.Chloe.Cap.Samples.Db 9 | { 10 | /// 11 | /// 12 | /// 13 | [Table("Test")] 14 | public class Test 15 | { 16 | 17 | /// 18 | /// Id 19 | /// 20 | [Column("Id")] 21 | public string Id{ get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /samples/Sikiro.Chloe.Cap.Samples/Db/Test1.cs: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * 本文件由根据实体插件自动生成,请勿更改 4 | * =========================== */ 5 | 6 | using System; 7 | using Chloe.Annotations; 8 | 9 | namespace Sikiro.Chloe.Cap.Samples.Db 10 | { 11 | /// 12 | /// 13 | /// 14 | [Table("Test1")] 15 | public class Test1 16 | { 17 | 18 | /// 19 | /// Time 20 | /// 21 | [Column("Time")] 22 | public DateTime? Time{ get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /samples/Sikiro.Chloe.Cap.Samples/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace Sikiro.Chloe.Cap.Samples 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateWebHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 14 | WebHost.CreateDefaultBuilder(args) 15 | .UseStartup(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/Sikiro.Chloe.Cap.Samples/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:50761", 7 | "sslPort": 0 8 | } 9 | }, 10 | "$schema": "http://json.schemastore.org/launchsettings.json", 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "api/values", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "GS.Chloe.Cap.Samples": { 21 | "commandName": "Project", 22 | "launchBrowser": true, 23 | "launchUrl": "api/values", 24 | "environmentVariables": { 25 | "ASPNETCORE_ENVIRONMENT": "Development" 26 | }, 27 | "applicationUrl": "http://localhost:5000" 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /samples/Sikiro.Chloe.Cap.Samples/Sikiro.Chloe.Cap.Samples.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | InProcess 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /samples/Sikiro.Chloe.Cap.Samples/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/Sikiro.Chloe.Cap.Samples/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /samples/Sikiro.Chloe.Cap.SamplesB/AppDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | 3 | namespace GS.Chloe.Cap.Samples 4 | { 5 | public class Person 6 | { 7 | public int Id { get; set; } 8 | 9 | public string Name { get; set; } 10 | } 11 | 12 | public class AppDbContext : DbContext 13 | { 14 | public const string ConnectionString = "Server=im.gshichina.com;Port=5002;Database=business_platform;Uid=ge;Pwd=shi2019"; 15 | 16 | public DbSet Persons { get; set; } 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/Sikiro.Chloe.Cap.SamplesB/Db/BusinessPlatformContext.cs: -------------------------------------------------------------------------------- 1 | using Chloe.Infrastructure; 2 | using Chloe.MySql; 3 | 4 | namespace Sikiro.Chloe.Cap.SamplesB.Db 5 | { 6 | /// 7 | /// 企业平台 8 | /// 9 | public class BusinessPlatformContext : MySqlContext 10 | { 11 | public BusinessPlatformContext(IDbConnectionFactory dbConnectionFactory) : base(dbConnectionFactory) 12 | { 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /samples/Sikiro.Chloe.Cap.SamplesB/Db/Test.cs: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * 本文件由根据实体插件自动生成,请勿更改 4 | * =========================== */ 5 | 6 | using Chloe.Annotations; 7 | 8 | namespace Sikiro.Chloe.Cap.SamplesB.Db 9 | { 10 | /// 11 | /// 12 | /// 13 | [Table("Test")] 14 | public class Test 15 | { 16 | 17 | /// 18 | /// Id 19 | /// 20 | [Column("Id")] 21 | public string Id{ get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /samples/Sikiro.Chloe.Cap.SamplesB/Db/Test1.cs: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * 本文件由根据实体插件自动生成,请勿更改 4 | * =========================== */ 5 | 6 | using System; 7 | using Chloe.Annotations; 8 | 9 | namespace Sikiro.Chloe.Cap.SamplesB.Db 10 | { 11 | /// 12 | /// 13 | /// 14 | [Table("Test1")] 15 | public class Test1 16 | { 17 | 18 | /// 19 | /// Time 20 | /// 21 | [Column("Time")] 22 | public DateTime? Time{ get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /samples/Sikiro.Chloe.Cap.SamplesB/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace Sikiro.Chloe.Cap.SamplesB 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateWebHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 14 | WebHost.CreateDefaultBuilder(args) 15 | .UseStartup(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/Sikiro.Chloe.Cap.SamplesB/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:50765", 7 | "sslPort": 0 8 | } 9 | }, 10 | "$schema": "http://json.schemastore.org/launchsettings.json", 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "api/values", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | }, 19 | "applicationUrl": "http://localhost:50765" 20 | }, 21 | "GS.Chloe.Cap.Samples": { 22 | "commandName": "Project", 23 | "launchBrowser": true, 24 | "launchUrl": "api/values", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | }, 28 | "applicationUrl": "http://localhost:1234" 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /samples/Sikiro.Chloe.Cap.SamplesB/Sikiro.Chloe.Cap.SamplesB.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | InProcess 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /samples/Sikiro.Chloe.Cap.SamplesB/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/Sikiro.Chloe.Cap.SamplesB/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /samples/Sikiro.MongoDB.Demo/Sikiro.MongoDB.Demo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/Id发号/GS.Infrastructure.Id/GS.Infrastructure.Id.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Sikiro.Infrastructure.Id 5 | 6 | 7 | 8 | 9 | id发号器 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/Id发号/GS.Infrastructure.Id/Models/FormatType.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Sikiro.Infrastructure.Id.Models 4 | { 5 | public static class FormatType 6 | { 7 | public static Dictionary DicType = new Dictionary 8 | { 9 | { "yyyyMMdd","DateTime" }, 10 | { "yyyyMMddHHmmss","DateTime" }, 11 | { "D","int" } 12 | }; 13 | 14 | static FormatType() 15 | { 16 | for (var i = 1; i <= 30; i++) 17 | { 18 | DicType.Add("D" + i, "int"); 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/Id发号/GS.Infrastructure.Id/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace Sikiro.Infrastructure.Id 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateWebHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 14 | WebHost.CreateDefaultBuilder(args) 15 | .UseStartup(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/Id发号/GS.Infrastructure.Id/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:8099", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development", 16 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "SkyAPM.Agent.AspNetCore" 17 | } 18 | }, 19 | "GeShiIMPortal": { 20 | "commandName": "Project", 21 | "launchBrowser": true, 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development", 24 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "SkyAPM.Agent.AspNetCore" 25 | }, 26 | "applicationUrl": "http://localhost:8099" 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/Id发号/GS.Infrastructure.Id/Sikiro.Infrastructure.Id.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Sikiro.Infrastructure.Id 5 | 6 | 7 | 8 | 9 | id发号器 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/Id发号/GS.Infrastructure.Id/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "redisUrl": "", 10 | "Consul": { 11 | "ServiceName": "IDGenerate", 12 | "ConsulHost": "http://47.106.228.67:5037", 13 | "SelfPort": 80 14 | } 15 | } -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/Id发号/GS.Infrastructure.Id/appsettings.Testing.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "redisUrl": "", 10 | "Consul": { 11 | "ServiceName": "IDGenerate", 12 | "ConsulHost": "http://47.106.228.67:5037", 13 | "SelfPort": 80 14 | } 15 | } -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/Id发号/GS.Infrastructure.Id/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "redisUrl": "", 10 | "Consul": { 11 | "ServiceName": "IDGenerate", 12 | "ConsulHost": "http://47.106.228.67:5037", 13 | "SelfPort": 80 14 | } 15 | } -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/Id发号/GS.Infrastructure.Id/appsettings.pro.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "redisUrl": "", 10 | "Consul": { 11 | "ServiceName": "IDGenerate", 12 | "ConsulHost": "http://47.106.228.67:5037", 13 | "SelfPort": 80 14 | } 15 | } -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/Id发号/GS.Infrastructure.Id/skyapm.json: -------------------------------------------------------------------------------- 1 | { 2 | "SkyWalking": { 3 | "ServiceName": "GS.Infrastructure.Id", 4 | "Namespace": "", 5 | "HeaderVersions": [ 6 | "sw6" 7 | ], 8 | "Sampling": { 9 | "SamplePer3Secs": -1, 10 | "Percentage": -1.0 11 | }, 12 | "Logging": { 13 | "Level": "Information", 14 | "FilePath": "logs/skyapm-{Date}.log" 15 | }, 16 | "Transport": { 17 | "Interval": 3000, 18 | "ProtocolVersion": "v6", 19 | "QueueSize": 30000, 20 | "BatchSize": 3000, 21 | "gRPC": { 22 | "Servers": "im.gshichina.com:5046", 23 | "Timeout": 10000, 24 | "ConnectTimeout": 10000, 25 | "ReportTimeout": 600000 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/Id发号/GS.Interface.Id.Test/IdTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Linq; 4 | using NUnit.Framework; 5 | using WebApiClient; 6 | 7 | namespace Sikiro.Interface.Id.Test 8 | { 9 | public class IdTest 10 | { 11 | private IId _id; 12 | 13 | [SetUp] 14 | public void Setup() 15 | { 16 | HttpApi.Register().ConfigureHttpApiConfig(c => 17 | { 18 | c.HttpHost = new Uri("http://localhost:8099/"); 19 | c.FormatOptions.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; 20 | }); 21 | 22 | _id = HttpApi.Resolve(); 23 | } 24 | 25 | [Test] 26 | public void Logon_IsNormal_IsTrue() 27 | { 28 | var sw = Stopwatch.StartNew(); 29 | 30 | Enumerable.Range(1, 1000).AsParallel().ForAll(a => 31 | { 32 | var order = _id.Create("GS|D10"); 33 | }); 34 | 35 | sw.Stop(); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/Id发号/GS.Interface.Id.Test/Sikiro.Interface.Id.Test.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/Id发号/GS.Interface.Id/IId.cs: -------------------------------------------------------------------------------- 1 | using WebApiClient; 2 | using WebApiClient.Attributes; 3 | 4 | namespace Sikiro.Interface.Id 5 | { 6 | /// 7 | /// Id生成(GS|D10) 8 | /// 9 | public interface IId : IHttpApi 10 | { 11 | 12 | [HttpPost("Id/Generate")] 13 | ITask Create(string format = null); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/Id发号/GS.Interface.Id/Sikiro.Interface.Id.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 1.0.0.4 6 | 1.0.0.4 7 | id生成服务 8 | 陈珙 9 | 葛氏 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/搜索/Sikiro.ES.Api/Attribute/ChineseAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using Sikiro.Common.Utils; 3 | 4 | namespace Sikiro.ES.Api.Attribute 5 | { 6 | /// 7 | /// 中文 8 | /// 9 | public class ChineseAttribute : RegularExpressionAttribute 10 | { 11 | private const string RegexPattern = RegularExpression.Chinese; 12 | public ChineseAttribute() 13 | : base(RegexPattern) 14 | { 15 | ErrorMessage = "请输入中文"; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/搜索/Sikiro.ES.Api/Attribute/EmailAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.ES.Api.Attribute 4 | { 5 | /// 6 | /// 邮箱验证特性 7 | /// 8 | public class EmailAttribute : RegularExpressionAttribute 9 | { 10 | private const string RegexPattern = @"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"; 11 | public EmailAttribute(): base(RegexPattern) 12 | { 13 | ErrorMessage = "邮箱格式不正确"; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/搜索/Sikiro.ES.Api/Attribute/GolbalExceptionAttribute.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.Filters; 3 | using Sikiro.Tookits.Base; 4 | using Sikiro.Tookits.Extension; 5 | 6 | namespace Sikiro.ES.Api.Attribute 7 | { 8 | /// 9 | /// 全局异常捕获 10 | /// 11 | public class GolbalExceptionAttribute : ExceptionFilterAttribute 12 | { 13 | public override void OnException(ExceptionContext context) 14 | { 15 | if (!context.ExceptionHandled) 16 | { 17 | var exception = context.Exception.GetDeepestException(); 18 | exception.WriteToFile("全局异常捕抓"); 19 | 20 | context.ExceptionHandled = true; 21 | context.Result = new ObjectResult(ApiResult.IsError(exception.Message)); 22 | context.HttpContext.Response.StatusCode = 500; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/搜索/Sikiro.ES.Api/Attribute/IdCardAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using Sikiro.Common.Utils; 3 | 4 | namespace Sikiro.ES.Api.Attribute 5 | { 6 | /// 7 | /// 邮箱验证特性 8 | /// 9 | public class IdCardAttribute : RegularExpressionAttribute 10 | { 11 | private const string RegexPattern = RegularExpression.IdNum; 12 | public IdCardAttribute(): base(RegexPattern) 13 | { 14 | ErrorMessage = "身份证格式不正确"; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/搜索/Sikiro.ES.Api/Attribute/MobileAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.ES.Api.Attribute 4 | { 5 | /// 6 | /// 手机号码 7 | /// 8 | public class MobileAttribute : RegularExpressionAttribute 9 | { 10 | private const string RegexPattern = @"^1[0-9]{10}$"; 11 | public MobileAttribute() : base(RegexPattern) 12 | { 13 | ErrorMessage = "手机号码不正确"; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/搜索/Sikiro.ES.Api/Attribute/PasswordAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.ES.Api.Attribute 4 | { 5 | /// 6 | /// 密码验证特性 7 | /// 8 | public class PasswordAttribute : RegularExpressionAttribute 9 | { 10 | private const string RegexPattern = @"^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{6,18}$"; 11 | public PasswordAttribute(bool isFlag, string msg) : base(RegexPattern) 12 | { 13 | if (isFlag) 14 | { 15 | ErrorMessage = msg; 16 | } 17 | else 18 | { 19 | ErrorMessage = "请输入6-18位字母与数字组合的密码"; 20 | } 21 | 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/搜索/Sikiro.ES.Api/Attribute/TableColsAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.ES.Api.Attribute 4 | { 5 | public class TableColsAttribute : System.Attribute 6 | { 7 | public TableColsAttribute() 8 | { 9 | Align = EAlign.Left; 10 | } 11 | public string Field { get; set; } 12 | 13 | public string Tile { get; set; } 14 | 15 | public int Width { get; set; } 16 | 17 | public EAlign Align { get; set; } 18 | 19 | private bool _isImage = false; 20 | public bool IsImage { get => _isImage; set => _isImage = value; } 21 | } 22 | 23 | public enum EAlign 24 | { 25 | [Display(Name = "center")] 26 | Center = 0, 27 | [Display(Name = "right")] 28 | Right = 1, 29 | [Display(Name = "left")] 30 | Left = 2, 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/搜索/Sikiro.ES.Api/Controllers/BaseController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace Sikiro.ES.Api.Controllers 4 | { 5 | [ApiController] 6 | public class BaseController : ControllerBase 7 | { 8 | 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/搜索/Sikiro.ES.Api/Extention/ModelStateExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | using Microsoft.AspNetCore.Mvc.ModelBinding; 3 | 4 | namespace Sikiro.ES.Api.Extention 5 | { 6 | public static class ModelStateExtensions 7 | { 8 | /// 9 | /// 获取模型验证错误信息 10 | /// 11 | /// 12 | /// 13 | public static string GetModelStateMsg(this ModelStateDictionary modelState) 14 | { 15 | var builder = new StringBuilder(); 16 | 17 | foreach (var key in modelState.Keys) 18 | { 19 | var errors = modelState[key].Errors; 20 | 21 | foreach (var error in errors) 22 | { 23 | if (builder.Length > 0) 24 | builder.Append("
"); 25 | 26 | builder.Append(error.ErrorMessage); 27 | } 28 | } 29 | 30 | return builder.ToString(); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/搜索/Sikiro.ES.Api/Model/BaseRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.ES.Api.Model 4 | { 5 | public abstract class BaseRequest 6 | { 7 | private int? _size; 8 | /// 9 | /// 长度 10 | /// 11 | [Range(0, 1000)] 12 | public int Size 13 | { 14 | get => _size ?? 10; 15 | set => _size = value; 16 | } 17 | 18 | /// 19 | /// 上次查询的时间戳 20 | /// 21 | public long? Timestamp { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/搜索/Sikiro.ES.Api/Model/EsConst.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.ES.Api.Model 2 | { 3 | public static class EsConst 4 | { 5 | public static string TimeZone = "+08:00"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/搜索/Sikiro.ES.Api/Model/SearchKey/Enum/ESearchKey.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.ES.Api.Model.SearchKey.Enum 2 | { 3 | public static class ESearchKey 4 | { 5 | public enum EntityType 6 | { 7 | Comic = 0, 8 | Novel = 1, 9 | Album = 2, 10 | ChatNovel = 3, 11 | AllNovel = 4, 12 | FanNovel = 5, 13 | Maskword = 6, 14 | } 15 | 16 | public enum Sort 17 | { 18 | Weight = 1, 19 | ActiveDate = 2 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/搜索/Sikiro.ES.Api/Model/SearchKey/SearchKeyCountRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Sikiro.ES.Api.Model.SearchKey.Enum; 3 | 4 | namespace Sikiro.ES.Api.Model.SearchKey 5 | { 6 | /// 7 | /// 列表 8 | /// 9 | public class SearchKeyCountRequest 10 | { 11 | /// 12 | /// 搜索键 13 | /// 14 | public string KeyName { get; set; } 15 | 16 | /// 17 | /// 是否描述 18 | /// 19 | public bool? IsSubsidiary { get; set; } 20 | 21 | /// 22 | /// 标签ID 23 | /// 24 | public List SysTagIds { get; set; } 25 | 26 | /// 27 | /// 作品类型 28 | /// 29 | public ESearchKey.EntityType? EntityType { get; set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/搜索/Sikiro.ES.Api/Model/SearchKey/SearchKeyRanameRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.ES.Api.Model.SearchKey 2 | { 3 | /// 4 | /// 列表 5 | /// 6 | public class SearchKeyRanameRequest 7 | { 8 | public string IndexName { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/搜索/Sikiro.ES.Api/Model/UserViewDuration/MQ/UserViewDurationConsumer.cs: -------------------------------------------------------------------------------- 1 | using Nest; 2 | using Sikiro.Bus.Extension; 3 | using Sikiro.Elasticsearch.Extension; 4 | using Sikiro.Tookits.Extension; 5 | using Sikiro.Tookits.Helper; 6 | 7 | namespace Sikiro.ES.Api.Model.UserViewDuration.MQ 8 | { 9 | public class UserViewDurationConsumer : BaseConsumer 10 | { 11 | private readonly ElasticClient _elasticClient; 12 | 13 | public UserViewDurationConsumer(ElasticClient elasticClient) 14 | { 15 | _elasticClient = elasticClient; 16 | } 17 | 18 | public override void Excute(UserViewDurationMessage msg) 19 | { 20 | var document = msg.MapTo(); 21 | 22 | var result = _elasticClient.Create(document, a => a.Index(typeof(Entity.UserViewDuration).GetRelationName() + "-" + msg.CreateDateTime.ToString("yyyy-MM"))).GetApiResult(); 23 | if (result.Failed) 24 | LoggerHelper.WriteToFile(result.Message); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/搜索/Sikiro.ES.Api/Model/UserViewDuration/MQ/UserViewDurationMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using EasyNetQ; 3 | using Sikiro.Bus.Extension; 4 | 5 | namespace Sikiro.ES.Api.Model.UserViewDuration.MQ 6 | { 7 | [Queue("Queue.Sikiro.UserViewDuration", ExchangeName = "Exchange.Sikiro.UserViewDuration")] 8 | public class UserViewDurationMessage : EasyNetQEntity 9 | { 10 | public long EntityId { get; set; } 11 | 12 | public long EntityType { get; set; } 13 | 14 | public long CharpterId { get; set; } 15 | 16 | public long UserId { get; set; } 17 | 18 | public DateTime CreateDateTime { get; set; } 19 | 20 | public long Duration { get; set; } 21 | 22 | public string Ip { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/搜索/Sikiro.ES.Api/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace Sikiro.ES.Api 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateWebHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 14 | WebHost.CreateDefaultBuilder(args) 15 | .UseStartup(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/搜索/Sikiro.ES.Api/Properties/PublishProfiles/FolderProfile.pubxml: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 7 | False 8 | False 9 | True 10 | Release 11 | Any CPU 12 | FileSystem 13 | bin\Release\net5.0\publish\ 14 | FileSystem 15 | 16 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/搜索/Sikiro.ES.Api/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:8066", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development", 16 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "SkyAPM.Agent.AspNetCore" 17 | } 18 | }, 19 | "GS.InnerApi.Customer": { 20 | "commandName": "Project", 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development", 23 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "SkyAPM.Agent.AspNetCore" 24 | }, 25 | "applicationUrl": "http://localhost:8066" 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/搜索/Sikiro.ES.Api/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft": "Information" 6 | } 7 | }, 8 | "Elasticsearch": { 9 | "Uris": [ "http://120.1.1.1:9200" ], 10 | "UserName": "elastic2", 11 | "Password": "123456" 12 | }, 13 | "RabbitMQ": "host=120.1.1.1;username=admin;password=123456;prefetchcount=10", 14 | "ElasticApm": { 15 | "ServerUrls": "http://120.1.1.1:8200", 16 | "ServiceName": "Sikiro.ES.Api" 17 | } 18 | } -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/搜索/Sikiro.ES.Api/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft": "Information" 6 | } 7 | }, 8 | "Elasticsearch": { 9 | "Uris": [ "http://120.1.1.1:9200" ], 10 | "UserName": "elastic2", 11 | "Password": "123456" 12 | }, 13 | "RabbitMQ": "host=120.1.1.1;username=admin;password=123456;prefetchcount=10", 14 | "ElasticApm": { 15 | "ServerUrls": "http://120.1.1.1:8200", 16 | "ServiceName": "Sikiro.ES.Api" 17 | } 18 | } -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/消息推送/GS.Infrastructure.Msg/Dockerfile: -------------------------------------------------------------------------------- 1 | #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. 2 | 3 | FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base 4 | WORKDIR /app 5 | EXPOSE 80 6 | 7 | FROM base AS final 8 | WORKDIR /app 9 | COPY ./ /app 10 | ENV TZ=Asia/Shanghai 11 | RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone 12 | 13 | ENTRYPOINT ["dotnet", "GS.Infrastructure.Msg.dll"] -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/消息推送/GS.Infrastructure.Msg/Entitys/SmsRecord.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Sikiro.Nosql.Mongo.Base; 3 | 4 | namespace Sikiro.Infrastructure.Msg.Entitys 5 | { 6 | /// 7 | /// 发送短信 8 | /// 9 | [Mongo(DbConfig.Name)] 10 | public class SmsRecord : MongoEntity 11 | { 12 | /// 13 | /// 接收的手机号码 14 | /// 15 | public string PhoneNum { get; set; } 16 | 17 | /// 18 | /// 短信内容,例如验证码等 19 | /// 20 | public string Content { get; set; } 21 | 22 | /// 23 | /// 发送时间 24 | /// 25 | public DateTime SendTime { get; set; } 26 | 27 | /// 28 | /// Ip地址 29 | /// 30 | public string IpAddress { get; set; } 31 | } 32 | 33 | public class DbConfig 34 | { 35 | public const string Name = "geshiimdb"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/消息推送/GS.Infrastructure.Msg/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace Sikiro.Infrastructure.Msg 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateWebHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 14 | WebHost.CreateDefaultBuilder(args) 15 | .UseStartup(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/消息推送/GS.Infrastructure.Msg/Properties/PublishProfiles/FolderProfile.pubxml: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 7 | False 8 | False 9 | True 10 | Release 11 | Any CPU 12 | FileSystem 13 | bin\Release\net5.0\publish\ 14 | FileSystem 15 | 16 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/消息推送/GS.Infrastructure.Msg/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:8031", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development", 16 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "SkyAPM.Agent.AspNetCore" 17 | } 18 | }, 19 | "GeShiIMPortal": { 20 | "commandName": "Project", 21 | "launchBrowser": true, 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development", 24 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "SkyAPM.Agent.AspNetCore" 25 | }, 26 | "applicationUrl": "http://localhost:8099" 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/消息推送/GS.Infrastructure.Msg/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "redisUrl": "", 10 | "MongoDbUrl": "", 11 | "Consul": { 12 | "ServiceName": "Msg", 13 | "ConsulHost": "http://10.0.2.101:8500", 14 | "SelfPort": 80 15 | }, 16 | "Sms": { 17 | "key": "", 18 | "secret": "", 19 | "sign": "", 20 | "code": "", 21 | "foreignsign": "", 22 | "foreigncode": "" 23 | }, 24 | "IsDebug": false, 25 | "DefaultCode": "888888", 26 | "IpLimitCount": "10" 27 | } -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/消息推送/GS.Infrastructure.Msg/appsettings.Testing.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "redisUrl": "", 10 | "MongoDbUrl": "", 11 | "Consul": { 12 | "ServiceName": "Msg", 13 | "ConsulHost": "http://10.0.2.101:8500", 14 | "SelfPort": 80 15 | }, 16 | "Sms": { 17 | "key": "", 18 | "secret": "", 19 | "sign": "", 20 | "code": "", 21 | "foreignsign": "", 22 | "foreigncode": "" 23 | }, 24 | "IsDebug": false, 25 | "DefaultCode": "888888", 26 | "IpLimitCount": "10" 27 | } -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/消息推送/GS.Infrastructure.Msg/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "redisUrl": "", 10 | "MongoDbUrl": "", 11 | "Consul": { 12 | "ServiceName": "Msg", 13 | "ConsulHost": "http://10.0.2.101:8500", 14 | "SelfPort": 80 15 | }, 16 | "Sms": { 17 | "key": "", 18 | "secret": "", 19 | "sign": "", 20 | "code": "", 21 | "foreignsign": "", 22 | "foreigncode": "" 23 | }, 24 | "IsDebug": false, 25 | "DefaultCode": "888888", 26 | "IpLimitCount": "10" 27 | } -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/消息推送/GS.Infrastructure.Msg/appsettings.pro.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft": "Information" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "redisUrl": "", 10 | "MongoDbUrl": "", 11 | "Consul": { 12 | "ServiceName": "Msg", 13 | "ConsulHost": "http://47.106.228.67:5037", 14 | "SelfPort": 80 15 | }, 16 | "Sms": { 17 | "key": "", 18 | "secret": "", 19 | "sign": "", 20 | "code": "", 21 | "foreignsign": "", 22 | "foreigncode": "" 23 | }, 24 | "IsDebug": false, 25 | "DefaultCode": "888888", 26 | "IpLimitCount": "10" 27 | } -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/消息推送/GS.Infrastructure.Msg/skyapm.json: -------------------------------------------------------------------------------- 1 | { 2 | "SkyWalking": { 3 | "ServiceName": "GS.Infrastructure.Msg", 4 | "Namespace": "", 5 | "HeaderVersions": [ 6 | "sw6" 7 | ], 8 | "Sampling": { 9 | "SamplePer3Secs": -1, 10 | "Percentage": -1.0 11 | }, 12 | "Logging": { 13 | "Level": "Information", 14 | "FilePath": "logs/skyapm-{Date}.log" 15 | }, 16 | "Transport": { 17 | "Interval": 3000, 18 | "ProtocolVersion": "v6", 19 | "QueueSize": 30000, 20 | "BatchSize": 3000, 21 | "gRPC": { 22 | "Servers": "im.gshichina.com:5046", 23 | "Timeout": 10000, 24 | "ConnectTimeout": 10000, 25 | "ReportTimeout": 600000 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/消息推送/GS.Interface.Msg.Test/Sikiro.Interface.Msg.Test.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/消息推送/GS.Interface.Msg/IMsg.cs: -------------------------------------------------------------------------------- 1 | using WebApiClient; 2 | 3 | namespace Sikiro.Interface.Msg 4 | { 5 | public interface IMsg : IHttpApi 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/基础设施服务解决方案/消息推送/GS.Interface.Msg/Sikiro.Interface.Msg.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 1.0.0.4 6 | 1.0.0.9 7 | 发送消息服务接口 8 | 陈珙 9 | 葛氏 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Application.Customer/2.Sikiro.Application.Customer.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | Sikiro.Application.Customer 6 | Sikiro.Application.Customer 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Application.Customer/Ao/SendSmsAo.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Application.Customer.Ao 2 | { 3 | /// 4 | /// 登录请求 5 | /// 6 | public class SendSmsAo 7 | { 8 | /// 9 | /// 手机号码 10 | /// 11 | public string Phone { get; set; } 12 | 13 | /// 14 | /// IP地址 15 | /// 16 | public string Ip { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Application.Customer/Ao/UserLogonInputAo.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Application.Customer.Ao 4 | { 5 | /// 6 | /// 登录请求 7 | /// 8 | public class UserLogonInputAo 9 | { 10 | /// 11 | /// 用户账户 12 | /// 13 | public string UserName { get; set; } 14 | /// 15 | /// 用户密码 16 | /// 17 | public string Password { get; set; } 18 | 19 | /// 20 | /// 企业Id 21 | /// 22 | public string CompanyId { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Application.Customer/Ao/UserLogonOutputAo.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Application.Customer.Ao 2 | { 3 | /// 4 | /// 登录响应 5 | /// 6 | public class UserRegisterOutputAo 7 | { 8 | /// 9 | /// 用户id 10 | /// 11 | public string UserId { get; set; } 12 | 13 | /// 14 | /// 授权码 15 | /// 16 | public string AccessToken { get; set; } 17 | 18 | /// 19 | /// 用户WXid 20 | /// 21 | public string OpenId { get; set; } 22 | 23 | /// 24 | /// 公司ID 25 | /// 26 | public string CompanyId { get; set; } 27 | 28 | /// 29 | /// 登录令牌 30 | /// 31 | public string Token { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Application.Customer/Ao/UserUpdatePhoneAo.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Application.Customer.Ao 4 | { 5 | /// 6 | /// 用户信息 7 | /// 8 | public class UserUpdatePhoneAo 9 | { 10 | /// 11 | /// 手机号 12 | /// 13 | public string Phone { get; set; } 14 | 15 | /// 16 | /// 验证码 17 | /// 18 | public string Code { get; set; } 19 | 20 | /// 21 | /// 区号 22 | /// 23 | public string CountryCode { get; set; } 24 | 25 | /// 26 | /// 用户ID 27 | /// 28 | public string UserId { get; set; } 29 | 30 | /// 31 | /// 企业ID 32 | /// 33 | public string CompanyId { get; set; } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Application.Customer/Ao/UserUpdatePwdAo.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Application.Customer.Ao 4 | { 5 | /// 6 | /// 修改密码 7 | /// 8 | public class UserUpdatePwdAo 9 | { 10 | /// 11 | /// 用户ID 12 | /// 13 | public string UserId { get; set; } 14 | 15 | /// 16 | /// 登录密码(旧) 17 | /// 18 | public string OldPassword { get; set; } 19 | 20 | /// 21 | /// 新登录密码 22 | /// 23 | public string NewPassword { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Application.Customer/Ao/VaildSmsAo.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Application.Customer.Ao 4 | { 5 | /// 6 | /// 登录请求 7 | /// 8 | public class VaildSmsAo 9 | { 10 | /// 11 | /// 手机号码 12 | /// 13 | public string Phone { get; set; } 14 | 15 | /// 16 | /// 验证码 17 | /// 18 | public string Code { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Common.Utils/5.Sikiro.Common.Utils.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | Sikiro.Common.Utils 6 | Sikiro.Common.Utils 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Common.Utils/AdministratorData.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Common.Utils 2 | { 3 | /// 4 | /// 登陆用户 5 | /// 6 | public class AdministratorData 7 | { 8 | public string UserId { get; set; } 9 | 10 | /// 11 | /// 公司ID 12 | /// 13 | public string CompanyId { get; set; } 14 | 15 | /// 16 | /// 工号 17 | /// 18 | public string UserNo { get; set; } 19 | 20 | /// 21 | /// 用户名 22 | /// 23 | public string UserName { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Common.Utils/HttpContextExtension.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Security.Claims; 3 | using Microsoft.AspNetCore.Http; 4 | using Sikiro.Tookits.Extension; 5 | 6 | namespace Sikiro.Common.Utils 7 | { 8 | public static class HttpContextExtension 9 | { 10 | public static AdministratorData GetCurrentUser(this HttpContext context) 11 | { 12 | return context.User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.UserData)?.Value.FromJson(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Common.Utils/MoneyExtension.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Common.Utils 2 | { 3 | public static class MoneyExtension 4 | { 5 | #region 分转元 6 | 7 | /// 8 | /// 分转元 9 | /// 10 | /// 金额,单位分 11 | /// 12 | public static decimal PointsToYuan(this int points) 13 | { 14 | return points / 100.00M; 15 | } 16 | 17 | #endregion 18 | 19 | #region 元转分 20 | 21 | /// 22 | /// 元转分 23 | /// 24 | /// 金额,单位元 25 | /// 26 | public static int YuanToPoints(this decimal yuan) 27 | { 28 | return (int)(yuan * 100); 29 | } 30 | #endregion 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Entity.Customer/4.Sikiro.Entity.Customer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | Sikiro.Entity.Customer 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Entity.Customer/DBContext/PersonPlatformContext.cs: -------------------------------------------------------------------------------- 1 | using Chloe.Infrastructure; 2 | using Chloe.MySql; 3 | 4 | namespace Sikiro.Entity.Customer.DBContext 5 | { 6 | public class PersonPlatformContext : MySqlContext 7 | { 8 | public PersonPlatformContext(IDbConnectionFactory dbConnectionFactory) : base(dbConnectionFactory) 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Entity.Customer/__entity.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 7 | 8 | 42 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.InnerApi.Customer/Controllers/BaseController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace Sikiro.InnerApi.Customer.Controllers 4 | { 5 | [Route("[controller]/[action]")] 6 | [ApiController] 7 | public class BaseController : ControllerBase 8 | { 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.InnerApi.Customer/Extention/ModelStateExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | using Microsoft.AspNetCore.Mvc.ModelBinding; 3 | 4 | namespace Sikiro.InnerApi.Customer.Extention 5 | { 6 | public static class ModelStateExtensions 7 | { 8 | /// 9 | /// 获取模型验证错误信息 10 | /// 11 | /// 12 | /// 13 | public static string GetModelStateMsg(this ModelStateDictionary modelState) 14 | { 15 | var builder = new StringBuilder(); 16 | 17 | foreach (var key in modelState.Keys) 18 | { 19 | var errors = modelState[key].Errors; 20 | 21 | foreach (var error in errors) 22 | { 23 | if (builder.Length > 0) 24 | builder.Append("
"); 25 | 26 | builder.Append(error.ErrorMessage); 27 | } 28 | } 29 | 30 | return builder.ToString(); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.InnerApi.Customer/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace Sikiro.InnerApi.Customer 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateWebHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 14 | WebHost.CreateDefaultBuilder(args) 15 | .UseStartup(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.InnerApi.Customer/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:8066", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development", 16 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "SkyAPM.Agent.AspNetCore" 17 | } 18 | }, 19 | "GS.InnerApi.Customer": { 20 | "commandName": "Project", 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development", 23 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "SkyAPM.Agent.AspNetCore" 24 | }, 25 | "applicationUrl": "http://localhost:8066" 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.InnerApi.Customer/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft": "Information" 6 | } 7 | }, 8 | "MongoDbUrl": "", 9 | "AllowedHosts": "*", 10 | "PersonpPlatformDB": "", 11 | "Consul": { 12 | "ServiceName": "Customer", 13 | "ConsulHost": "http://47.106.228.67:5037", 14 | "SelfPort": 80 15 | }, 16 | "RabbitMqHost": "" 17 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.InnerApi.Customer/appsettings.Production.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft": "Information" 6 | } 7 | }, 8 | "MongoDbUrl": "", 9 | "AllowedHosts": "*", 10 | "PersonpPlatformDB": "", 11 | "Consul": { 12 | "ServiceName": "Customer", 13 | "ConsulHost": "http://47.106.228.67:5037", 14 | "SelfPort": 80 15 | }, 16 | "RabbitMqHost": "" 17 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.InnerApi.Customer/appsettings.Tes.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft": "Information" 6 | } 7 | }, 8 | "MongoDbUrl": "", 9 | "AllowedHosts": "*", 10 | "PersonpPlatformDB": "", 11 | "Consul": { 12 | "ServiceName": "Customer", 13 | "ConsulHost": "http://47.106.228.67:5037", 14 | "SelfPort": 80 15 | }, 16 | "RabbitMqHost": "" 17 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.InnerApi.Customer/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft": "Information" 6 | } 7 | }, 8 | "MongoDbUrl": "", 9 | "AllowedHosts": "*", 10 | "PersonpPlatformDB": "", 11 | "Consul": { 12 | "ServiceName": "Customer", 13 | "ConsulHost": "http://47.106.228.67:5037", 14 | "SelfPort": 80 15 | }, 16 | "RabbitMqHost": "" 17 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.InnerApi.Customer/skyapm.json: -------------------------------------------------------------------------------- 1 | { 2 | "SkyWalking": { 3 | "ServiceName": "GS.InnerApi.Customer", 4 | "Namespace": "", 5 | "HeaderVersions": [ 6 | "sw6" 7 | ], 8 | "Sampling": { 9 | "SamplePer3Secs": -1, 10 | "Percentage": -1.0 11 | }, 12 | "Logging": { 13 | "Level": "Information", 14 | "FilePath": "logs/skyapm-{Date}.log" 15 | }, 16 | "Transport": { 17 | "Interval": 3000, 18 | "ProtocolVersion": "v6", 19 | "QueueSize": 30000, 20 | "BatchSize": 3000, 21 | "gRPC": { 22 | "Servers": "im.gshichina.com:5046", 23 | "Timeout": 10000, 24 | "ConnectTimeout": 10000, 25 | "ReportTimeout": 600000 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/0.Sikiro.Interface.Customer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | 1.2.3.1 6 | 陈珙 7 | 葛氏 8 | 个人平台内部API 9 | Sikiro.Interface.Customer 10 | Sikiro.Interface.Customer 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/ICustomer.cs: -------------------------------------------------------------------------------- 1 | using WebApiClient; 2 | 3 | namespace Sikiro.Interface.Customer 4 | { 5 | /// 6 | /// 个人平台接口 7 | /// 8 | public interface ICustomer : IHttpApi 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/BindingWxRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class BindingWxRequest 6 | { 7 | [Required(ErrorMessage = "请输入用户ID")] 8 | public string UserId { get; set; } 9 | 10 | [Required(ErrorMessage = "openid不能为空")] 11 | public string OpenId { get; set; } 12 | 13 | [Required(ErrorMessage = "微信昵称不能为空")] 14 | public string WxName { get; set; } 15 | 16 | /// 17 | /// 企业ID 18 | /// 19 | [Required(ErrorMessage = "企业ID必传")] 20 | public string CompanyId { get; set; } 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/ChangePayPwdUserRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | /// 6 | /// 7 | /// 8 | public class ChangePayPwdUserRequest 9 | { 10 | [Required(ErrorMessage = "请输入用户ID")] 11 | public string UserId { get; set; } 12 | 13 | [Required(ErrorMessage = "请输入登录密码")] 14 | public string OldPassword { get; set; } 15 | 16 | [Required(ErrorMessage = "请输入新登录密码")] 17 | public string NewPassword { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/CheckingPayPasswordRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | /// 6 | /// 7 | /// 8 | public class CheckingPayPasswordRequest 9 | { 10 | [Required(ErrorMessage = "请输入用户ID")] 11 | public string UserId { get; set; } 12 | 13 | [Required(ErrorMessage = "请输入支付密码")] 14 | public string PayPassword { get; set; } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/FinancialBalancePayRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class FinancialBalancePayRequest 6 | { 7 | [Required(ErrorMessage = "订单ID为必传")] 8 | public string WharehouseOrderId { get; set; } 9 | 10 | 11 | public decimal Money { get; set; } 12 | 13 | public string UserId { get; set; } 14 | 15 | public string CompanyId { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/FinancialRechargeRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class FinancialRechargeRequest 6 | { 7 | [Required(ErrorMessage = "企业id不能为空")] 8 | [StringLength(32, ErrorMessage = "企业id不能超过32字符")] 9 | public string CompanyId { get; set; } 10 | 11 | [Required(ErrorMessage = "用户id不能为空")] 12 | [StringLength(32, ErrorMessage = "用户id不能超过32字符")] 13 | public string UserNo { get; set; } 14 | 15 | [Required(ErrorMessage = "充值金额必须大于0")] 16 | public decimal Money { get; set; } 17 | 18 | public string Remark { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/GetPhoneUserRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Interface.Customer.User 2 | { 3 | /// 4 | /// 5 | /// 6 | public class GetPhoneUserRequest 7 | { 8 | /// 9 | /// 登录名(用户名或者手机号) 10 | /// 11 | public string UserName { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/GetPhoneUserResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Interface.Customer.User 2 | { 3 | /// 4 | /// 5 | /// 6 | public class GetPhoneUserResponse 7 | { 8 | public string Phone { get; set; } 9 | 10 | public string CountryCode { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/GetUserRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | /// 6 | /// 根据企业ID,获取数据 7 | /// 8 | public class GetUserRequest 9 | { 10 | [Required(ErrorMessage = "企业id不能为空")] 11 | [StringLength(32, ErrorMessage = "企业id不能超过32字符")] 12 | public string CompanyId { get; set; } 13 | 14 | [Required(ErrorMessage = "用户id不能为空")] 15 | [StringLength(32, ErrorMessage = "用户id不能超过32字符")] 16 | public string UserNo { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/LogonCheckRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class LogonCheckRequest 6 | { 7 | [Required] 8 | public string UserName { get; set; } 9 | 10 | [Required] 11 | public string Password { get; set; } 12 | 13 | [Required] 14 | public string CompanyId { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/LogonCheckResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Interface.Customer.User 2 | { 3 | public class LogonCheckResponse 4 | { 5 | public string UserId { get; set; } 6 | 7 | /// 8 | /// 公司ID 9 | /// 10 | public string CompanyId { get; set; } 11 | 12 | /// 13 | /// 工号 14 | /// 15 | public string UserNo { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/RandomPasswordResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Interface.Customer.User 2 | { 3 | public class RandomPasswordResponse 4 | { 5 | public string Password { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/RegisterUserRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | /// 6 | /// 7 | /// 8 | public class RegisterUserRequest 9 | { 10 | [Required(ErrorMessage = "请输入用户名")] 11 | public string UserName { get; set; } 12 | 13 | [Required(ErrorMessage = "请输入密码")] 14 | public string Password { get; set; } 15 | 16 | public string CompanyId { get; set; } 17 | 18 | [Required(ErrorMessage = "请输入手机号")] 19 | public string Phone { get; set; } 20 | 21 | /// 22 | /// 区号 23 | /// 24 | [Required(ErrorMessage = "区号")] 25 | public string CountryCode { get; set; } 26 | 27 | public string UserNo { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/ResetUserPasswordRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class ResetUserPasswordRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/ResetUserPasswordResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Interface.Customer.User 2 | { 3 | public class ResetUserPasswordResponse 4 | { 5 | public string Password { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/SearchUserRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class SearchUserRequest 6 | { 7 | public string UserNo { get; set; } 8 | 9 | public string UserName { get; set; } 10 | 11 | public string Phone { get; set; } 12 | 13 | public DateTime? DateTimeFrom { get; set; } 14 | 15 | public DateTime? DateTimeTo { get; set; } 16 | 17 | public int Status { get; set; } 18 | 19 | public string CompanyId { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/SetPayPwdUserRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | /// 6 | /// 7 | /// 8 | public class SetPayPwdUserRequest 9 | { 10 | [Required(ErrorMessage = "请输入用户ID")] 11 | public string UserId { get; set; } 12 | 13 | [Required(ErrorMessage = "请输入新支付密码")] 14 | public string PayPassword { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/UpdateArea.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Interface.Customer.User 2 | { 3 | public class UpdateArea 4 | { 5 | public string CountryId { get; set; } 6 | 7 | public string CountryName { get; set; } 8 | 9 | public string CityId { get; set; } 10 | 11 | public string CityName { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/UpdateAreaRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class UpdateAreaRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | public UpdateArea AreaRequest {get; set; } 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/UpdateBusinessManagerRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class UpdateBusinessManagerRequest 6 | { 7 | [Required] 8 | public string UserId { get; set; } 9 | 10 | public string BusinessManager { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/UpdateEmailRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class UpdateEmailRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public string Email { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/UpdateMemberGradesRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class UpdateMemberGradesRequest 6 | { 7 | [Required] 8 | public string UserId { get; set; } 9 | 10 | [Required] 11 | public string MemberGradesId { get; set; } 12 | 13 | [Required] 14 | public string MemberGradesName { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/UpdateNickNameRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class UpdateNickNameRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public string NickName { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/UpdatePhoneUserRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | /// 6 | /// 7 | /// 8 | public class UpdatePhoneUserRequest 9 | { 10 | 11 | [Required(ErrorMessage = "请输入用户ID")] 12 | public string UserId { get; set; } 13 | 14 | [Required(ErrorMessage = "请输入手机号码")] 15 | public string Phone { get; set; } 16 | 17 | /// 18 | /// 区号 19 | /// 20 | [Required(ErrorMessage = "区号")] 21 | public string CountryCode { get; set; } 22 | 23 | [Required(ErrorMessage = "请输入企业Id")] 24 | public string CompanyId { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/UpdatePwdUserRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | /// 6 | /// 7 | /// 8 | public class UpdatePwdUserRequest 9 | { 10 | [Required(ErrorMessage = "请输入用户ID")] 11 | public string UserId { get; set; } 12 | 13 | [Required(ErrorMessage = "请输入登录密码")] 14 | public string OldPassword { get; set; } 15 | 16 | [Required(ErrorMessage = "请输入新登录密码")] 17 | public string NewPassword { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/UpdateRealNameRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class UpdateRealNameRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public string RealName { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/UpdateRetrievePwdUserRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | /// 6 | /// 7 | /// 8 | public class UpdateRetrievePwdUserRequest 9 | { 10 | [Required(ErrorMessage = "请输入手机号")] 11 | public string Phone { get; set; } 12 | 13 | [Required(ErrorMessage = "请输入新登录密码")] 14 | public string NewPassword { get; set; } 15 | 16 | /// 17 | /// 企业Id 18 | /// 19 | [Required(ErrorMessage = "请输入新登录密码")] 20 | public string CompanyId { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/UpdateUserLableRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class UpdateUserLableRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | public string UserLable { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/UpdateUserLogoRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class UpdateUserLogoRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public string ImgUrl { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/UpdateUserNameRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class UpdateUserNameRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public string UserName { get; set; } 12 | 13 | [Required] 14 | public string CompanyId { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/UpdateUserStatusRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class UpdateUserStatusRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public int Status { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Interface.Customer/User/WxLogonCheckRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class WxLogonCheckRequest 6 | { 7 | [Required(ErrorMessage = "openid不能为空")] 8 | public string OpenId { get; set; } 9 | 10 | /// 11 | /// 企业ID 12 | /// 13 | [Required(ErrorMessage = "企业ID必传")] 14 | public string CompanyId { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Service.Customer/3.Sikiro.Service.Customer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | Sikiro.Service.Customer 6 | Sikiro.Service.Customer 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Service.Customer/BaseService.cs: -------------------------------------------------------------------------------- 1 | using Sikiro.Entity.Customer.DBContext; 2 | using Sikiro.Tookits.Interfaces; 3 | 4 | namespace Sikiro.Service.Customer 5 | { 6 | /// 7 | /// 基础服务类 8 | /// 9 | public class BaseService : IDepend 10 | { 11 | protected readonly PersonPlatformContext Db; 12 | 13 | public BaseService(PersonPlatformContext db) 14 | { 15 | Db = db; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.Service.Customer/Enums/PersonEnum.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Service.Customer.Enums 4 | { 5 | public class PersonEnum 6 | { 7 | public enum EStatus 8 | { 9 | /// 10 | /// 已取消 11 | /// 12 | [Display(Name = "已取消")] 13 | Stop = 0, 14 | /// 15 | /// 已创建 16 | /// 17 | [Display(Name = "已创建")] 18 | Open = 1, 19 | /// 20 | /// 已完成 21 | /// 22 | [Display(Name = "已完成")] 23 | Complete = 2, 24 | } 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Attribute/ChineseAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using Sikiro.Common.Utils; 3 | 4 | namespace Sikiro.WebApi.Customer.Attribute 5 | { 6 | /// 7 | /// 中文 8 | /// 9 | public class ChineseAttribute : RegularExpressionAttribute 10 | { 11 | private const string RegexPattern = RegularExpression.Chinese; 12 | public ChineseAttribute() 13 | : base(RegexPattern) 14 | { 15 | ErrorMessage = "请输入中文"; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Attribute/EmailAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Attribute 4 | { 5 | /// 6 | /// 邮箱验证特性 7 | /// 8 | public class EmailAttribute : RegularExpressionAttribute 9 | { 10 | private const string RegexPattern = @"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"; 11 | public EmailAttribute(): base(RegexPattern) 12 | { 13 | ErrorMessage = "邮箱格式不正确"; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Attribute/GolbalExceptionAttribute.cs: -------------------------------------------------------------------------------- 1 | using Sikiro.Tookits.Base; 2 | using Sikiro.Tookits.Extension; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Microsoft.AspNetCore.Mvc.Filters; 5 | 6 | namespace Sikiro.WebApi.Customer.Attribute 7 | { 8 | /// 9 | /// 全局异常捕获 10 | /// 11 | public class GolbalExceptionAttribute : ExceptionFilterAttribute 12 | { 13 | public override void OnException(ExceptionContext context) 14 | { 15 | if (!context.ExceptionHandled) 16 | { 17 | var exception = context.Exception.GetDeepestException(); 18 | exception.WriteToFile("全局异常捕抓"); 19 | 20 | context.ExceptionHandled = true; 21 | context.Result = new ObjectResult(ApiResult.IsError("服务器正在开小差~请稍后重试~")); 22 | context.HttpContext.Response.StatusCode = 500; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Attribute/IdCardAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using Sikiro.Common.Utils; 3 | 4 | namespace Sikiro.WebApi.Customer.Attribute 5 | { 6 | /// 7 | /// 邮箱验证特性 8 | /// 9 | public class IdCardAttribute : RegularExpressionAttribute 10 | { 11 | private const string RegexPattern = RegularExpression.IdNum; 12 | public IdCardAttribute(): base(RegexPattern) 13 | { 14 | ErrorMessage = "身份证格式不正确"; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Attribute/MobileAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Attribute 4 | { 5 | /// 6 | /// 手机号码 7 | /// 8 | public class MobileAttribute : RegularExpressionAttribute 9 | { 10 | private const string RegexPattern = @"^1[0-9]{10}$"; 11 | public MobileAttribute() : base(RegexPattern) 12 | { 13 | ErrorMessage = "手机号码不正确"; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Attribute/PasswordAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Attribute 4 | { 5 | /// 6 | /// 密码验证特性 7 | /// 8 | public class PasswordAttribute : RegularExpressionAttribute 9 | { 10 | private const string RegexPattern = @"^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{6,18}$"; 11 | public PasswordAttribute(bool isFlag, string msg) : base(RegexPattern) 12 | { 13 | if (isFlag) 14 | { 15 | ErrorMessage = msg; 16 | } 17 | else 18 | { 19 | ErrorMessage = "请输入6-18位字母与数字组合的密码"; 20 | } 21 | 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Attribute/TableColsAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Attribute 4 | { 5 | public class TableColsAttribute : System.Attribute 6 | { 7 | public TableColsAttribute() 8 | { 9 | Align = EAlign.Left; 10 | } 11 | public string Field { get; set; } 12 | 13 | public string Tile { get; set; } 14 | 15 | public int Width { get; set; } 16 | 17 | public EAlign Align { get; set; } 18 | 19 | private bool _isImage = false; 20 | public bool IsImage { get => _isImage; set => _isImage = value; } 21 | } 22 | 23 | public enum EAlign 24 | { 25 | [Display(Name = "center")] 26 | Center = 0, 27 | [Display(Name = "right")] 28 | Right = 1, 29 | [Display(Name = "left")] 30 | Left = 2, 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Controllers/BaseController.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Security.Claims; 3 | using Microsoft.AspNetCore.Authorization; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Sikiro.Common.Utils; 6 | using Sikiro.Tookits.Extension; 7 | 8 | namespace Sikiro.WebApi.Customer.Controllers 9 | { 10 | [Authorize] 11 | [Route("api/[controller]")] 12 | [ApiController] 13 | public class BaseController : ControllerBase 14 | { 15 | /// 16 | /// 获取登录用户信息 17 | /// 18 | protected AdministratorData CurrentUserData => GetCurrentUser(); 19 | 20 | private AdministratorData GetCurrentUser() 21 | { 22 | return HttpContext.User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.UserData)?.Value.FromJson(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Extention/ConstString.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.WebApi.Customer.Extention 2 | { 3 | public static class ConstString 4 | { 5 | public const string AuthKey = "9D2ACA0C-480A-4628-BEAE-93DB4DE1F3A2"; 6 | 7 | public const string JwtCompanyId = "CompnayId"; 8 | 9 | public const string JwtUserType = "UserType"; 10 | 11 | public const string KeyName = "key"; 12 | 13 | public const string KeyValue = "28RVSrSl7pDZTZqFH4Yd3TlMmZmzMrRC"; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Extention/ModelStateExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | using Microsoft.AspNetCore.Mvc.ModelBinding; 3 | 4 | namespace Sikiro.WebApi.Customer.Extention 5 | { 6 | public static class ModelStateExtensions 7 | { 8 | /// 9 | /// 获取模型验证错误信息 10 | /// 11 | /// 12 | /// 13 | public static string GetModelStateMsg(this ModelStateDictionary modelState) 14 | { 15 | var builder = new StringBuilder(); 16 | 17 | foreach (var key in modelState.Keys) 18 | { 19 | var errors = modelState[key].Errors; 20 | 21 | foreach (var error in errors) 22 | { 23 | if (builder.Length > 0) 24 | builder.Append("
"); 25 | 26 | builder.Append(error.ErrorMessage); 27 | } 28 | } 29 | 30 | return builder.ToString(); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Models/User/Request/EmailRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | public class EmailRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public string Email { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Models/User/Request/NickNameRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | public class NickNameRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public string NickName { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Models/User/Request/RealNameRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | public class RealNameRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public string RealName { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Models/User/Request/SendSmsRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | /// 6 | /// 登录请求 7 | /// 8 | public class SendSmsRequest 9 | { 10 | /// 11 | /// 手机号码 12 | /// 13 | [Required(ErrorMessage = "请输入手机号")] 14 | public string Phone { get; set; } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Models/User/Request/UserBindingWxRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | /// 6 | /// 用户信息 7 | /// 8 | public class UserBindingWxRequest 9 | { 10 | /// 11 | /// 微信授权CODE 12 | /// 13 | [Required(ErrorMessage = "微信授权CODE必传")] 14 | public string WxCode { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Models/User/Request/UserChangePayPwdRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | /// 6 | /// 修改密码 7 | /// 8 | public class UserChangePayPwdRequest 9 | { 10 | /// 11 | /// 旧密码 12 | /// 13 | [Required(ErrorMessage = "请输入登录密码")] 14 | public string OldPassword { get; set; } 15 | /// 16 | /// 新密码 17 | /// 18 | [Required(ErrorMessage = "请输入新登录密码")] 19 | public string NewPassword { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Models/User/Request/UserCheckingPayPasswordRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | /// 6 | /// 修改密码 7 | /// 8 | public class UserCheckingPayPasswordRequest 9 | { 10 | /// 11 | /// 新密码 12 | /// 13 | [Required(ErrorMessage = "请输入支付密码")] 14 | public string PayPassword { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Models/User/Request/UserLogoRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | public class UserLogoRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public string ImgUrl { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Models/User/Request/UserLogonRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | /// 6 | /// 登录请求 7 | /// 8 | public class UserLogonRequest 9 | { 10 | /// 11 | /// 用户账户 12 | /// 13 | [Required(ErrorMessage = "请输入登录账号")] 14 | public string UserName { get; set; } 15 | /// 16 | /// 用户密码 17 | /// 18 | [Required(ErrorMessage = "请输入登录密码")] 19 | public string Password { get; set; } 20 | 21 | /// 22 | /// 企业Id 23 | /// 24 | [Required(ErrorMessage = "公司Id不能为空")] 25 | public string CompanyId { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Models/User/Request/UserNameRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | public class UserNameRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public string UserName { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Models/User/Request/UserSetPayPwdRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | /// 6 | /// 用户信息 7 | /// 8 | public class UserSetPayPwdRequest 9 | { 10 | /// 11 | /// 支付密码 12 | /// 13 | [Required(ErrorMessage = "请输入支付密码")] 14 | public string PayPassword { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Models/User/Request/UserUpdatePhoneRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | /// 6 | /// 用户信息 7 | /// 8 | public class UserUpdatePhoneRequest 9 | { 10 | /// 11 | /// 手机号 12 | /// 13 | [Required(ErrorMessage = "请输入手机号码")] 14 | public string Phone { get; set; } 15 | 16 | /// 17 | /// 验证码 18 | /// 19 | [Required(ErrorMessage = "请输入验证码")] 20 | public string Code { get; set; } 21 | 22 | /// 23 | /// 区号 24 | /// 25 | [Required(ErrorMessage = "区号")] 26 | public string CountryCode { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Models/User/Request/UserUpdatePwdRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | /// 6 | /// 修改密码 7 | /// 8 | public class UserUpdatePwdRequest 9 | { 10 | /// 11 | /// 用户ID 12 | /// 13 | [Required(ErrorMessage = "请输入用户ID")] 14 | public string UserId { get; set; } 15 | 16 | /// 17 | /// 登录密码(旧) 18 | /// 19 | [Required(ErrorMessage = "请输入登录密码")] 20 | public string OldPassword { get; set; } 21 | 22 | /// 23 | /// 新登录密码 24 | /// 25 | [Required(ErrorMessage = "请输入新登录密码")] 26 | public string NewPassword { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Models/User/Request/UserWxLogonCheckRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | /// 6 | /// 用户信息 7 | /// 8 | public class UserWxLogonCheckRequest 9 | { 10 | /// 11 | /// 微信授权CODE 12 | /// 13 | [Required(ErrorMessage = "微信授权CODE必传")] 14 | public string WxCode { get; set; } 15 | 16 | /// 17 | /// 企业ID 18 | /// 19 | [Required(ErrorMessage = "企业ID必传")] 20 | public string CompanyId { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Models/User/Request/VaildSmsRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | /// 6 | /// 登录请求 7 | /// 8 | public class VaildSmsRequest 9 | { 10 | /// 11 | /// 手机号码 12 | /// 13 | [Required(ErrorMessage = "请输入手机号")] 14 | public string Phone { get; set; } 15 | 16 | /// 17 | /// 验证码 18 | /// 19 | [Required(ErrorMessage = "请输入验证码")] 20 | public string Code { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Models/User/Response/UserGetPhoneResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.WebApi.Customer.Models.User.Response 2 | { 3 | /// 4 | /// 用户信息 5 | /// 6 | public class UserGetPhoneResponse 7 | { 8 | /// 9 | /// 用户登陆名称/手机 10 | /// 11 | public string UserName { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Models/User/Response/UserLogonResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.WebApi.Customer.Models.User.Response 2 | { 3 | /// 4 | /// 登录响应 5 | /// 6 | public class UserLogonResponse 7 | { 8 | /// 9 | /// 用户id 10 | /// 11 | public string UserId { get; set; } 12 | 13 | /// 14 | /// 授权码 15 | /// 16 | public string AccessToken { get; set; } 17 | 18 | /// 19 | /// 用户WXid 20 | /// 21 | public string OpenId { get; set; } 22 | 23 | /// 24 | /// 公司ID 25 | /// 26 | public string CompanyId { get; set; } 27 | 28 | /// 29 | /// 登录令牌 30 | /// 31 | public string Token { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace Sikiro.WebApi.Customer 5 | { 6 | 7 | /// 8 | /// 9 | /// 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | CreateWebHostBuilder(args).Build().Run(); 15 | } 16 | 17 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 18 | WebHost.CreateDefaultBuilder(args) 19 | .UseStartup(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Properties/PublishProfiles/FolderProfile.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | FileSystem 9 | FileSystem 10 | Release 11 | Any CPU 12 | 13 | True 14 | False 15 | c7c94dad-53ee-457a-b8d1-b303985471a9 16 | bin\Debug\netcoreapp2.2\publish\ 17 | False 18 | 19 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:8011", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development", 16 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "SkyAPM.Agent.AspNetCore" 17 | } 18 | }, 19 | "GS.WebApi.Customer": { 20 | "commandName": "Project", 21 | "launchBrowser": true, 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development", 24 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "SkyAPM.Agent.AspNetCore" 25 | }, 26 | "applicationUrl": "http://localhost:8011" 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | }, 9 | "wechat": { 10 | "appid": "", 11 | "appSecret": "", 12 | "MchId": "", 13 | "Key": "", 14 | "NotifyUrl": "" 15 | }, 16 | "IdServerUrl": "http://172.17.0.1:8008/IDGenerate/", 17 | "CustomerInnerApiUrl": "http://localhost:8066/", 18 | "WarehouseInnerApiUrl": "http://172.17.0.1:8008/Warehouse/", 19 | "MsgInnerApiUrl": "http://172.17.0.1:8008/Msg/", 20 | "CmsInnerApiUrl": "http://172.17.0.1:8008/Cms/", 21 | "CapitalInnerApiUrl": "http://172.17.0.1:8008/Capital/", 22 | "RedisUrl": "", 23 | "BusinessPlatformDB": "" 24 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/appsettings.Production.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | }, 9 | "wechat": { 10 | "appid": "", 11 | "appSecret": "", 12 | "MchId": "", 13 | "Key": "", 14 | "NotifyUrl": "" 15 | }, 16 | "IdServerUrl": "http://172.17.0.1:8008/IDGenerate/", 17 | "CustomerInnerApiUrl": "http://172.17.0.1:8008/Customer/", 18 | "WarehouseInnerApiUrl": "http://172.17.0.1:8008/Warehouse/", 19 | "MsgInnerApiUrl": "http://172.17.0.1:8008/Msg/", 20 | "CmsInnerApiUrl": "http://172.17.0.1:8008/Cms/", 21 | "CapitalInnerApiUrl": "http://172.17.0.1:8008/Capital/", 22 | "RedisUrl": "", 23 | "BusinessPlatformDB": "" 24 | } 25 | -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/appsettings.Test.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | }, 9 | "wechat": { 10 | "appid": "", 11 | "appSecret": "", 12 | "MchId": "", 13 | "Key": "", 14 | "NotifyUrl": "" 15 | }, 16 | "IdServerUrl": "http://172.17.0.1:8008/IDGenerate/", 17 | "CustomerInnerApiUrl": "http://172.17.0.1:8008/Customer/", 18 | "WarehouseInnerApiUrl": "http://172.17.0.1:8008/Warehouse/", 19 | "MsgInnerApiUrl": "http://172.17.0.1:8008/Msg/", 20 | "CmsInnerApiUrl": "http://172.17.0.1:8008/Cms/", 21 | "CapitalInnerApiUrl": "http://172.17.0.1:8008/Capital/", 22 | "RedisUrl": "", 23 | "BusinessPlatformDB": "" 24 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | }, 9 | "wechat": { 10 | "appid": "", 11 | "appSecret": "", 12 | "MchId": "", 13 | "Key": "", 14 | "NotifyUrl": "" 15 | }, 16 | "IdServerUrl": "http://172.17.0.1:8008/IDGenerate/", 17 | "CustomerInnerApiUrl": "http://localhost:8066/", 18 | "WarehouseInnerApiUrl": "http://172.17.0.1:8008/Warehouse/", 19 | "MsgInnerApiUrl": "http://172.17.0.1:8008/Msg/", 20 | "CmsInnerApiUrl": "http://172.17.0.1:8008/Cms/", 21 | "CapitalInnerApiUrl": "http://172.17.0.1:8008/Capital/", 22 | "RedisUrl": "", 23 | "BusinessPlatformDB": "" 24 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案-新分层/Sikiro.WebApi.Customer/skyapm.json: -------------------------------------------------------------------------------- 1 | { 2 | "SkyWalking": { 3 | "ServiceName": "GS.WebApi.Customer", 4 | "Namespace": "", 5 | "HeaderVersions": [ 6 | "sw6" 7 | ], 8 | "Sampling": { 9 | "SamplePer3Secs": -1, 10 | "Percentage": -1.0 11 | }, 12 | "Logging": { 13 | "Level": "Information", 14 | "FilePath": "logs\\skyapm-{Date}.log" 15 | }, 16 | "Transport": { 17 | "Interval": 3000, 18 | "ProtocolVersion": "v6", 19 | "QueueSize": 30000, 20 | "BatchSize": 3000, 21 | "gRPC": { 22 | "Servers": "im.gshichina.com:5046", 23 | "Timeout": 10000, 24 | "ConnectTimeout": 10000, 25 | "ReportTimeout": 600000 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案/GS.Common.Utils/4.Sikiro.Common.Utils.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | Sikiro.Common.Utils 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/GS.Common.Utils/AdministratorData.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Common.Utils 2 | { 3 | /// 4 | /// 登陆用户 5 | /// 6 | public class AdministratorData 7 | { 8 | public string UserId { get; set; } 9 | 10 | /// 11 | /// 公司ID 12 | /// 13 | public string CompanyId { get; set; } 14 | 15 | /// 16 | /// 工号 17 | /// 18 | public string UserNo { get; set; } 19 | 20 | /// 21 | /// 用户名 22 | /// 23 | public string UserName { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/GS.Common.Utils/HttpContextExtension.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Security.Claims; 3 | using Microsoft.AspNetCore.Http; 4 | using Sikiro.Tookits.Extension; 5 | 6 | namespace Sikiro.Common.Utils 7 | { 8 | public static class HttpContextExtension 9 | { 10 | public static AdministratorData GetCurrentUser(this HttpContext context) 11 | { 12 | return context.User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.UserData)?.Value.FromJson(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/GS.Common.Utils/MoneyExtension.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Common.Utils 2 | { 3 | public static class MoneyExtension 4 | { 5 | #region 分转元 6 | 7 | /// 8 | /// 分转元 9 | /// 10 | /// 金额,单位分 11 | /// 12 | public static decimal PointsToYuan(this int points) 13 | { 14 | return points / 100.00M; 15 | } 16 | 17 | #endregion 18 | 19 | #region 元转分 20 | 21 | /// 22 | /// 元转分 23 | /// 24 | /// 金额,单位元 25 | /// 26 | public static int YuanToPoints(this decimal yuan) 27 | { 28 | return (int)(yuan * 100); 29 | } 30 | #endregion 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Entity.Customer/3.Sikiro.Entity.Customer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | Sikiro.Entity.Customer 6 | Sikiro.Entity.Customer 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Entity.Customer/DBContext/PersonPlatformContext.cs: -------------------------------------------------------------------------------- 1 | using Chloe.Infrastructure; 2 | using Chloe.MySql; 3 | 4 | namespace Sikiro.Entity.Customer.DBContext 5 | { 6 | public class PersonPlatformContext : MySqlContext 7 | { 8 | public PersonPlatformContext(IDbConnectionFactory dbConnectionFactory) : base(dbConnectionFactory) 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Entity.Customer/__entity.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 7 | 8 | 42 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.InnerApi.Customer/Controllers/BaseController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace Sikiro.InnerApi.Customer.Controllers 4 | { 5 | [Route("[controller]/[action]")] 6 | [ApiController] 7 | public class BaseController : ControllerBase 8 | { 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.InnerApi.Customer/Extention/ModelStateExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | using Microsoft.AspNetCore.Mvc.ModelBinding; 3 | 4 | namespace Sikiro.InnerApi.Customer.Extention 5 | { 6 | public static class ModelStateExtensions 7 | { 8 | /// 9 | /// 获取模型验证错误信息 10 | /// 11 | /// 12 | /// 13 | public static string GetModelStateMsg(this ModelStateDictionary modelState) 14 | { 15 | var builder = new StringBuilder(); 16 | 17 | foreach (var key in modelState.Keys) 18 | { 19 | var errors = modelState[key].Errors; 20 | 21 | foreach (var error in errors) 22 | { 23 | if (builder.Length > 0) 24 | builder.Append("
"); 25 | 26 | builder.Append(error.ErrorMessage); 27 | } 28 | } 29 | 30 | return builder.ToString(); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.InnerApi.Customer/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace Sikiro.InnerApi.Customer 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateWebHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 14 | WebHost.CreateDefaultBuilder(args) 15 | .UseStartup(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.InnerApi.Customer/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:8066", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development", 16 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "SkyAPM.Agent.AspNetCore" 17 | } 18 | }, 19 | "GS.InnerApi.Customer": { 20 | "commandName": "Project", 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development", 23 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "SkyAPM.Agent.AspNetCore" 24 | }, 25 | "applicationUrl": "http://localhost:8066" 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.InnerApi.Customer/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft": "Information" 6 | } 7 | }, 8 | "MongoDbUrl": "", 9 | "AllowedHosts": "*", 10 | "PersonpPlatformDB": "", 11 | "Consul": { 12 | "ServiceName": "Customer", 13 | "ConsulHost": "http://47.106.228.67:5037", 14 | "SelfPort": 80 15 | }, 16 | "RabbitMqHost": "" 17 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.InnerApi.Customer/appsettings.Production.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft": "Information" 6 | } 7 | }, 8 | "MongoDbUrl": "", 9 | "AllowedHosts": "*", 10 | "PersonpPlatformDB": "", 11 | "Consul": { 12 | "ServiceName": "Customer", 13 | "ConsulHost": "http://47.106.228.67:5037", 14 | "SelfPort": 80 15 | }, 16 | "RabbitMqHost": "" 17 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.InnerApi.Customer/appsettings.Tes.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft": "Information" 6 | } 7 | }, 8 | "MongoDbUrl": "", 9 | "AllowedHosts": "*", 10 | "PersonpPlatformDB": "", 11 | "Consul": { 12 | "ServiceName": "Customer", 13 | "ConsulHost": "http://47.106.228.67:5037", 14 | "SelfPort": 80 15 | }, 16 | "RabbitMqHost": "" 17 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.InnerApi.Customer/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft": "Information" 6 | } 7 | }, 8 | "MongoDbUrl": "", 9 | "AllowedHosts": "*", 10 | "PersonpPlatformDB": "", 11 | "Consul": { 12 | "ServiceName": "Customer", 13 | "ConsulHost": "http://47.106.228.67:5037", 14 | "SelfPort": 80 15 | }, 16 | "RabbitMqHost": "" 17 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.InnerApi.Customer/skyapm.json: -------------------------------------------------------------------------------- 1 | { 2 | "SkyWalking": { 3 | "ServiceName": "GS.InnerApi.Customer", 4 | "Namespace": "", 5 | "HeaderVersions": [ 6 | "sw6" 7 | ], 8 | "Sampling": { 9 | "SamplePer3Secs": -1, 10 | "Percentage": -1.0 11 | }, 12 | "Logging": { 13 | "Level": "Information", 14 | "FilePath": "logs/skyapm-{Date}.log" 15 | }, 16 | "Transport": { 17 | "Interval": 3000, 18 | "ProtocolVersion": "v6", 19 | "QueueSize": 30000, 20 | "BatchSize": 3000, 21 | "gRPC": { 22 | "Servers": "im.gshichina.com:5046", 23 | "Timeout": 10000, 24 | "ConnectTimeout": 10000, 25 | "ReportTimeout": 600000 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/0.Sikiro.Interface.Customer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | 1.2.3.1 6 | 陈珙 7 | 葛氏 8 | 个人平台内部API 9 | Sikiro.Interface.Customer 10 | Sikiro.Interface.Customer 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/ICustomer.cs: -------------------------------------------------------------------------------- 1 | using WebApiClient; 2 | 3 | namespace Sikiro.Interface.Customer 4 | { 5 | /// 6 | /// 个人平台接口 7 | /// 8 | public interface ICustomer : IHttpApi 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/BindingWxRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class BindingWxRequest 6 | { 7 | [Required(ErrorMessage = "请输入用户ID")] 8 | public string UserId { get; set; } 9 | 10 | [Required(ErrorMessage = "openid不能为空")] 11 | public string OpenId { get; set; } 12 | 13 | [Required(ErrorMessage = "微信昵称不能为空")] 14 | public string WxName { get; set; } 15 | 16 | /// 17 | /// 企业ID 18 | /// 19 | [Required(ErrorMessage = "企业ID必传")] 20 | public string CompanyId { get; set; } 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/ChangePayPwdUserRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | /// 6 | /// 7 | /// 8 | public class ChangePayPwdUserRequest 9 | { 10 | [Required(ErrorMessage = "请输入用户ID")] 11 | public string UserId { get; set; } 12 | 13 | [Required(ErrorMessage = "请输入登录密码")] 14 | public string OldPassword { get; set; } 15 | 16 | [Required(ErrorMessage = "请输入新登录密码")] 17 | public string NewPassword { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/CheckingPayPasswordRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | /// 6 | /// 7 | /// 8 | public class CheckingPayPasswordRequest 9 | { 10 | [Required(ErrorMessage = "请输入用户ID")] 11 | public string UserId { get; set; } 12 | 13 | [Required(ErrorMessage = "请输入支付密码")] 14 | public string PayPassword { get; set; } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/FinancialBalancePayRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class FinancialBalancePayRequest 6 | { 7 | [Required(ErrorMessage = "订单ID为必传")] 8 | public string WharehouseOrderId { get; set; } 9 | 10 | 11 | public decimal Money { get; set; } 12 | 13 | public string UserId { get; set; } 14 | 15 | public string CompanyId { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/FinancialRechargeRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class FinancialRechargeRequest 6 | { 7 | [Required(ErrorMessage = "企业id不能为空")] 8 | [StringLength(32, ErrorMessage = "企业id不能超过32字符")] 9 | public string CompanyId { get; set; } 10 | 11 | [Required(ErrorMessage = "用户id不能为空")] 12 | [StringLength(32, ErrorMessage = "用户id不能超过32字符")] 13 | public string UserNo { get; set; } 14 | 15 | [Required(ErrorMessage = "充值金额必须大于0")] 16 | public decimal Money { get; set; } 17 | 18 | public string Remark { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/GetPhoneUserRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Interface.Customer.User 2 | { 3 | /// 4 | /// 5 | /// 6 | public class GetPhoneUserRequest 7 | { 8 | /// 9 | /// 登录名(用户名或者手机号) 10 | /// 11 | public string UserName { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/GetPhoneUserResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Interface.Customer.User 2 | { 3 | /// 4 | /// 5 | /// 6 | public class GetPhoneUserResponse 7 | { 8 | public string Phone { get; set; } 9 | 10 | public string CountryCode { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/GetUserRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | /// 6 | /// 根据企业ID,获取数据 7 | /// 8 | public class GetUserRequest 9 | { 10 | [Required(ErrorMessage = "企业id不能为空")] 11 | [StringLength(32, ErrorMessage = "企业id不能超过32字符")] 12 | public string CompanyId { get; set; } 13 | 14 | [Required(ErrorMessage = "用户id不能为空")] 15 | [StringLength(32, ErrorMessage = "用户id不能超过32字符")] 16 | public string UserNo { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/LogonCheckRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class LogonCheckRequest 6 | { 7 | [Required] 8 | public string UserName { get; set; } 9 | 10 | [Required] 11 | public string Password { get; set; } 12 | 13 | [Required] 14 | public string CompanyId { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/LogonCheckResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Interface.Customer.User 2 | { 3 | public class LogonCheckResponse 4 | { 5 | public string UserId { get; set; } 6 | 7 | /// 8 | /// 公司ID 9 | /// 10 | public string CompanyId { get; set; } 11 | 12 | /// 13 | /// 工号 14 | /// 15 | public string UserNo { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/RandomPasswordResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Interface.Customer.User 2 | { 3 | public class RandomPasswordResponse 4 | { 5 | public string Password { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/RegisterUserRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | /// 6 | /// 7 | /// 8 | public class RegisterUserRequest 9 | { 10 | [Required(ErrorMessage = "请输入用户名")] 11 | public string UserName { get; set; } 12 | 13 | [Required(ErrorMessage = "请输入密码")] 14 | public string Password { get; set; } 15 | 16 | public string CompanyId { get; set; } 17 | 18 | [Required(ErrorMessage = "请输入手机号")] 19 | public string Phone { get; set; } 20 | 21 | /// 22 | /// 区号 23 | /// 24 | [Required(ErrorMessage = "区号")] 25 | public string CountryCode { get; set; } 26 | 27 | public string UserNo { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/ResetUserPasswordRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class ResetUserPasswordRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/ResetUserPasswordResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Interface.Customer.User 2 | { 3 | public class ResetUserPasswordResponse 4 | { 5 | public string Password { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/SearchUserRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class SearchUserRequest 6 | { 7 | public string UserNo { get; set; } 8 | 9 | public string UserName { get; set; } 10 | 11 | public string Phone { get; set; } 12 | 13 | public DateTime? DateTimeFrom { get; set; } 14 | 15 | public DateTime? DateTimeTo { get; set; } 16 | 17 | public int Status { get; set; } 18 | 19 | public string CompanyId { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/SetPayPwdUserRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | /// 6 | /// 7 | /// 8 | public class SetPayPwdUserRequest 9 | { 10 | [Required(ErrorMessage = "请输入用户ID")] 11 | public string UserId { get; set; } 12 | 13 | [Required(ErrorMessage = "请输入新支付密码")] 14 | public string PayPassword { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/UpdateArea.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Interface.Customer.User 2 | { 3 | public class UpdateArea 4 | { 5 | public string CountryId { get; set; } 6 | 7 | public string CountryName { get; set; } 8 | 9 | public string CityId { get; set; } 10 | 11 | public string CityName { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/UpdateAreaRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class UpdateAreaRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | public UpdateArea AreaRequest {get; set; } 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/UpdateBusinessManagerRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class UpdateBusinessManagerRequest 6 | { 7 | [Required] 8 | public string UserId { get; set; } 9 | 10 | public string BusinessManager { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/UpdateEmailRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class UpdateEmailRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public string Email { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/UpdateMemberGradesRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class UpdateMemberGradesRequest 6 | { 7 | [Required] 8 | public string UserId { get; set; } 9 | 10 | [Required] 11 | public string MemberGradesId { get; set; } 12 | 13 | [Required] 14 | public string MemberGradesName { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/UpdateNickNameRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class UpdateNickNameRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public string NickName { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/UpdatePhoneUserRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | /// 6 | /// 7 | /// 8 | public class UpdatePhoneUserRequest 9 | { 10 | 11 | [Required(ErrorMessage = "请输入用户ID")] 12 | public string UserId { get; set; } 13 | 14 | [Required(ErrorMessage = "请输入手机号码")] 15 | public string Phone { get; set; } 16 | 17 | /// 18 | /// 区号 19 | /// 20 | [Required(ErrorMessage = "区号")] 21 | public string CountryCode { get; set; } 22 | 23 | [Required(ErrorMessage = "请输入企业Id")] 24 | public string CompanyId { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/UpdatePwdUserRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | /// 6 | /// 7 | /// 8 | public class UpdatePwdUserRequest 9 | { 10 | [Required(ErrorMessage = "请输入用户ID")] 11 | public string UserId { get; set; } 12 | 13 | [Required(ErrorMessage = "请输入登录密码")] 14 | public string OldPassword { get; set; } 15 | 16 | [Required(ErrorMessage = "请输入新登录密码")] 17 | public string NewPassword { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/UpdateRealNameRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class UpdateRealNameRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public string RealName { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/UpdateRetrievePwdUserRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | /// 6 | /// 7 | /// 8 | public class UpdateRetrievePwdUserRequest 9 | { 10 | [Required(ErrorMessage = "请输入手机号")] 11 | public string Phone { get; set; } 12 | 13 | [Required(ErrorMessage = "请输入新登录密码")] 14 | public string NewPassword { get; set; } 15 | 16 | /// 17 | /// 企业Id 18 | /// 19 | [Required(ErrorMessage = "请输入新登录密码")] 20 | public string CompanyId { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/UpdateUserLableRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class UpdateUserLableRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | public string UserLable { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/UpdateUserLogoRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class UpdateUserLogoRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public string ImgUrl { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/UpdateUserNameRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class UpdateUserNameRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public string UserName { get; set; } 12 | 13 | [Required] 14 | public string CompanyId { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/UpdateUserStatusRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class UpdateUserStatusRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public int Status { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Interface.Customer/User/WxLogonCheckRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Interface.Customer.User 4 | { 5 | public class WxLogonCheckRequest 6 | { 7 | [Required(ErrorMessage = "openid不能为空")] 8 | public string OpenId { get; set; } 9 | 10 | /// 11 | /// 企业ID 12 | /// 13 | [Required(ErrorMessage = "企业ID必传")] 14 | public string CompanyId { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Service.Customer/2.Sikiro.Service.Customer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | Sikiro.Service.Customer 6 | Sikiro.Service.Customer 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Service.Customer/BaseService.cs: -------------------------------------------------------------------------------- 1 | using Sikiro.Entity.Customer.DBContext; 2 | using Sikiro.Tookits.Interfaces; 3 | 4 | namespace Sikiro.Service.Customer 5 | { 6 | /// 7 | /// 基础服务类 8 | /// 9 | public class BaseService : IDepend 10 | { 11 | protected readonly PersonPlatformContext Db; 12 | 13 | public BaseService(PersonPlatformContext db) 14 | { 15 | Db = db; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/业务API服务/GS.Service.Customer/Enums/PersonEnum.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.Service.Customer.Enums 4 | { 5 | public class PersonEnum 6 | { 7 | public enum EStatus 8 | { 9 | /// 10 | /// 已取消 11 | /// 12 | [Display(Name = "已取消")] 13 | Stop = 0, 14 | /// 15 | /// 已创建 16 | /// 17 | [Display(Name = "已创建")] 18 | Open = 1, 19 | /// 20 | /// 已完成 21 | /// 22 | [Display(Name = "已完成")] 23 | Complete = 2, 24 | } 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Attribute/ChineseAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using Sikiro.Common.Utils; 3 | 4 | namespace Sikiro.WebApi.Customer.Attribute 5 | { 6 | /// 7 | /// 中文 8 | /// 9 | public class ChineseAttribute : RegularExpressionAttribute 10 | { 11 | private const string RegexPattern = RegularExpression.Chinese; 12 | public ChineseAttribute() 13 | : base(RegexPattern) 14 | { 15 | ErrorMessage = "请输入中文"; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Attribute/EmailAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Attribute 4 | { 5 | /// 6 | /// 邮箱验证特性 7 | /// 8 | public class EmailAttribute : RegularExpressionAttribute 9 | { 10 | private const string RegexPattern = @"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"; 11 | public EmailAttribute(): base(RegexPattern) 12 | { 13 | ErrorMessage = "邮箱格式不正确"; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Attribute/GolbalExceptionAttribute.cs: -------------------------------------------------------------------------------- 1 | using Sikiro.Tookits.Base; 2 | using Sikiro.Tookits.Extension; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Microsoft.AspNetCore.Mvc.Filters; 5 | 6 | namespace Sikiro.WebApi.Customer.Attribute 7 | { 8 | /// 9 | /// 全局异常捕获 10 | /// 11 | public class GolbalExceptionAttribute : ExceptionFilterAttribute 12 | { 13 | public override void OnException(ExceptionContext context) 14 | { 15 | if (!context.ExceptionHandled) 16 | { 17 | var exception = context.Exception.GetDeepestException(); 18 | exception.WriteToFile("全局异常捕抓"); 19 | 20 | context.ExceptionHandled = true; 21 | context.Result = new ObjectResult(ApiResult.IsError("服务器正在开小差~请稍后重试~")); 22 | context.HttpContext.Response.StatusCode = 500; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Attribute/IdCardAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using Sikiro.Common.Utils; 3 | 4 | namespace Sikiro.WebApi.Customer.Attribute 5 | { 6 | /// 7 | /// 邮箱验证特性 8 | /// 9 | public class IdCardAttribute : RegularExpressionAttribute 10 | { 11 | private const string RegexPattern = RegularExpression.IdNum; 12 | public IdCardAttribute(): base(RegexPattern) 13 | { 14 | ErrorMessage = "身份证格式不正确"; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Attribute/MobileAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Attribute 4 | { 5 | /// 6 | /// 手机号码 7 | /// 8 | public class MobileAttribute : RegularExpressionAttribute 9 | { 10 | private const string RegexPattern = @"^1[0-9]{10}$"; 11 | public MobileAttribute() : base(RegexPattern) 12 | { 13 | ErrorMessage = "手机号码不正确"; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Attribute/PasswordAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Attribute 4 | { 5 | /// 6 | /// 密码验证特性 7 | /// 8 | public class PasswordAttribute : RegularExpressionAttribute 9 | { 10 | private const string RegexPattern = @"^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{6,18}$"; 11 | public PasswordAttribute(bool isFlag, string msg) : base(RegexPattern) 12 | { 13 | if (isFlag) 14 | { 15 | ErrorMessage = msg; 16 | } 17 | else 18 | { 19 | ErrorMessage = "请输入6-18位字母与数字组合的密码"; 20 | } 21 | 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Attribute/TableColsAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Attribute 4 | { 5 | public class TableColsAttribute : System.Attribute 6 | { 7 | public TableColsAttribute() 8 | { 9 | Align = EAlign.Left; 10 | } 11 | public string Field { get; set; } 12 | 13 | public string Tile { get; set; } 14 | 15 | public int Width { get; set; } 16 | 17 | public EAlign Align { get; set; } 18 | 19 | private bool _isImage = false; 20 | public bool IsImage { get => _isImage; set => _isImage = value; } 21 | } 22 | 23 | public enum EAlign 24 | { 25 | [Display(Name = "center")] 26 | Center = 0, 27 | [Display(Name = "right")] 28 | Right = 1, 29 | [Display(Name = "left")] 30 | Left = 2, 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Controllers/BaseController.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Security.Claims; 3 | using Microsoft.AspNetCore.Authorization; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Sikiro.Common.Utils; 6 | using Sikiro.Tookits.Extension; 7 | 8 | namespace Sikiro.WebApi.Customer.Controllers 9 | { 10 | [Authorize] 11 | [Route("api/[controller]")] 12 | [ApiController] 13 | public class BaseController : ControllerBase 14 | { 15 | /// 16 | /// 获取登录用户信息 17 | /// 18 | protected AdministratorData CurrentUserData => GetCurrentUser(); 19 | 20 | private AdministratorData GetCurrentUser() 21 | { 22 | return HttpContext.User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.UserData)?.Value.FromJson(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Extention/ConstString.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.WebApi.Customer.Extention 2 | { 3 | public static class ConstString 4 | { 5 | public const string AuthKey = "9D2ACA0C-480A-4628-BEAE-93DB4DE1F3A2"; 6 | 7 | public const string JwtCompanyId = "CompnayId"; 8 | 9 | public const string JwtUserType = "UserType"; 10 | 11 | public const string KeyName = "key"; 12 | 13 | public const string KeyValue = "28RVSrSl7pDZTZqFH4Yd3TlMmZmzMrRC"; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Extention/ModelStateExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | using Microsoft.AspNetCore.Mvc.ModelBinding; 3 | 4 | namespace Sikiro.WebApi.Customer.Extention 5 | { 6 | public static class ModelStateExtensions 7 | { 8 | /// 9 | /// 获取模型验证错误信息 10 | /// 11 | /// 12 | /// 13 | public static string GetModelStateMsg(this ModelStateDictionary modelState) 14 | { 15 | var builder = new StringBuilder(); 16 | 17 | foreach (var key in modelState.Keys) 18 | { 19 | var errors = modelState[key].Errors; 20 | 21 | foreach (var error in errors) 22 | { 23 | if (builder.Length > 0) 24 | builder.Append("
"); 25 | 26 | builder.Append(error.ErrorMessage); 27 | } 28 | } 29 | 30 | return builder.ToString(); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Models/User/Request/EmailRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | public class EmailRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public string Email { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Models/User/Request/NickNameRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | public class NickNameRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public string NickName { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Models/User/Request/RealNameRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | public class RealNameRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public string RealName { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Models/User/Request/SendSmsRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | /// 6 | /// 登录请求 7 | /// 8 | public class SendSmsRequest 9 | { 10 | /// 11 | /// 手机号码 12 | /// 13 | [Required(ErrorMessage = "请输入手机号")] 14 | public string Phone { get; set; } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Models/User/Request/UserBindingWxRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | /// 6 | /// 用户信息 7 | /// 8 | public class UserBindingWxRequest 9 | { 10 | /// 11 | /// 微信授权CODE 12 | /// 13 | [Required(ErrorMessage = "微信授权CODE必传")] 14 | public string WxCode { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Models/User/Request/UserChangePayPwdRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | /// 6 | /// 修改密码 7 | /// 8 | public class UserChangePayPwdRequest 9 | { 10 | /// 11 | /// 旧密码 12 | /// 13 | [Required(ErrorMessage = "请输入登录密码")] 14 | public string OldPassword { get; set; } 15 | /// 16 | /// 新密码 17 | /// 18 | [Required(ErrorMessage = "请输入新登录密码")] 19 | public string NewPassword { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Models/User/Request/UserCheckingPayPasswordRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | /// 6 | /// 修改密码 7 | /// 8 | public class UserCheckingPayPasswordRequest 9 | { 10 | /// 11 | /// 新密码 12 | /// 13 | [Required(ErrorMessage = "请输入支付密码")] 14 | public string PayPassword { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Models/User/Request/UserLogoRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | public class UserLogoRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public string ImgUrl { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Models/User/Request/UserLogonRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | /// 6 | /// 登录请求 7 | /// 8 | public class UserLogonRequest 9 | { 10 | /// 11 | /// 用户账户 12 | /// 13 | [Required(ErrorMessage = "请输入登录账号")] 14 | public string UserName { get; set; } 15 | /// 16 | /// 用户密码 17 | /// 18 | [Required(ErrorMessage = "请输入登录密码")] 19 | public string Password { get; set; } 20 | 21 | /// 22 | /// 企业Id 23 | /// 24 | [Required(ErrorMessage = "公司Id不能为空")] 25 | public string CompanyId { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Models/User/Request/UserNameRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | public class UserNameRequest 6 | { 7 | [Required] 8 | public string Id { get; set; } 9 | 10 | [Required] 11 | public string UserName { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Models/User/Request/UserSetPayPwdRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | /// 6 | /// 用户信息 7 | /// 8 | public class UserSetPayPwdRequest 9 | { 10 | /// 11 | /// 支付密码 12 | /// 13 | [Required(ErrorMessage = "请输入支付密码")] 14 | public string PayPassword { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Models/User/Request/UserUpdatePhoneRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | /// 6 | /// 用户信息 7 | /// 8 | public class UserUpdatePhoneRequest 9 | { 10 | /// 11 | /// 手机号 12 | /// 13 | [Required(ErrorMessage = "请输入手机号码")] 14 | public string Phone { get; set; } 15 | 16 | /// 17 | /// 验证码 18 | /// 19 | [Required(ErrorMessage = "请输入验证码")] 20 | public string Code { get; set; } 21 | 22 | /// 23 | /// 区号 24 | /// 25 | [Required(ErrorMessage = "区号")] 26 | public string CountryCode { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Models/User/Request/UserUpdatePwdRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | /// 6 | /// 修改密码 7 | /// 8 | public class UserUpdatePwdRequest 9 | { 10 | /// 11 | /// 用户ID 12 | /// 13 | [Required(ErrorMessage = "请输入用户ID")] 14 | public string UserId { get; set; } 15 | 16 | /// 17 | /// 登录密码(旧) 18 | /// 19 | [Required(ErrorMessage = "请输入登录密码")] 20 | public string OldPassword { get; set; } 21 | 22 | /// 23 | /// 新登录密码 24 | /// 25 | [Required(ErrorMessage = "请输入新登录密码")] 26 | public string NewPassword { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Models/User/Request/UserWxLogonCheckRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | /// 6 | /// 用户信息 7 | /// 8 | public class UserWxLogonCheckRequest 9 | { 10 | /// 11 | /// 微信授权CODE 12 | /// 13 | [Required(ErrorMessage = "微信授权CODE必传")] 14 | public string WxCode { get; set; } 15 | 16 | /// 17 | /// 企业ID 18 | /// 19 | [Required(ErrorMessage = "企业ID必传")] 20 | public string CompanyId { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Models/User/Request/VaildSmsRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Sikiro.WebApi.Customer.Models.User.Request 4 | { 5 | /// 6 | /// 登录请求 7 | /// 8 | public class VaildSmsRequest 9 | { 10 | /// 11 | /// 手机号码 12 | /// 13 | [Required(ErrorMessage = "请输入手机号")] 14 | public string Phone { get; set; } 15 | 16 | /// 17 | /// 验证码 18 | /// 19 | [Required(ErrorMessage = "请输入验证码")] 20 | public string Code { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Models/User/Response/UserGetPhoneResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.WebApi.Customer.Models.User.Response 2 | { 3 | /// 4 | /// 用户信息 5 | /// 6 | public class UserGetPhoneResponse 7 | { 8 | /// 9 | /// 用户登陆名称/手机 10 | /// 11 | public string UserName { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Models/User/Response/UserLogonResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.WebApi.Customer.Models.User.Response 2 | { 3 | /// 4 | /// 登录响应 5 | /// 6 | public class UserLogonResponse 7 | { 8 | /// 9 | /// 用户id 10 | /// 11 | public string UserId { get; set; } 12 | 13 | /// 14 | /// 授权码 15 | /// 16 | public string AccessToken { get; set; } 17 | 18 | /// 19 | /// 用户WXid 20 | /// 21 | public string OpenId { get; set; } 22 | 23 | /// 24 | /// 公司ID 25 | /// 26 | public string CompanyId { get; set; } 27 | 28 | /// 29 | /// 登录令牌 30 | /// 31 | public string Token { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace Sikiro.WebApi.Customer 5 | { 6 | 7 | /// 8 | /// 9 | /// 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | CreateWebHostBuilder(args).Build().Run(); 15 | } 16 | 17 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 18 | WebHost.CreateDefaultBuilder(args) 19 | .UseStartup(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Properties/PublishProfiles/FolderProfile.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | FileSystem 9 | FileSystem 10 | Release 11 | Any CPU 12 | 13 | True 14 | False 15 | c7c94dad-53ee-457a-b8d1-b303985471a9 16 | bin\Debug\netcoreapp2.2\publish\ 17 | False 18 | 19 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:8011", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development", 16 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "SkyAPM.Agent.AspNetCore" 17 | } 18 | }, 19 | "GS.WebApi.Customer": { 20 | "commandName": "Project", 21 | "launchBrowser": true, 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development", 24 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "SkyAPM.Agent.AspNetCore" 25 | }, 26 | "applicationUrl": "http://localhost:8011" 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | }, 9 | "wechat": { 10 | "appid": "", 11 | "appSecret": "", 12 | "MchId": "", 13 | "Key": "", 14 | "NotifyUrl": "" 15 | }, 16 | "IdServerUrl": "http://172.17.0.1:8008/IDGenerate/", 17 | "CustomerInnerApiUrl": "http://localhost:8066/", 18 | "WarehouseInnerApiUrl": "http://172.17.0.1:8008/Warehouse/", 19 | "MsgInnerApiUrl": "http://172.17.0.1:8008/Msg/", 20 | "CmsInnerApiUrl": "http://172.17.0.1:8008/Cms/", 21 | "CapitalInnerApiUrl": "http://172.17.0.1:8008/Capital/", 22 | "RedisUrl": "", 23 | "BusinessPlatformDB": "" 24 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/appsettings.Production.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | }, 9 | "wechat": { 10 | "appid": "", 11 | "appSecret": "", 12 | "MchId": "", 13 | "Key": "", 14 | "NotifyUrl": "" 15 | }, 16 | "IdServerUrl": "http://172.17.0.1:8008/IDGenerate/", 17 | "CustomerInnerApiUrl": "http://172.17.0.1:8008/Customer/", 18 | "WarehouseInnerApiUrl": "http://172.17.0.1:8008/Warehouse/", 19 | "MsgInnerApiUrl": "http://172.17.0.1:8008/Msg/", 20 | "CmsInnerApiUrl": "http://172.17.0.1:8008/Cms/", 21 | "CapitalInnerApiUrl": "http://172.17.0.1:8008/Capital/", 22 | "RedisUrl": "", 23 | "BusinessPlatformDB": "" 24 | } 25 | -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/appsettings.Test.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | }, 9 | "wechat": { 10 | "appid": "", 11 | "appSecret": "", 12 | "MchId": "", 13 | "Key": "", 14 | "NotifyUrl": "" 15 | }, 16 | "IdServerUrl": "http://172.17.0.1:8008/IDGenerate/", 17 | "CustomerInnerApiUrl": "http://172.17.0.1:8008/Customer/", 18 | "WarehouseInnerApiUrl": "http://172.17.0.1:8008/Warehouse/", 19 | "MsgInnerApiUrl": "http://172.17.0.1:8008/Msg/", 20 | "CmsInnerApiUrl": "http://172.17.0.1:8008/Cms/", 21 | "CapitalInnerApiUrl": "http://172.17.0.1:8008/Capital/", 22 | "RedisUrl": "", 23 | "BusinessPlatformDB": "" 24 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | }, 9 | "wechat": { 10 | "appid": "", 11 | "appSecret": "", 12 | "MchId": "", 13 | "Key": "", 14 | "NotifyUrl": "" 15 | }, 16 | "IdServerUrl": "http://172.17.0.1:8008/IDGenerate/", 17 | "CustomerInnerApiUrl": "http://localhost:8066/", 18 | "WarehouseInnerApiUrl": "http://172.17.0.1:8008/Warehouse/", 19 | "MsgInnerApiUrl": "http://172.17.0.1:8008/Msg/", 20 | "CmsInnerApiUrl": "http://172.17.0.1:8008/Cms/", 21 | "CapitalInnerApiUrl": "http://172.17.0.1:8008/Capital/", 22 | "RedisUrl": "", 23 | "BusinessPlatformDB": "" 24 | } -------------------------------------------------------------------------------- /samples/客户系统解决方案/聚合API服务/GS.WebApi.Customer/skyapm.json: -------------------------------------------------------------------------------- 1 | { 2 | "SkyWalking": { 3 | "ServiceName": "GS.WebApi.Customer", 4 | "Namespace": "", 5 | "HeaderVersions": [ 6 | "sw6" 7 | ], 8 | "Sampling": { 9 | "SamplePer3Secs": -1, 10 | "Percentage": -1.0 11 | }, 12 | "Logging": { 13 | "Level": "Information", 14 | "FilePath": "logs\\skyapm-{Date}.log" 15 | }, 16 | "Transport": { 17 | "Interval": 3000, 18 | "ProtocolVersion": "v6", 19 | "QueueSize": 30000, 20 | "BatchSize": 3000, 21 | "gRPC": { 22 | "Servers": "im.gshichina.com:5046", 23 | "Timeout": 10000, 24 | "ConnectTimeout": 10000, 25 | "ReportTimeout": 600000 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/DotNetCore.CAP.MySql/CAP.EFOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Core Community. All rights reserved. 2 | // Licensed under the MIT License. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | // ReSharper disable once CheckNamespace 7 | namespace DotNetCore.CAP.MySql 8 | { 9 | public class EFOptions 10 | { 11 | public const string DefaultSchema = "cap"; 12 | 13 | /// 14 | /// Gets or sets the table name prefix to use when creating database objects. 15 | /// 16 | public string TableNamePrefix { get; set; } = DefaultSchema; 17 | 18 | /// 19 | /// EF db context type. 20 | /// 21 | internal Type DbContextType { get; set; } 22 | 23 | /// 24 | /// Data version 25 | /// 26 | internal string Version { get; set; } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Sikiro.Bus.Extension/BaseConsumer.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Bus.Extension 2 | { 3 | public abstract class BaseConsumer where T : EasyNetQEntity 4 | { 5 | public abstract void Excute(T msg); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Sikiro.Bus.Extension/ConsumerExtension.cs: -------------------------------------------------------------------------------- 1 | using EasyNetQ; 2 | using Microsoft.AspNetCore.Builder; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using Microsoft.Extensions.Hosting; 5 | 6 | namespace Sikiro.Bus.Extension 7 | { 8 | /// 9 | /// 订阅消费 10 | /// 11 | public static class ConsumerExtension 12 | { 13 | public static IApplicationBuilder UseSubscribe(this IApplicationBuilder appBuilder, IHostApplicationLifetime lifetime) where T : EasyNetQEntity, new() where TConsumer : BaseConsumer 14 | { 15 | var bus = appBuilder.ApplicationServices.GetRequiredService(); 16 | var consumer = appBuilder.ApplicationServices.GetRequiredService(); 17 | 18 | lifetime.ApplicationStarted.Register(() => 19 | { 20 | bus.Subscribe(msg => consumer.Excute(msg)); 21 | }); 22 | 23 | lifetime.ApplicationStopped.Register(() => bus?.Dispose()); 24 | 25 | return appBuilder; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Sikiro.Bus.Extension/EasyNetQEntity.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Bus.Extension 2 | { 3 | public abstract class EasyNetQEntity 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Sikiro.Bus.Extension/IBusConsumer.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace Sikiro.Bus.Extension 4 | { 5 | /// 6 | /// 消息总线消费者 7 | /// 8 | public interface IBusConsumer 9 | { 10 | /// 11 | /// 业务执行 12 | /// 13 | /// 14 | /// 15 | Task Excute(T msg); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Sikiro.Bus.Extension/Sikiro.Bus.Extension.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 陈珙 6 | 葛氏 7 | 消息队列扩展 8 | 1.0.0.1 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Sikiro.Chloe.Cap/ConnectionParser/Sprache/IFailure.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Sikiro.Chloe.Cap.ConnectionParser.Sprache 4 | { 5 | internal interface IFailure : IResult 6 | { 7 | string Message { get; } 8 | IEnumerable Expectations { get; } 9 | Input FailedInput { get; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Sikiro.Chloe.Cap/ConnectionParser/Sprache/IResultOfT.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Chloe.Cap.ConnectionParser.Sprache 2 | { 3 | internal interface IResult 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Sikiro.Chloe.Cap/ConnectionParser/Sprache/ISuccess.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Chloe.Cap.ConnectionParser.Sprache 2 | { 3 | internal interface ISuccess : IResult 4 | { 5 | T Result { get; } 6 | Input Remainder { get; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Sikiro.Chloe.Cap/ConnectionParser/Sprache/ParseException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Sikiro.Chloe.Cap.ConnectionParser.Sprache 4 | { 5 | internal class ParseException : Exception 6 | { 7 | public ParseException(string message) 8 | : base(message) 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Sikiro.Chloe.Cap/ConnectionParser/Sprache/ResultHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Sikiro.Chloe.Cap.ConnectionParser.Sprache 4 | { 5 | internal static class ResultHelper 6 | { 7 | public static IResult IfSuccess(this IResult result, Func, IResult> next) 8 | { 9 | if (result is ISuccess s) 10 | return next(s); 11 | 12 | var f = (IFailure)result; 13 | return new Failure(f.FailedInput, () => f.Message, () => f.Expectations); 14 | } 15 | 16 | public static IResult IfFailure(this IResult result, Func, IResult> next) 17 | { 18 | if (result is ISuccess s) 19 | return s; 20 | var f = (IFailure)result; 21 | return next(f); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Sikiro.Chloe.Cap/ConnectionParser/Sprache/Success.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Chloe.Cap.ConnectionParser.Sprache 2 | { 3 | internal sealed class Success : ISuccess 4 | { 5 | readonly Input _remainder; 6 | readonly T _result; 7 | 8 | public Success(T result, Input remainder) 9 | { 10 | _result = result; 11 | _remainder = remainder; 12 | } 13 | 14 | public T Result => _result; 15 | 16 | public Input Remainder => _remainder; 17 | 18 | public override string ToString() 19 | { 20 | return string.Format("Successful parsing of {0}.", Result); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Sikiro.Chloe.Cap/Properties/PublishProfiles/FolderProfile.pubxml: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 7 | FileSystem 8 | Release 9 | Any CPU 10 | netcoreapp2.2 11 | bin\Debug\netcoreapp2.2\publish\ 12 | 13 | -------------------------------------------------------------------------------- /src/Sikiro.Chloe.Cap/Sikiro.Chloe.Cap.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | 1.1.1.4 6 | 陈珙 7 | GS.Chloe.Cap 8 | 葛氏 9 | 基于Cap的分布式事务封装 10 | GS.Chloe.Cap 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/Sikiro.Chloe.Extension/IocExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Chloe.MySql; 3 | using Microsoft.Extensions.DependencyInjection; 4 | 5 | namespace Sikiro.Chloe.Extension 6 | { 7 | public static class IocExtension 8 | { 9 | public static void AddChloeDbContext(this IServiceCollection services, string connectionStr) where T : MySqlContext 10 | { 11 | services.AddScoped(serviceProvider => (T)Activator.CreateInstance(typeof(T), new MySqlConnectionFactory(connectionStr))); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Sikiro.Chloe.Extension/MySqlConnectionFactory.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using Chloe.Infrastructure; 3 | using Chloe.MySql; 4 | using MySql.Data.MySqlClient; 5 | 6 | namespace Sikiro.Chloe.Extension 7 | { 8 | public class MySqlConnectionFactory : IDbConnectionFactory 9 | { 10 | private readonly string _connString; 11 | public MySqlConnectionFactory(string connString) 12 | { 13 | _connString = connString; 14 | } 15 | public IDbConnection CreateConnection() 16 | { 17 | IDbConnection conn = new MySqlConnection(_connString); 18 | conn = new ChloeMySqlConnection(conn); 19 | return conn; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Sikiro.Chloe.Extension/Sikiro.Chloe.Extension.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | 1.0.1.8 6 | 陈珙 7 | GS.Chloe.Extension 8 | 葛氏 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Sikiro.Elasticsearch.Extension/ElasticsearchEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Nest; 3 | using Sikiro.Tookits.Extension; 4 | 5 | namespace Sikiro.Elasticsearch.Extension 6 | { 7 | public abstract class ElasticsearchEntity 8 | { 9 | private Guid? _id; 10 | 11 | public Guid Id 12 | { 13 | get 14 | { 15 | _id ??= Guid.NewGuid(); 16 | return _id.Value; 17 | } 18 | set => _id = value; 19 | } 20 | 21 | private long? _timestamp; 22 | 23 | [Number(NumberType.Long, Name = "timestamp")] 24 | public long Timestamp 25 | { 26 | get 27 | { 28 | _timestamp ??= DateTime.Now.DateTimeToTimestampOfMicrosecond(); 29 | return _timestamp.Value; 30 | } 31 | set => _timestamp = value; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Sikiro.Elasticsearch.Extension/ResponseExtension.cs: -------------------------------------------------------------------------------- 1 | using Nest; 2 | using Sikiro.Tookits.Base; 3 | using Sikiro.Tookits.Extension; 4 | 5 | namespace Sikiro.Elasticsearch.Extension 6 | { 7 | public static class ResponseExtension 8 | { 9 | public static ApiResult GetApiResult(this ISearchResponse searchResponse) 10 | where T : class, new() where TResult : class, new() 11 | { 12 | var data = searchResponse.Documents.MapTo(); 13 | return searchResponse.ApiCall.Success 14 | ? ApiResult.IsSuccess(data) 15 | : ApiResult.IsFailed(searchResponse.ApiCall.OriginalException.Message); 16 | } 17 | 18 | public static ApiResult GetApiResult(this CreateResponse createResponse) 19 | { 20 | return createResponse.ApiCall.Success 21 | ? ApiResult.IsSuccess() 22 | : ApiResult.IsFailed(createResponse.ApiCall.OriginalException.Message); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Sikiro.Elasticsearch.Extension/SearchRequestExtension.cs: -------------------------------------------------------------------------------- 1 | using Nest; 2 | 3 | namespace Sikiro.Elasticsearch.Extension 4 | { 5 | public static class SearchRequestExtension 6 | { 7 | public static SearchDescriptor SearchAfterTimestamp(this SearchDescriptor searchDescriptor, long? timestamp) where T : class 8 | { 9 | if (timestamp.HasValue) 10 | searchDescriptor = searchDescriptor.SearchAfter(timestamp.Value); 11 | 12 | return searchDescriptor; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Sikiro.Elasticsearch.Extension/Sikiro.Elasticsearch.Extension.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | Sikiro.Elasticsearch.Extension 6 | Sikiro.Elasticsearch.Extension 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/Sikiro.Elasticsearch.Extension/TypeExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using Nest; 4 | using Sikiro.Tookits.Extension; 5 | using Sikiro.Tookits.Helper; 6 | 7 | namespace Sikiro.Elasticsearch.Extension 8 | { 9 | public static class TypeExtension 10 | { 11 | public static string GetRelationName(this Type type) 12 | { 13 | var attribute = AttributeHelper.GetAttribute(type); 14 | 15 | if (attribute != null && !attribute.RelationName.IsNullOrWhiteSpace()) 16 | return attribute.RelationName; 17 | 18 | return null; 19 | } 20 | 21 | public static double? GetValue(this AggregateDictionary ad, string name) 22 | { 23 | if (!ad.Any()) 24 | return null; 25 | 26 | return ((ValueAggregate)ad[name]).Value; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Sikiro.MicroService.Extension/Attributes/GolbalExceptionAttribute.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.Filters; 3 | using Sikiro.Tookits.Base; 4 | using Sikiro.Tookits.Extension; 5 | 6 | namespace Sikiro.MicroService.Extension.Attributes 7 | { 8 | /// 9 | /// 全局异常捕获 10 | /// 11 | public class RpcGolbalExceptionAttribute : ExceptionFilterAttribute 12 | { 13 | public override void OnException(ExceptionContext context) 14 | { 15 | if (!context.ExceptionHandled) 16 | { 17 | var exception = context.Exception.GetDeepestException(); 18 | exception.WriteToFile("全局异常捕抓"); 19 | 20 | context.ExceptionHandled = true; 21 | context.Result = new ObjectResult(ApiResult.IsError(exception.ToString())); 22 | context.HttpContext.Response.StatusCode = 500; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Sikiro.MicroService.Extension/SkyApm/IgnoreSamplingInterceptor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using SkyApm.Tracing; 4 | 5 | namespace Sikiro.MicroService.Extension.SkyApm 6 | { 7 | /// 8 | /// 忽略采集终端 9 | /// 10 | public class IgnoreSamplingInterceptor : ISamplingInterceptor 11 | { 12 | private readonly List _ignoreUrlList = new List 13 | { 14 | "/health", 15 | "/swagger" 16 | }; 17 | public int Priority { get; } = 0; 18 | 19 | public bool Invoke(SamplingContext samplingContext, Sampler next) 20 | { 21 | if (_ignoreUrlList.Any(b => samplingContext.OperationName.ToLower().Contains(b))) 22 | return false; 23 | 24 | return next(samplingContext); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Sikiro.MicroService.Extension/SkyApm/SkyApmExtension.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using Sikiro.MicroService.Extension.SkyApm.Diagnostics; 3 | using SkyApm.Tracing; 4 | 5 | namespace Sikiro.MicroService.Extension.SkyApm 6 | { 7 | /// 8 | /// 9 | /// 10 | public static class SkyApmExtension 11 | { 12 | /// 13 | /// Consul服务注册 14 | /// 15 | /// 16 | public static IServiceCollection UseSkyApm(this IServiceCollection services) 17 | { 18 | return services.AddSingleton(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Sikiro.MicroService.Extension/WebApiClient/BaseController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace Sikiro.MicroService.Extension.Rpc 4 | { 5 | /// 6 | /// 基础类 7 | /// 8 | [Route("[controller]/[action]")] 9 | [ApiController] 10 | public class BaseController : ControllerBase 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Sikiro.MicroService.Extension/WebApiClient/DependencyInjectionExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using Sikiro.MicroService.Extension.WebApiClient; 3 | using WebApiClient; 4 | 5 | namespace Sikiro.MicroService.Extension.Rpc 6 | { 7 | /// 8 | /// 基于DependencyInjection的扩展 9 | /// 10 | public static class DependencyInjectionExtensions 11 | { 12 | /// 13 | /// 添加HttpApi 14 | /// 返回HttpApi工厂 15 | /// 16 | /// 基类接口类型 17 | /// 18 | /// 19 | public static HttpApiFactoryBuilder AddHttpApis(this IServiceCollection services) 20 | where TInterface : class, IHttpApi 21 | { 22 | return new HttpApiFactoryBuilder(services); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Sikiro.Nosql.Mongo/Base/MongoAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Sikiro.Nosql.Mongo.Base 4 | { 5 | #region Mongo实体标签 6 | /// 7 | /// 8 | /// Mongo实体标签 9 | /// 10 | public class MongoAttribute : Attribute 11 | { 12 | public MongoAttribute(string database, string collection = null) 13 | { 14 | Database = database; 15 | Collection = collection; 16 | } 17 | 18 | /// 19 | /// 交换机名称 20 | /// 21 | public string Database { get; } 22 | 23 | /// 24 | /// 队列名称 25 | /// 26 | public string Collection { get; } 27 | 28 | } 29 | #endregion 30 | } 31 | -------------------------------------------------------------------------------- /src/Sikiro.Nosql.Mongo/Base/MongoEntity.cs: -------------------------------------------------------------------------------- 1 | using MongoDB.Bson; 2 | using MongoDB.Bson.Serialization.Attributes; 3 | 4 | namespace Sikiro.Nosql.Mongo.Base 5 | { 6 | public abstract class MongoEntity 7 | { 8 | [BsonElement("_id")] 9 | public ObjectId Id { get; set; } 10 | 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Sikiro.Nosql.Mongo/Diagnostics/ExcuteData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using MongoDB.Driver; 3 | 4 | namespace Sikiro.Nosql.Mongo.Diagnostics 5 | { 6 | public class ExcuteData 7 | { 8 | public ExcuteData(Guid operationId, string operation, MongoClient mongoClient) 9 | { 10 | OperationId = operationId; 11 | Operation = operation; 12 | MongoClient = mongoClient; 13 | } 14 | public Guid OperationId { get; } 15 | 16 | public string Operation { get; } 17 | 18 | public MongoClient MongoClient { get; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Sikiro.Nosql.Mongo/Diagnostics/ExcuteExceptionData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using MongoDB.Driver; 3 | 4 | namespace Sikiro.Nosql.Mongo.Diagnostics 5 | { 6 | public class ExcuteExceptionData : ExcuteData 7 | { 8 | public Exception Ex { get; } 9 | 10 | 11 | public ExcuteExceptionData(Guid operationId, string operation, MongoClient mongoClient, Exception ex) : base(operationId, operation, mongoClient) 12 | { 13 | Ex = ex; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Sikiro.Nosql.Mongo/Extension/AttributeHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Concurrent; 3 | using System.Reflection; 4 | 5 | namespace Sikiro.Nosql.Mongo.Extension 6 | { 7 | /// 8 | /// 特性扩展类 9 | /// 10 | internal static class AttributeHelper where T : class 11 | { 12 | private static readonly ConcurrentDictionary AttributeDic = 13 | new ConcurrentDictionary(); 14 | 15 | /// 16 | /// 获取实体特性信息 17 | /// 18 | /// 19 | /// 20 | /// 21 | public static T GetAttribute(Type type) 22 | { 23 | return AttributeDic.GetOrAdd(type, item => 24 | { 25 | var customAttribute = type.GetCustomAttribute(typeof(T)); 26 | 27 | return customAttribute as T; 28 | }); 29 | 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Sikiro.Nosql.Mongo/Extension/ReflectionExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Concurrent; 3 | using System.Reflection; 4 | 5 | namespace Sikiro.Nosql.Mongo.Extension 6 | { 7 | internal static class ReflectionExtension 8 | { 9 | private static readonly ConcurrentDictionary PropertiesDic = 10 | new ConcurrentDictionary(); 11 | 12 | /// 13 | /// 获取实体字段 14 | /// 15 | /// 16 | /// 17 | public static PropertyInfo[] GetEntityProperties(this Type type) 18 | { 19 | return PropertiesDic.GetOrAdd(type, item => type.GetProperties(BindingFlags.Instance | BindingFlags.Public)); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Sikiro.Nosql.Mongo/MongoHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using MongoDB.Bson; 4 | 5 | namespace Sikiro.Nosql.Mongo 6 | { 7 | public static class MongoHelper 8 | { 9 | /// 10 | /// 字符串ID转换成ObjectId 11 | /// 12 | /// 13 | /// 14 | public static ObjectId ToObjectId(this string id) 15 | { 16 | return string.IsNullOrEmpty(id) ? ObjectId.Empty : new ObjectId(id); 17 | } 18 | 19 | /// 20 | /// 字符串集合转换成objectId集合 21 | /// 22 | /// 23 | /// 24 | public static IEnumerable ToObjectIds(this IEnumerable ids) 25 | { 26 | return ids.Select(a => a.ToObjectId()); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Sikiro.Nosql.Mongo/Properties/PublishProfiles/FolderProfile.pubxml: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 7 | FileSystem 8 | Release 9 | Any CPU 10 | netcoreapp2.2 11 | bin\Debug\netcoreapp2.2\publish\ 12 | 13 | -------------------------------------------------------------------------------- /src/Sikiro.Nosql.Mongo/Sikiro.Nosql.Mongo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | github 9 | 10 | 陈珙 11 | 葛氏 12 | mongodb驱动封装 13 | 1.0.4.7 14 | 1.0.4.6 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/Sikiro.Nosql.Redis/Base/RedisENum.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Sikiro.Nosql.Redis.Base 4 | { 5 | public enum RedisItemType 6 | { 7 | None = 0, 8 | String = 1, 9 | List = 2, 10 | Set = 3, 11 | SortedSet = 4, 12 | Hash = 5, 13 | Unknown = 6, 14 | } 15 | 16 | public enum RedisSetOperation 17 | { 18 | Union, 19 | Intersect, 20 | Difference 21 | } 22 | 23 | public enum RedisAggregate 24 | { 25 | Sum, 26 | Min, 27 | Max 28 | } 29 | 30 | [Flags] 31 | public enum RedisExclude 32 | { 33 | None = 0, 34 | Start = 1, 35 | Stop = 2, 36 | Both = Start | Stop 37 | } 38 | 39 | public enum RedisOrder 40 | { 41 | Ascending, 42 | Descending 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Sikiro.Nosql.Redis/Sikiro.Nosql.Redis.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | StackExchange.Redis的基本封装 6 | 1.0.0.5 7 | 陈珙 8 | 葛氏 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/Sikiro.Tookits/Base/DropDownItem.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Tookits.Base 2 | { 3 | /// 4 | /// 下拉框元素 5 | /// 6 | public class DropDownItem 7 | { 8 | /// 9 | /// 枚举的描述 10 | /// 11 | public string Text { set; get; } 12 | 13 | /// 14 | /// 枚举对象的值 15 | /// 16 | public object Value { set; get; } 17 | 18 | /// 19 | /// 父ID 20 | /// 21 | public object ParentId { get; set; } 22 | 23 | /// 24 | /// 描述 25 | /// 26 | public string Description { get; set; } 27 | 28 | /// 29 | /// 提示 30 | /// 31 | public string Prompt { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Sikiro.Tookits/Base/Enum/ApiResultCode.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace Sikiro.Tookits.Base.Enum 4 | { 5 | public enum ApiResultCode 6 | { 7 | /// 8 | /// 请求成功 9 | /// 10 | [Description("请求成功")] 11 | Succeed = 200, 12 | 13 | /// 14 | /// 请求失败 15 | /// 16 | [Description("请求失败")] 17 | Failed = 400, 18 | 19 | /// 20 | /// 服务执行异常 21 | /// 22 | [Description("服务执行异常")] 23 | Error = 500 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Sikiro.Tookits/Base/Enum/ESort.cs: -------------------------------------------------------------------------------- 1 |  namespace Sikiro.Tookits.Base.Enum 2 | { 3 | public enum ESort 4 | { 5 | Asc = 1, 6 | Desc = -1 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Sikiro.Tookits/Base/Enum/ServiceResultCode.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace Sikiro.Tookits.Base.Enum 4 | { 5 | /// 6 | /// 服务层响应码枚举 7 | /// 8 | public enum ServiceResultCode 9 | { 10 | [Description("处理成功")] 11 | Succeed = 0, 12 | [Description("处理失败")] 13 | Failed = 1, 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Sikiro.Tookits/Base/PageListParams.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Tookits.Base 2 | { 3 | /// 4 | /// 分页参数 5 | /// 6 | public class PageListParams 7 | { 8 | private int? _limit; 9 | /// 10 | /// 页长 11 | /// 12 | public int Limit 13 | { 14 | set => _limit = value; 15 | get => _limit ?? 10; 16 | } 17 | 18 | private int? _page; 19 | /// 20 | /// 页码 21 | /// 22 | public int Page 23 | { 24 | set => _page = value; 25 | get => _page ?? 1; 26 | } 27 | } 28 | 29 | public class PageListParams : PageListParams where TParam : new() 30 | { 31 | public PageListParams() 32 | { 33 | Params = new TParam(); 34 | } 35 | 36 | /// 37 | /// 搜索参数 38 | /// 39 | public TParam Params { get; set; } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Sikiro.Tookits/Extension/EnumExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Concurrent; 3 | using System.ComponentModel; 4 | using System.Reflection; 5 | 6 | namespace Sikiro.Tookits.Extension 7 | { 8 | public static class EnumExtension 9 | { 10 | private static ConcurrentDictionary Cache = new ConcurrentDictionary(); 11 | 12 | /// 13 | /// 获取DescriptionAttribute 14 | /// 15 | /// 16 | /// 17 | public static string GetDescription(this Enum input) 18 | { 19 | var name = input.ToString(); 20 | 21 | var value = Cache.GetOrAdd(name, a => 22 | { 23 | var memInfo = input.GetType().GetMember(input.ToString()); 24 | var attribute = memInfo[0].GetCustomAttribute(); 25 | return attribute?.Description; 26 | }); 27 | 28 | return value; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Sikiro.Tookits/Extension/ExceptionExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Sikiro.Tookits.Helper; 3 | 4 | namespace Sikiro.Tookits.Extension 5 | { 6 | public static class ExceptionExtension 7 | { 8 | #region 获取最底层异常 9 | /// 10 | /// 获取最底层异常 11 | /// 12 | public static Exception GetDeepestException(this Exception ex) 13 | { 14 | var innerException = ex.InnerException; 15 | var resultExcpetion = ex; 16 | while (innerException != null) 17 | { 18 | resultExcpetion = innerException; 19 | innerException = innerException.InnerException; 20 | } 21 | return resultExcpetion; 22 | } 23 | #endregion 24 | 25 | #region 异常文本日志 26 | 27 | public static void WriteToFile(this Exception ex, string message) 28 | { 29 | LoggerHelper.WriteToFile(message, ex); 30 | } 31 | #endregion 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Sikiro.Tookits/Extension/HttpContextExtension.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using Microsoft.AspNetCore.Http; 3 | 4 | namespace Sikiro.Tookits.Extension 5 | { 6 | public static class HttpContextExtension 7 | { 8 | /// 9 | /// 获取客户端Ip 10 | /// 11 | /// 12 | /// 13 | public static string GetClientIp(this HttpRequest request) 14 | { 15 | var ip = request.Headers["X-Real-IP"].FirstOrDefault() ?? 16 | request.HttpContext.Connection.RemoteIpAddress.MapToIPv4().ToString(); 17 | return ip; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Sikiro.Tookits/Extension/HttpExtension.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | 3 | namespace Sikiro.Tookits.Extension 4 | { 5 | /// 6 | /// 7 | /// 8 | public static class HttpExtension 9 | { 10 | public static bool IsAjax(this HttpRequest req) 11 | { 12 | bool result = false; 13 | 14 | var xreq = req.Headers.ContainsKey("x-requested-with"); 15 | if (xreq) 16 | { 17 | result = req.Headers["x-requested-with"] == "XMLHttpRequest"; 18 | } 19 | 20 | return result; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Sikiro.Tookits/Extension/ReflectionExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Concurrent; 3 | using System.Reflection; 4 | 5 | namespace Sikiro.Tookits.Extension 6 | { 7 | public static class ReflectionExtension 8 | { 9 | private static readonly ConcurrentDictionary PropertiesDic = 10 | new ConcurrentDictionary(); 11 | 12 | /// 13 | /// 获取实体字段 14 | /// 15 | /// 16 | /// 17 | public static PropertyInfo[] GetEntityProperties(this Type type) 18 | { 19 | return PropertiesDic.GetOrAdd(type, item => type.GetProperties(BindingFlags.Instance | BindingFlags.Public)); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Sikiro.Tookits/Files/ExcelClientExtension.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | 3 | namespace Sikiro.Tookits.Files 4 | { 5 | public static class ExcelClientExtension 6 | { 7 | public static void AddExcelClient(this IServiceCollection services, string fileServerUrl) 8 | { 9 | services.AddHttpContextAccessor(); 10 | services.AddHttpClient(); 11 | services.AddSingleton(); 12 | services.AddSingleton(new ExcelOption { Url = fileServerUrl }); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Sikiro.Tookits/Files/ExcelNoMapAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Sikiro.Tookits.Files 4 | { 5 | /// 6 | /// 7 | /// 8 | public class ExcelNoMapAttribute : Attribute 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Sikiro.Tookits/Files/ExcelOption.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Tookits.Files 2 | { 3 | public class ExcelOption 4 | { 5 | public string Url { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/Sikiro.Tookits/Files/ImportEntity.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Tookits.Files 2 | { 3 | internal class ImportEntity 4 | { 5 | public string PropertyName { get; set; } 6 | 7 | public string DisplayName { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Sikiro.Tookits/Files/TookitsFilesException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Sikiro.Tookits.Files 4 | { 5 | /// 6 | /// 异常 7 | /// 8 | public class TookitsFilesException : ApplicationException 9 | { 10 | public TookitsFilesException(string msg) : base(msg) 11 | { 12 | 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Sikiro.Tookits/Helper/RandomHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Sikiro.Tookits.Helper 4 | { 5 | public static class RandomHelper 6 | { 7 | /// 8 | /// 随机数 9 | /// 10 | /// 11 | /// 12 | public static decimal RandomNext(int maxValue) 13 | { 14 | var rand = new Random(Guid.NewGuid().GetHashCode()); 15 | var result = rand.Next(maxValue); 16 | return result; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Sikiro.Tookits/Interfaces/IDepend.cs: -------------------------------------------------------------------------------- 1 | namespace Sikiro.Tookits.Interfaces 2 | { 3 | /// 4 | /// 注入依赖接口 5 | /// 6 | public interface IDepend 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Sikiro.Tookits/Snowflake/DisposableAction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Sikiro.Tookits.Snowflake 4 | { 5 | internal class DisposableAction : IDisposable 6 | { 7 | readonly Action _action; 8 | 9 | public DisposableAction(Action action) 10 | { 11 | if (action == null) 12 | throw new ArgumentNullException("action"); 13 | _action = action; 14 | } 15 | 16 | public void Dispose() 17 | { 18 | _action(); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /src/SkyApm.Diagnostics.AspNetCore/HttpContextDiagnosticStrings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the SkyAPM under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The SkyAPM licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | namespace SkyApm.AspNetCore.Diagnostics 20 | { 21 | internal static class HttpContextDiagnosticStrings 22 | { 23 | public const string SpanKey = "sw3-http"; 24 | } 25 | } -------------------------------------------------------------------------------- /src/SkyApm.Diagnostics.AspNetCore/Properties/PublishProfiles/FolderProfile.pubxml: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 7 | FileSystem 8 | Release 9 | Any CPU 10 | netstandard2.0 11 | bin\Debug\netstandard2.0\publish\ 12 | 13 | -------------------------------------------------------------------------------- /src/SkyApm.Diagnostics.HttpClient/Properties/PublishProfiles/FolderProfile.pubxml: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 7 | FileSystem 8 | Release 9 | Any CPU 10 | netstandard2.0 11 | bin\Debug\netstandard2.0\publish\ 12 | 13 | --------------------------------------------------------------------------------