Merge branch 'sqlsugar-dev' of https://gitee.com/ccnetcore/Yi into sqlsugar-dev

This commit is contained in:
橙子
2022-10-23 22:29:44 +08:00
107 changed files with 1702 additions and 370 deletions

Binary file not shown.

View File

@@ -4,62 +4,6 @@
<name>Yi.Framework.ApiMicroservice</name>
</assembly>
<members>
<member name="T:Yi.Framework.ApiMicroservice.Controllers.AccountController">
<summary>
账户管理
</summary>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.RestCC">
<summary>
重置管理员CC的密码
</summary>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.Login(Yi.Framework.DTOModel.LoginDto)">
<summary>
没啥说,登录
</summary>
<param name="loginDto"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.Register(Yi.Framework.DTOModel.RegisterDto)">
<summary>
没啥说,注册
</summary>
<param name="registerDto"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.Logout">
<summary>
没啥说,登出
</summary>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.GetUserAllInfo">
<summary>
通过已登录的用户获取用户信息
</summary>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.GetRouterInfo">
<summary>
获取当前登录用户的前端路由
</summary>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.UpdatePassword(Yi.Framework.DTOModel.UpdatePasswordDto)">
<summary>
自己更新密码
</summary>
<param name="dto"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.CaptchaImage">
<summary>
验证码
</summary>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ArticleController.PageList(Yi.Framework.Model.Models.ArticleEntity,Yi.Framework.Common.Models.PageParModel)">
<summary>
动态条件分页查询
@@ -206,6 +150,74 @@
<param name="ids"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.SkuController.PageList(Yi.Framework.Model.Models.SkuEntity,Yi.Framework.Common.Models.PageParModel)">
<summary>
动态条件分页查询
</summary>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.SpuController.PageList(Yi.Framework.Model.Models.SpuEntity,Yi.Framework.Common.Models.PageParModel)">
<summary>
动态条件分页查询
</summary>
<returns></returns>
</member>
<member name="T:Yi.Framework.ApiMicroservice.Controllers.AccountController">
<summary>
账户管理
</summary>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.RestCC">
<summary>
重置管理员CC的密码
</summary>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.Login(Yi.Framework.DTOModel.LoginDto)">
<summary>
没啥说,登录
</summary>
<param name="loginDto"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.Register(Yi.Framework.DTOModel.RegisterDto)">
<summary>
没啥说,注册
</summary>
<param name="registerDto"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.Logout">
<summary>
没啥说,登出
</summary>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.GetUserAllInfo">
<summary>
通过已登录的用户获取用户信息
</summary>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.GetRouterInfo">
<summary>
获取当前登录用户的前端路由
</summary>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.UpdatePassword(Yi.Framework.DTOModel.UpdatePasswordDto)">
<summary>
自己更新密码
</summary>
<param name="dto"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.CaptchaImage">
<summary>
验证码
</summary>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ConfigController.PageList(Yi.Framework.Model.Models.ConfigEntity,Yi.Framework.Common.Models.PageParModel)">
<summary>
动态条件分页查询
@@ -441,6 +453,70 @@
</summary>
<returns></returns>
</member>
<member name="T:Yi.Framework.ApiMicroservice.Controllers.UserController">
<summary>
用户管理
</summary>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.UserController.PageList(Yi.Framework.Model.Models.UserEntity,Yi.Framework.Common.Models.PageParModel,System.Nullable{System.Int64})">
<summary>
动态条件分页查询
</summary>
<param name="user"></param>
<param name="page"></param>
<param name="deptId"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.UserController.UpdateStatus(System.Int64,System.Boolean)">
<summary>
更改用户状态
</summary>
<param name="userId"></param>
<param name="isDel"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.UserController.GiveUserSetRole(Yi.Framework.DTOModel.GiveUserSetRoleDto)">
<summary>
给多用户设置多角色
</summary>
<param name="giveUserSetRoleDto"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.UserController.GetById(System.Int64)">
<summary>
通过用户id得到用户信息关联部门、岗位、角色
</summary>
<param name="id"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.UserController.Update(Yi.Framework.DTOModel.UserInfoDto)">
<summary>
更新用户信息
</summary>
<param name="userDto"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.UserController.UpdateProfile(Yi.Framework.DTOModel.UserInfoDto)">
<summary>
更新个人中心信息
</summary>
<param name="userDto"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.UserController.Add(Yi.Framework.DTOModel.UserInfoDto)">
<summary>
添加用户
</summary>
<param name="userDto"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.UserController.RestPassword(Yi.Framework.Model.Models.UserEntity)">
<summary>
重置密码
</summary>
<param name="user"></param>
<returns></returns>
</member>
<member name="T:Yi.Framework.ApiMicroservice.Controllers.TestController">
<summary>
测试控制器
@@ -562,69 +638,5 @@
</summary>
<returns></returns>
</member>
<member name="T:Yi.Framework.ApiMicroservice.Controllers.UserController">
<summary>
用户管理
</summary>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.UserController.PageList(Yi.Framework.Model.Models.UserEntity,Yi.Framework.Common.Models.PageParModel,System.Nullable{System.Int64})">
<summary>
动态条件分页查询
</summary>
<param name="user"></param>
<param name="page"></param>
<param name="deptId"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.UserController.UpdateStatus(System.Int64,System.Boolean)">
<summary>
更改用户状态
</summary>
<param name="userId"></param>
<param name="isDel"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.UserController.GiveUserSetRole(Yi.Framework.DTOModel.GiveUserSetRoleDto)">
<summary>
给多用户设置多角色
</summary>
<param name="giveUserSetRoleDto"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.UserController.GetById(System.Int64)">
<summary>
通过用户id得到用户信息关联部门、岗位、角色
</summary>
<param name="id"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.UserController.Update(Yi.Framework.DTOModel.UserInfoDto)">
<summary>
更新用户信息
</summary>
<param name="userDto"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.UserController.UpdateProfile(Yi.Framework.DTOModel.UserInfoDto)">
<summary>
更新个人中心信息
</summary>
<param name="userDto"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.UserController.Add(Yi.Framework.DTOModel.UserInfoDto)">
<summary>
添加用户
</summary>
<param name="userDto"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.UserController.RestPassword(Yi.Framework.Model.Models.UserEntity)">
<summary>
重置密码
</summary>
<param name="user"></param>
<returns></returns>
</member>
</members>
</doc>

View File

@@ -51,7 +51,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
{
//如果标题为空默认为内容的前20个字符
entity.Title = string.IsNullOrEmpty(entity.Title) ?
(entity.Content.Length > 20 ? entity.Content.Substring(0, 20) : entity.Content) :
(entity.Content?.Length > 20 ? entity.Content.Substring(0, 20) : entity.Content) :
entity.Title;
entity.UserId = HttpContext.GetUserIdInfo();
return base.Add(entity);

View File

@@ -0,0 +1,28 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Yi.Framework.Common.Models;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
using Yi.Framework.WebCore;
using Yi.Framework.WebCore.AttributeExtend;
using Yi.Framework.WebCore.AuthorizationPolicy;
namespace Yi.Framework.ApiMicroservice.Controllers
{
[ApiController]
[Route("api/[controller]/[action]")]
public class CategoryController : BaseCrudController<CategoryEntity>
{
private ICategoryService _iCategoryService;
public CategoryController(ILogger<CategoryEntity> logger, ICategoryService iCategoryService) : base(logger, iCategoryService)
{
_iCategoryService = iCategoryService;
}
}
}

View File

@@ -0,0 +1,114 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Yi.Framework.Common.Enum;
using Yi.Framework.Common.Models;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
using Yi.Framework.WebCore;
using Yi.Framework.WebCore.AttributeExtend;
using Yi.Framework.WebCore.AuthorizationPolicy;
namespace Yi.Framework.ApiMicroservice.Controllers
{
[ApiController]
[Route("api/[controller]/[action]")]
public class SkuController : BaseSimpleCrudController<SkuEntity>
{
private ISkuService _iSkuService;
public SkuController(ILogger<SkuEntity> logger, ISkuService iSkuService) : base(logger, iSkuService)
{
_iSkuService = iSkuService;
}
/// <summary>
/// 动态条件分页查询
/// </summary>
/// <returns></returns>
[HttpGet]
public async Task<Result> PageList([FromQuery] SkuEntity eneity, [FromQuery] PageParModel page)
{
return Result.Success().SetData(await _iSkuService.SelctPageList(eneity, page));
}
//数据测试
[HttpGet]
public async Task<Result> Test(OperEnum operEnum)
{
switch (operEnum)
{
case OperEnum.Insert:
List<SkuEntity> spus = new();
var sku1 = new SkuEntity()
{
Id = 1,
Stock = 100,
IsDeleted = false,
SpuId = 1,
Price = 1000,
SpecsSkuAllInfo = new List<SpecsSkuAllInfoModel> {
new SpecsSkuAllInfoModel { SpecsGroupName="内存",SpecsName="1GB" } ,
new SpecsSkuAllInfoModel { SpecsGroupName="颜色",SpecsName= "红" } },
};
var sku2 = new SkuEntity()
{
Id = 2,
Stock = 100,
IsDeleted = false,
SpuId = 1,
Price = 4000,
SpecsSkuAllInfo = new List<SpecsSkuAllInfoModel> {
new SpecsSkuAllInfoModel { SpecsGroupName="内存",SpecsName="2GB" } ,
new SpecsSkuAllInfoModel { SpecsGroupName="颜色",SpecsName= "绿" } },
};
var sku3 = new SkuEntity()
{
Id = 3,
Stock = 100,
IsDeleted = false,
SpuId = 2,
Price = 2000,
SpecsSkuAllInfo = new List<SpecsSkuAllInfoModel> {
new SpecsSkuAllInfoModel { SpecsGroupName="内存",SpecsName="3GB" } ,
new SpecsSkuAllInfoModel { SpecsGroupName="颜色",SpecsName= "红" } },
};
var sku4 = new SkuEntity()
{
Id = 4,
Stock = 100,
IsDeleted = false,
SpuId = 2,
Price = 1000,
SpecsSkuAllInfo = new List<SpecsSkuAllInfoModel> {
new SpecsSkuAllInfoModel { SpecsGroupName="内存",SpecsName="2GB" } ,
new SpecsSkuAllInfoModel { SpecsGroupName="颜色",SpecsName= "蓝" } },
};
spus.Add(sku1);
spus.Add(sku2);
spus.Add(sku3);
spus.Add(sku4);
await _iSkuService._repository.InsertRangeAsync(spus);
break;
case OperEnum.Delete:
await _iSkuService._repository.DeleteAsync((u)=>true);
break;
default:
break;
}
return Result.Success();
}
}
}

View File

@@ -0,0 +1,28 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Yi.Framework.Common.Models;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
using Yi.Framework.WebCore;
using Yi.Framework.WebCore.AttributeExtend;
using Yi.Framework.WebCore.AuthorizationPolicy;
namespace Yi.Framework.ApiMicroservice.Controllers
{
[ApiController]
[Route("api/[controller]/[action]")]
public class SpecsController : BaseCrudController<SpecsEntity>
{
private ISpecsService _iSpecsService;
public SpecsController(ILogger<SpecsEntity> logger, ISpecsService iSpecsService) : base(logger, iSpecsService)
{
_iSpecsService = iSpecsService;
}
}
}

View File

@@ -0,0 +1,28 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Yi.Framework.Common.Models;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
using Yi.Framework.WebCore;
using Yi.Framework.WebCore.AttributeExtend;
using Yi.Framework.WebCore.AuthorizationPolicy;
namespace Yi.Framework.ApiMicroservice.Controllers
{
[ApiController]
[Route("api/[controller]/[action]")]
public class SpecsGroupController : BaseCrudController<SpecsGroupEntity>
{
private ISpecsGroupService _iSpecsGroupService;
public SpecsGroupController(ILogger<SpecsGroupEntity> logger, ISpecsGroupService iSpecsGroupService) : base(logger, iSpecsGroupService)
{
_iSpecsGroupService = iSpecsGroupService;
}
}
}

View File

@@ -0,0 +1,88 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Yi.Framework.Common.Enum;
using Yi.Framework.Common.Models;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
using Yi.Framework.WebCore;
using Yi.Framework.WebCore.AttributeExtend;
using Yi.Framework.WebCore.AuthorizationPolicy;
namespace Yi.Framework.ApiMicroservice.Controllers
{
[ApiController]
[Route("api/[controller]/[action]")]
public class SpuController : BaseSimpleCrudController<SpuEntity>
{
private ISpuService _iSpuService;
public SpuController(ILogger<SpuEntity> logger, ISpuService iSpuService) : base(logger, iSpuService)
{
_iSpuService = iSpuService;
}
/// <summary>
/// 动态条件分页查询
/// </summary>
/// <returns></returns>
[HttpGet]
public async Task<Result> PageList([FromQuery] SpuEntity eneity, [FromQuery] PageParModel page)
{
return Result.Success().SetData(await _iSpuService.SelctPageList(eneity, page));
}
//数据测试
[HttpGet]
public async Task<Result> Test(OperEnum operEnum)
{
switch (operEnum)
{
case OperEnum.Insert:
List<SpuEntity> spus = new();
var spu1 = new SpuEntity()
{
Id = 1,
SpuName = "华为mate40 5G手机",
IsDeleted = false,
Details = "华为手机就是牛",
Price = "1000-2000",
SpecsSpuAllInfo = new List<SpecsSpuAllInfoModel> {
new SpecsSpuAllInfoModel { SpecsGroupName="内存",SpecsNames=new List<string> { "1GB","2GB","3GB"} } ,
new SpecsSpuAllInfoModel { SpecsGroupName="颜色",SpecsNames=new List<string> { "红","蓝","绿"} } },
};
var spu2 = new SpuEntity()
{
Id = 2,
SpuName = "小米888 8G手机",
IsDeleted = false,
Details = "小米手机就是牛",
Price = "2000-3000",
SpecsSpuAllInfo = new List<SpecsSpuAllInfoModel> {
new SpecsSpuAllInfoModel { SpecsGroupName="内存",SpecsNames=new List<string> { "1GB","2GB","3GB"} } ,
new SpecsSpuAllInfoModel { SpecsGroupName="颜色",SpecsNames=new List<string> { "红","蓝","绿"} } },
};
spus.Add(spu1);
spus.Add(spu2);
await _iSpuService._repository.InsertRangeAsync(spus);
break;
case OperEnum.Delete:
await _iSpuService._repository.DeleteAsync((u) => true);
break;
default:
break;
}
return Result.Success();
}
}
}

View File

@@ -272,7 +272,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
public Result SeedDb()
{
var rep = _iUserService._repository;
return Result.Success().SetStatus(DbSeedExtend.Invoer(rep._Db));
return Result.Success().SetStatus(DbSeedExtend.DataInvoer(rep._Db));
}
/// <summary>

View File

@@ -139,9 +139,14 @@ builder.Services.AddHeiCaptcha();
#endregion
builder.Services.AddHttpContextAccessor();
#region
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>System.Drawing<6E><67>linu<6E><75>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>
#endregion
builder.Services.AddSingleton<ThumbnailSharpInvoer>();
#region
//ȫ<><C8AB><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD>ʼ<EFBFBD><CABC>ֵ
#endregion
GobalModel.SqlLogEnable = Appsettings.appBool("SqlLog_Enable");
//-----------------------------------------------------------------------------------------------------------
var app = builder.Build();
#region
@@ -154,9 +159,6 @@ ServiceLocator.Instance = app.Services;
//<2F><><EFBFBD><EFBFBD>ҳ<EFBFBD><D2B3>ע<EFBFBD><D7A2>
#endregion
app.UseDeveloperExceptionPage();
#region
//Swagger<65><72><EFBFBD><EFBFBD>ע<EFBFBD><D7A2>
#endregion
app.UseSwaggerService();
}
#region

View File

@@ -2,8 +2,8 @@
"profiles": {
"Yi.Framework.ApiMicroservice": {
"commandName": "Project",
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˸о<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>عرȽ<EFBFBD><EFBFBD>
"launchBrowser": false,
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},

View File

@@ -43,9 +43,6 @@
<None Update="public.pem">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="yi-sqlsugar-dev.db">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View File

@@ -1,5 +1,5 @@
{
"StartUrl": "http://localohost:19001",
"StartUrl": "http://*:19001",
"Logging": {
"LogLevel": {
"Default": "Information",
@@ -9,11 +9,16 @@
},
"AllowedHosts": "*",
"SqlLog_Enable": false,
"Consul_Enabled": false,
"DbCodeFirst_Enabled": false,
"DbSeed_Enabled": false,
"Apollo_Enabled": false,
"HealthCheck_Enabled": false,
"RabbitMQ_Enabled": false,
"Redis_Enabled": false,
"RedisSeed_Enabled": false,
"Kafka_Enabled": false,
"ElasticSeach_Enabled": false,
"MutiDB_Enabled": false,
@@ -21,19 +26,16 @@
"CAP_Enabled": false,
"CAPDashboard_Enabled": false,
"DbSeed_Enabled": true,
"RedisSeed_Enabled": false,
"Cors_Enabled": true,
"DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ],
"DbSelect": "Sqlite",
"DbConn": {
"WriteUrl": "DataSource=yi-sqlsugar-dev.db",
//"WriteUrl": "server=119.91.207.67;port=3306;database=yi-sqlsugar-dev;user id=root;password=Qz52013142020.",
//"WriteUrl": "[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]",
"ReadUrl": [
"server=119.91.207.67;port=3306;database=yi-sqlsugar-dev;user id=root;password=Qz52013142020.",
"server=119.91.207.67;port=3306;database=yi-sqlsugar-dev;user id=root;password=Qz52013142020.",
"server=119.91.207.67;port=3306;database=yi-sqlsugar-dev;user id=root;password=Qz52013142020."
"server=[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]",
"server=[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]",
"server=[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]"
]
},
"JwtAuthorize": {
@@ -42,39 +44,39 @@
"PolicyName": "permission",
"DefaultScheme": "Bearer",
"IsHttps": false,
"Expiration": 30,
"Expiration": 300,
"ReExpiration": 3000
},
"RedisConnOptions": {
"Host": "118.195.191.41",
"Host": "[xxxx]",
"Prot": 6379,
"DB": 1,
"Password": "Qz52013142020."
"Password": "[xxxx]"
},
"RabbitConn": {
"HostName": "118.195.191.41",
"UserName": "cc",
"Password": "cc",
"HostName": "[xxxx]",
"UserName": "[xxxx]",
"Password": "[xxxx]",
"Port": 5672
},
"ElasticSeachConn": {
"Url": "https://es-4zakkyyn.public.tencentelasticsearch.com:9200",
"IndexName": "yies",
"UserName": "elastic",
"PassWord": "Qz52013142020."
"Url": "[xxxx]",
"IndexName": "[xxxx]",
"UserName": "[xxxx]",
"PassWord": "[xxxx]"
},
"KafkaOptions": {
"BrokerList": "192.168.3.230:9092",
"TopicName": "kafkalog"
"BrokerList": "[xxxx]",
"TopicName": "[xxxx]"
},
"ConsulClientOption": {
"IP": "118.195.191.41",
"Port": "8500",
"Datacenter": "dc1"
"IP": "[xxxx]",
"Port": "[xxxx]",
"Datacenter": "[xxxx]"
},
"ConsulRegisterOption": {
"IP": "118.195.191.41",
"Port": "19005",
"IP": "[xxxx]",
"Port": "19001",
"GroupName": "ApiMicroservice",
"HealthCheckUrl": "/Health",
"Interval": 10,
@@ -83,10 +85,10 @@
"Tag": "13"
},
"SMS": {
"ID": "LTAI5tJvjPaXCyyPMfXLNbVA",
"Secret": "fLQv7jjj57fUKLFK8REeAQPFVDjUYn",
"Sign": "JiftCC",
"Template": "SMS_221640732"
"ID": "[xxxx]",
"Secret": "[xxxx]",
"Sign": "[xxxx]",
"Template": "[xxxx]"
},
"IPLibraryServiceUrl": "http://gRPCIPLibraryService"
}

View File

@@ -9,7 +9,10 @@
},
"AllowedHosts": "*",
"SqlLog_Enable": false,
"Consul_Enabled": false,
"DbCodeFirst_Enabled": false,
"DbSeed_Enabled": false,
"Apollo_Enabled": false,
"HealthCheck_Enabled": false,
@@ -25,23 +28,24 @@
"Cors_Enabled": true,
"DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ],
"DbSelect": "Mysql",
"Pan": {
"ZipPath": "D:/AppWeb/test/zip"
},
"DbSelect": "Sqlite",
"DbConn": {
"WriteUrl": "server=[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]",
"WriteUrl": "DataSource=yi-sqlsugar-dev.db",
//"WriteUrl": "[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]",
"ReadUrl": [
"server=[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]",
"server=[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]",
"server=[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]"
]
},
"JWTTokenOptions": {
"Audience": "http://localhost:7000",
"Issuer": "http://localhost:7000",
"SecurityKey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDI2a2EJ7m872v0afyoSDJT2o1+SitIeJSWtLJU8/Wz2m7gStexajkeD+Lka6DSTy8gt9UwfgVQo6uKjVLG5Ex7PiGOODVqAEghBuS7JzIYU5RvI543nNDAPfnJsas96mSA7L/mD7RTE2drj6hf3oZjJpMPZUQI/B1Qjb5H3K3PNwIDAQAB"
"JwtAuthorize": {
"Issuer": "cc",
"Audience": "cc",
"PolicyName": "permission",
"DefaultScheme": "Bearer",
"IsHttps": false,
"Expiration": 300,
"ReExpiration": 3000
},
"RedisConnOptions": {
"Host": "[xxxx]",

View File

@@ -9,8 +9,11 @@
},
"AllowedHosts": "*",
"SqlLog_Enable": false,
"Consul_Enabled": false,
"DbSeed_Enabled": false,
"DbCodeFirst_Enabled": true,
"DbSeed_Enabled": true,
"Apollo_Enabled": false,
"HealthCheck_Enabled": false,
"RabbitMQ_Enabled": false,

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.Common.Models
{
public static class GobalModel
{
public static bool SqlLogEnable { get; set; } = true;
}
}

View File

@@ -28,7 +28,7 @@ namespace Yi.Framework.Common.QueueModel
/// 尝试次数
/// </summary>
public int TryTime { get; set; }
public OrderTypeEnum OrderType { get; set; }
public enum OrderTypeEnum

View File

@@ -0,0 +1,9 @@
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Interface
{
public partial interface ICategoryService:IBaseService<CategoryEntity>
{
}
}

View File

@@ -0,0 +1,9 @@
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Interface
{
public partial interface ISkuService:IBaseService<SkuEntity>
{
}
}

View File

@@ -0,0 +1,9 @@
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Interface
{
public partial interface ISpecsGroupService:IBaseService<SpecsGroupEntity>
{
}
}

View File

@@ -0,0 +1,9 @@
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Interface
{
public partial interface ISpecsService:IBaseService<SpecsEntity>
{
}
}

View File

@@ -0,0 +1,9 @@
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Interface
{
public partial interface ISpuService:IBaseService<SpuEntity>
{
}
}

View File

@@ -0,0 +1,19 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Yi.Framework.Common.Models;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Interface
{
public partial interface ISkuService:IBaseService<SkuEntity>
{
/// <summary>
/// 动态条件分页查询
/// </summary>
/// <param name="eneity"></param>
/// <param name="page"></param>
/// <returns></returns>
Task<PageModel<List<SkuEntity>>> SelctPageList(SkuEntity entity, PageParModel page);
}
}

View File

@@ -0,0 +1,19 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Yi.Framework.Common.Models;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Interface
{
public partial interface ISpuService:IBaseService<SpuEntity>
{
/// <summary>
/// 动态条件分页查询
/// </summary>
/// <param name="eneity"></param>
/// <param name="page"></param>
/// <returns></returns>
Task<PageModel<List<SpuEntity>>> SelctPageList(SpuEntity entity, PageParModel page);
}
}

View File

@@ -8,6 +8,6 @@ namespace Yi.Framework.Model.Models
public partial class ArticleEntity:IBaseModelEntity
{
[Navigate(NavigateType.OneToOne,nameof(UserId))]
public UserEntity User { get; set; }
public UserEntity? User { get; set; }
}
}

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using SqlSugar;
namespace Yi.Framework.Model.Models
{
/// <summary>
/// 商品分类表
///</summary>
public partial class CategoryEntity:IBaseModelEntity
{
[SugarColumn(IsIgnore = true)]
public List<CategoryEntity>? Children { get; set; }
[Navigate(NavigateType.OneToMany,nameof(SpecsGroupEntity.CategoryId))]
public List<SpecsGroupEntity>? SpecsGroups { get; set; }
}
}

View File

@@ -25,14 +25,14 @@ namespace Yi.Framework.Model.Models
var r = new VueRouterModel();
r.OrderNum = m.OrderNum ?? 0;
var routerName = m.Router.Split("/").LastOrDefault();
var routerName = m.Router?.Split("/").LastOrDefault();
r.Id = m.Id;
r.ParentId = (long)m.ParentId;
r.ParentId = m.ParentId??-1;
//开头大写
r.Name = routerName.First().ToString().ToUpper() + routerName.Substring(1);
r.Name = routerName?.First().ToString().ToUpper() + routerName?.Substring(1);
r.Path = m.Router;
r.Hidden = (bool)!m.IsShow;
r.Hidden =!m.IsShow??false;
if (m.MenuType == MenuTypeEnum.Catalogue.GetHashCode())
@@ -62,9 +62,9 @@ namespace Yi.Framework.Model.Models
{
Title = m.MenuName,
Icon = m.MenuIcon,
NoCache = (bool)!m.IsCache
NoCache = !m.IsCache??true
};
if ((bool)m.IsLink)
if (m.IsLink??false)
{
r.Meta.link = m.Router;
r.AlwaysShow = false;

View File

@@ -22,12 +22,12 @@ namespace Yi.Framework.Model.Models
/// 文章标题
///</summary>
[SugarColumn(ColumnName="Title" )]
public string Title { get; set; }
public string? Title { get; set; }
/// <summary>
/// 文章内容
///</summary>
[SugarColumn(ColumnName="Content" )]
public string Content { get; set; }
public string? Content { get; set; }
/// <summary>
/// 用户id
///</summary>
@@ -72,11 +72,11 @@ namespace Yi.Framework.Model.Models
/// 描述
///</summary>
[SugarColumn(ColumnName="Remark" )]
public string Remark { get; set; }
public string? Remark { get; set; }
/// <summary>
/// 图片列表
///</summary>
[SugarColumn(ColumnName="Images",IsJson = true)]
public List<string> Images { get; set; }
public List<string>? Images { get; set; }
}
}

View File

@@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using SqlSugar;
namespace Yi.Framework.Model.Models
{
/// <summary>
/// 商品分类表
///</summary>
[SugarTable("Category")]
public partial class CategoryEntity:IBaseModelEntity
{
public CategoryEntity()
{
this.CreateTime = DateTime.Now;
}
[JsonConverter(typeof(ValueToStringConverter))]
[SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
public long Id { get; set; }
/// <summary>
/// 父级id
///</summary>
[SugarColumn(ColumnName="ParentId" )]
public long? ParentId { get; set; }
/// <summary>
/// 分类名称
///</summary>
[SugarColumn(ColumnName="CategoryName" )]
public string CategoryName { get; set; }
/// <summary>
/// 创建者
///</summary>
[SugarColumn(ColumnName="CreateUser" )]
public long? CreateUser { get; set; }
/// <summary>
/// 创建时间
///</summary>
[SugarColumn(ColumnName="CreateTime" )]
public DateTime? CreateTime { get; set; }
/// <summary>
/// 修改者
///</summary>
[SugarColumn(ColumnName="ModifyUser" )]
public long? ModifyUser { get; set; }
/// <summary>
/// 修改时间
///</summary>
[SugarColumn(ColumnName="ModifyTime" )]
public DateTime? ModifyTime { get; set; }
/// <summary>
/// 是否删除
///</summary>
[SugarColumn(ColumnName="IsDeleted" )]
public bool? IsDeleted { get; set; }
/// <summary>
/// 租户Id
///</summary>
[SugarColumn(ColumnName="TenantId" )]
public long? TenantId { get; set; }
/// <summary>
/// 排序字段
///</summary>
[SugarColumn(ColumnName="OrderNum" )]
public int? OrderNum { get; set; }
/// <summary>
/// 描述
///</summary>
[SugarColumn(ColumnName="Remark" )]
public string? Remark { get; set; }
}
}

View File

@@ -22,22 +22,22 @@ namespace Yi.Framework.Model.Models
/// 配置名称
///</summary>
[SugarColumn(ColumnName="ConfigName" )]
public string ConfigName { get; set; }
public string? ConfigName { get; set; }
/// <summary>
/// 配置键
///</summary>
[SugarColumn(ColumnName="ConfigKey" )]
public string ConfigKey { get; set; }
public string? ConfigKey { get; set; }
/// <summary>
/// 配置值
///</summary>
[SugarColumn(ColumnName="ConfigValue" )]
public string ConfigValue { get; set; }
public string? ConfigValue { get; set; }
/// <summary>
/// 配置类别
///</summary>
[SugarColumn(ColumnName="ConfigType" )]
public string ConfigType { get; set; }
public string? ConfigType { get; set; }
/// <summary>
/// 创建者
///</summary>
@@ -77,6 +77,6 @@ namespace Yi.Framework.Model.Models
/// 描述
///</summary>
[SugarColumn(ColumnName="Remark" )]
public string Remark { get; set; }
public string? Remark { get; set; }
}
}

View File

@@ -22,17 +22,17 @@ namespace Yi.Framework.Model.Models
/// 部门名称
///</summary>
[SugarColumn(ColumnName="DeptName" )]
public string DeptName { get; set; }
public string? DeptName { get; set; }
/// <summary>
/// 部门编码
///</summary>
[SugarColumn(ColumnName="DeptCode" )]
public string DeptCode { get; set; }
public string? DeptCode { get; set; }
/// <summary>
/// 负责人
///</summary>
[SugarColumn(ColumnName="Leader" )]
public string Leader { get; set; }
public string? Leader { get; set; }
/// <summary>
/// 父级id
///</summary>
@@ -77,6 +77,6 @@ namespace Yi.Framework.Model.Models
/// 描述
///</summary>
[SugarColumn(ColumnName="Remark" )]
public string Remark { get; set; }
public string? Remark { get; set; }
}
}

View File

@@ -22,12 +22,12 @@ namespace Yi.Framework.Model.Models
/// 字典名称
///</summary>
[SugarColumn(ColumnName="DictName" )]
public string DictName { get; set; }
public string? DictName { get; set; }
/// <summary>
/// 字典类型
///</summary>
[SugarColumn(ColumnName="DictType" )]
public string DictType { get; set; }
public string? DictType { get; set; }
/// <summary>
/// 创建者
///</summary>
@@ -67,6 +67,6 @@ namespace Yi.Framework.Model.Models
/// 描述
///</summary>
[SugarColumn(ColumnName="Remark" )]
public string Remark { get; set; }
public string? Remark { get; set; }
}
}

View File

@@ -22,17 +22,17 @@ namespace Yi.Framework.Model.Models
/// 字典类型
///</summary>
[SugarColumn(ColumnName="DictType" )]
public string DictType { get; set; }
public string? DictType { get; set; }
/// <summary>
/// 字典标签
///</summary>
[SugarColumn(ColumnName="DictLabel" )]
public string DictLabel { get; set; }
public string? DictLabel { get; set; }
/// <summary>
/// 字典值
///</summary>
[SugarColumn(ColumnName="DictValue" )]
public string DictValue { get; set; }
public string? DictValue { get; set; }
/// <summary>
/// 是否为该类型的默认值
///</summary>
@@ -77,16 +77,16 @@ namespace Yi.Framework.Model.Models
/// 描述
///</summary>
[SugarColumn(ColumnName="Remark" )]
public string Remark { get; set; }
public string? Remark { get; set; }
/// <summary>
/// tag类型
///</summary>
[SugarColumn(ColumnName="ListClass" )]
public string ListClass { get; set; }
public string? ListClass { get; set; }
/// <summary>
/// tagClass
///</summary>
[SugarColumn(ColumnName="CssClass" )]
public string CssClass { get; set; }
public string? CssClass { get; set; }
}
}

View File

@@ -22,7 +22,7 @@ namespace Yi.Framework.Model.Models
/// 文件类型
///</summary>
[SugarColumn(ColumnName="FileType" )]
public string FileType { get; set; }
public string? FileType { get; set; }
/// <summary>
/// 文件大小
///</summary>
@@ -32,12 +32,12 @@ namespace Yi.Framework.Model.Models
/// 文件名
///</summary>
[SugarColumn(ColumnName="FileName" )]
public string FileName { get; set; }
public string? FileName { get; set; }
/// <summary>
/// 文件路径
///</summary>
[SugarColumn(ColumnName="FilePath" )]
public string FilePath { get; set; }
public string? FilePath { get; set; }
/// <summary>
/// 创建者
///</summary>
@@ -77,6 +77,6 @@ namespace Yi.Framework.Model.Models
/// 描述
///</summary>
[SugarColumn(ColumnName="Remark" )]
public string Remark { get; set; }
public string? Remark { get; set; }
}
}

View File

@@ -43,7 +43,7 @@ namespace Yi.Framework.Model.Models
/// 消息
///</summary>
[SugarColumn(ColumnName="Message" )]
public string Message { get; set; }
public string? Message { get; set; }
/// <summary>
/// 排序字段
///</summary>
@@ -53,6 +53,6 @@ namespace Yi.Framework.Model.Models
/// 描述
///</summary>
[SugarColumn(ColumnName="Remark" )]
public string Remark { get; set; }
public string? Remark { get; set; }
}
}

View File

@@ -22,32 +22,32 @@ namespace Yi.Framework.Model.Models
/// 登录用户
///</summary>
[SugarColumn(ColumnName="LoginUser" )]
public string LoginUser { get; set; }
public string? LoginUser { get; set; }
/// <summary>
/// 登录地点
///</summary>
[SugarColumn(ColumnName="LoginLocation" )]
public string LoginLocation { get; set; }
public string? LoginLocation { get; set; }
/// <summary>
/// 登录Ip
///</summary>
[SugarColumn(ColumnName="LoginIp" )]
public string LoginIp { get; set; }
public string? LoginIp { get; set; }
/// <summary>
/// 浏览器
///</summary>
[SugarColumn(ColumnName="Browser" )]
public string Browser { get; set; }
public string? Browser { get; set; }
/// <summary>
/// 操作系统
///</summary>
[SugarColumn(ColumnName="Os" )]
public string Os { get; set; }
public string? Os { get; set; }
/// <summary>
/// 登录信息
///</summary>
[SugarColumn(ColumnName="LogMsg" )]
public string LogMsg { get; set; }
public string? LogMsg { get; set; }
/// <summary>
/// 创建者
///</summary>
@@ -82,7 +82,7 @@ namespace Yi.Framework.Model.Models
/// 描述
///</summary>
[SugarColumn(ColumnName="Remark" )]
public string Remark { get; set; }
public string? Remark { get; set; }
/// <summary>
/// 是否删除
///</summary>

View File

@@ -23,7 +23,7 @@ namespace Yi.Framework.Model.Models
///
///</summary>
[SugarColumn(ColumnName="MenuName" )]
public string MenuName { get; set; }
public string? MenuName { get; set; }
/// <summary>
///
///</summary>
@@ -33,7 +33,7 @@ namespace Yi.Framework.Model.Models
///
///</summary>
[SugarColumn(ColumnName="PermissionCode" )]
public string PermissionCode { get; set; }
public string? PermissionCode { get; set; }
/// <summary>
///
///</summary>
@@ -73,12 +73,12 @@ namespace Yi.Framework.Model.Models
/// 菜单图标
///</summary>
[SugarColumn(ColumnName="MenuIcon" )]
public string MenuIcon { get; set; }
public string? MenuIcon { get; set; }
/// <summary>
/// 菜单组件路由
///</summary>
[SugarColumn(ColumnName="Router" )]
public string Router { get; set; }
public string? Router { get; set; }
/// <summary>
/// 是否为外部链接
///</summary>
@@ -103,16 +103,16 @@ namespace Yi.Framework.Model.Models
/// 描述
///</summary>
[SugarColumn(ColumnName="Remark" )]
public string Remark { get; set; }
public string? Remark { get; set; }
/// <summary>
/// 组件路径
///</summary>
[SugarColumn(ColumnName="Component" )]
public string Component { get; set; }
public string? Component { get; set; }
/// <summary>
/// 路由参数
///</summary>
[SugarColumn(ColumnName="Query" )]
public string Query { get; set; }
public string? Query { get; set; }
}
}

View File

@@ -22,7 +22,7 @@ namespace Yi.Framework.Model.Models
/// 操作模块
///</summary>
[SugarColumn(ColumnName="Title" )]
public string Title { get; set; }
public string? Title { get; set; }
/// <summary>
/// 操作类型
///</summary>
@@ -32,7 +32,7 @@ namespace Yi.Framework.Model.Models
/// 请求方法
///</summary>
[SugarColumn(ColumnName="RequestMethod" )]
public string RequestMethod { get; set; }
public string? RequestMethod { get; set; }
/// <summary>
/// 操作人员
///</summary>
@@ -42,27 +42,27 @@ namespace Yi.Framework.Model.Models
/// 操作Ip
///</summary>
[SugarColumn(ColumnName="OperIp" )]
public string OperIp { get; set; }
public string? OperIp { get; set; }
/// <summary>
/// 操作地点
///</summary>
[SugarColumn(ColumnName="OperLocation" )]
public string OperLocation { get; set; }
public string? OperLocation { get; set; }
/// <summary>
/// 操作方法
///</summary>
[SugarColumn(ColumnName="Method" )]
public string Method { get; set; }
public string? Method { get; set; }
/// <summary>
/// 请求参数
///</summary>
[SugarColumn(ColumnName="RequestParam" )]
public string RequestParam { get; set; }
public string? RequestParam { get; set; }
/// <summary>
/// 请求结果
///</summary>
[SugarColumn(ColumnName="RequestResult" )]
public string RequestResult { get; set; }
public string? RequestResult { get; set; }
/// <summary>
/// 创建者
///</summary>
@@ -97,7 +97,7 @@ namespace Yi.Framework.Model.Models
/// 描述
///</summary>
[SugarColumn(ColumnName="Remark" )]
public string Remark { get; set; }
public string? Remark { get; set; }
/// <summary>
/// 是否删除
///</summary>

View File

@@ -22,12 +22,12 @@ namespace Yi.Framework.Model.Models
/// 岗位编码
///</summary>
[SugarColumn(ColumnName="PostCode" )]
public string PostCode { get; set; }
public string? PostCode { get; set; }
/// <summary>
/// 岗位名称
///</summary>
[SugarColumn(ColumnName="PostName" )]
public string PostName { get; set; }
public string? PostName { get; set; }
/// <summary>
/// 创建者
///</summary>
@@ -67,6 +67,6 @@ namespace Yi.Framework.Model.Models
/// 描述
///</summary>
[SugarColumn(ColumnName="Remark" )]
public string Remark { get; set; }
public string? Remark { get; set; }
}
}

View File

@@ -67,6 +67,6 @@ namespace Yi.Framework.Model.Models
/// 描述
///</summary>
[SugarColumn(ColumnName="Remark" )]
public string Remark { get; set; }
public string? Remark { get; set; }
}
}

View File

@@ -9,20 +9,20 @@ namespace Yi.Framework.Model.Models
/// 角色表
///</summary>
[SugarTable("Role")]
public partial class RoleEntity:IBaseModelEntity
public partial class RoleEntity : IBaseModelEntity
{
public RoleEntity()
{
this.CreateTime = DateTime.Now;
}
[JsonConverter(typeof(ValueToStringConverter))]
[SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
public long Id { get; set; }
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public long Id { get; set; }
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="RoleName" )]
public string RoleName { get; set; }
[SugarColumn(ColumnName = "RoleName")]
public string? RoleName { get; set; }
/// <summary>
/// 创建者
///</summary>
@@ -57,7 +57,7 @@ namespace Yi.Framework.Model.Models
/// 角色编码
///</summary>
[SugarColumn(ColumnName="RoleCode" )]
public string RoleCode { get; set; }
public string? RoleCode { get; set; }
/// <summary>
/// 排序字段
///</summary>
@@ -67,7 +67,7 @@ namespace Yi.Framework.Model.Models
/// 描述
///</summary>
[SugarColumn(ColumnName="Remark" )]
public string Remark { get; set; }
public string? Remark { get; set; }
/// <summary>
/// 角色数据范围
///</summary>

View File

@@ -0,0 +1,78 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using SqlSugar;
namespace Yi.Framework.Model.Models
{
/// <summary>
/// Sku表
///</summary>
[SugarTable("Sku")]
public partial class SkuEntity:IBaseModelEntity
{
public SkuEntity()
{
this.CreateTime = DateTime.Now;
}
[JsonConverter(typeof(ValueToStringConverter))]
[SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
public long Id { get; set; }
/// <summary>
/// SpuId
///</summary>
[SugarColumn(ColumnName="SpuId" )]
public long? SpuId { get; set; }
/// <summary>
/// 库存
///</summary>
[SugarColumn(ColumnName="Stock" )]
public int? Stock { get; set; }
/// <summary>
/// 价格
///</summary>
[SugarColumn(ColumnName="Price" )]
public int? Price { get; set; }
/// <summary>
/// 创建者
///</summary>
[SugarColumn(ColumnName="CreateUser" )]
public long? CreateUser { get; set; }
/// <summary>
/// 创建时间
///</summary>
[SugarColumn(ColumnName="CreateTime" )]
public DateTime? CreateTime { get; set; }
/// <summary>
/// 修改者
///</summary>
[SugarColumn(ColumnName="ModifyUser" )]
public long? ModifyUser { get; set; }
/// <summary>
/// 修改时间
///</summary>
[SugarColumn(ColumnName="ModifyTime" )]
public DateTime? ModifyTime { get; set; }
/// <summary>
/// 是否删除
///</summary>
[SugarColumn(ColumnName="IsDeleted" )]
public bool? IsDeleted { get; set; }
/// <summary>
/// 租户Id
///</summary>
[SugarColumn(ColumnName="TenantId" )]
public long? TenantId { get; set; }
/// <summary>
/// 排序字段
///</summary>
[SugarColumn(ColumnName="OrderNum" )]
public int? OrderNum { get; set; }
/// <summary>
/// 描述
///</summary>
[SugarColumn(ColumnName="Remark" )]
public string? Remark { get; set; }
}
}

View File

@@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using SqlSugar;
namespace Yi.Framework.Model.Models
{
/// <summary>
/// 商品规格表
///</summary>
[SugarTable("Specs")]
public partial class SpecsEntity:IBaseModelEntity
{
public SpecsEntity()
{
this.CreateTime = DateTime.Now;
}
[JsonConverter(typeof(ValueToStringConverter))]
[SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
public long Id { get; set; }
/// <summary>
/// 商品规格组id
///</summary>
[SugarColumn(ColumnName="SpecsGroupId" )]
public long? SpecsGroupId { get; set; }
/// <summary>
/// 商品规格名
///</summary>
[SugarColumn(ColumnName="SpecsName" )]
public string SpecsName { get; set; }
/// <summary>
/// 创建者
///</summary>
[SugarColumn(ColumnName="CreateUser" )]
public long? CreateUser { get; set; }
/// <summary>
/// 创建时间
///</summary>
[SugarColumn(ColumnName="CreateTime" )]
public DateTime? CreateTime { get; set; }
/// <summary>
/// 修改者
///</summary>
[SugarColumn(ColumnName="ModifyUser" )]
public long? ModifyUser { get; set; }
/// <summary>
/// 修改时间
///</summary>
[SugarColumn(ColumnName="ModifyTime" )]
public DateTime? ModifyTime { get; set; }
/// <summary>
/// 是否删除
///</summary>
[SugarColumn(ColumnName="IsDeleted" )]
public bool? IsDeleted { get; set; }
/// <summary>
/// 租户Id
///</summary>
[SugarColumn(ColumnName="TenantId" )]
public long? TenantId { get; set; }
/// <summary>
/// 排序字段
///</summary>
[SugarColumn(ColumnName="OrderNum" )]
public int? OrderNum { get; set; }
/// <summary>
/// 描述
///</summary>
[SugarColumn(ColumnName="Remark" )]
public string? Remark { get; set; }
}
}

View File

@@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using SqlSugar;
namespace Yi.Framework.Model.Models
{
/// <summary>
/// 商品规格组表
///</summary>
[SugarTable("SpecsGroup")]
public partial class SpecsGroupEntity:IBaseModelEntity
{
public SpecsGroupEntity()
{
this.CreateTime = DateTime.Now;
}
[JsonConverter(typeof(ValueToStringConverter))]
[SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
public long Id { get; set; }
/// <summary>
/// 分类id
///</summary>
[SugarColumn(ColumnName="CategoryId" )]
public long? CategoryId { get; set; }
/// <summary>
/// 商品规格组名
///</summary>
[SugarColumn(ColumnName="SpecsGroupName" )]
public string SpecsGroupName { get; set; }
/// <summary>
/// 创建者
///</summary>
[SugarColumn(ColumnName="CreateUser" )]
public long? CreateUser { get; set; }
/// <summary>
/// 创建时间
///</summary>
[SugarColumn(ColumnName="CreateTime" )]
public DateTime? CreateTime { get; set; }
/// <summary>
/// 修改者
///</summary>
[SugarColumn(ColumnName="ModifyUser" )]
public long? ModifyUser { get; set; }
/// <summary>
/// 修改时间
///</summary>
[SugarColumn(ColumnName="ModifyTime" )]
public DateTime? ModifyTime { get; set; }
/// <summary>
/// 是否删除
///</summary>
[SugarColumn(ColumnName="IsDeleted" )]
public bool? IsDeleted { get; set; }
/// <summary>
/// 租户Id
///</summary>
[SugarColumn(ColumnName="TenantId" )]
public long? TenantId { get; set; }
/// <summary>
/// 排序字段
///</summary>
[SugarColumn(ColumnName="OrderNum" )]
public int? OrderNum { get; set; }
/// <summary>
/// 描述
///</summary>
[SugarColumn(ColumnName="Remark" )]
public string? Remark { get; set; }
}
}

View File

@@ -0,0 +1,83 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using SqlSugar;
namespace Yi.Framework.Model.Models
{
/// <summary>
/// Spu表
///</summary>
[SugarTable("Spu")]
public partial class SpuEntity:IBaseModelEntity
{
public SpuEntity()
{
this.CreateTime = DateTime.Now;
}
[JsonConverter(typeof(ValueToStringConverter))]
[SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
public long Id { get; set; }
/// <summary>
/// 商品分类Id
///</summary>
[SugarColumn(ColumnName="CategoryId" )]
public long? CategoryId { get; set; }
/// <summary>
/// 商品名称
///</summary>
[SugarColumn(ColumnName="SpuName" )]
public string? SpuName { get; set; }
/// <summary>
/// 商品详情
///</summary>
[SugarColumn(ColumnName="Details" )]
public string? Details { get; set; }
/// <summary>
/// 商品价格
///</summary>
[SugarColumn(ColumnName="Price" )]
public string? Price { get; set; }
/// <summary>
/// 创建者
///</summary>
[SugarColumn(ColumnName="CreateUser" )]
public long? CreateUser { get; set; }
/// <summary>
/// 创建时间
///</summary>
[SugarColumn(ColumnName="CreateTime" )]
public DateTime? CreateTime { get; set; }
/// <summary>
/// 修改者
///</summary>
[SugarColumn(ColumnName="ModifyUser" )]
public long? ModifyUser { get; set; }
/// <summary>
/// 修改时间
///</summary>
[SugarColumn(ColumnName="ModifyTime" )]
public DateTime? ModifyTime { get; set; }
/// <summary>
/// 是否删除
///</summary>
[SugarColumn(ColumnName="IsDeleted" )]
public bool? IsDeleted { get; set; }
/// <summary>
/// 租户Id
///</summary>
[SugarColumn(ColumnName="TenantId" )]
public long? TenantId { get; set; }
/// <summary>
/// 排序字段
///</summary>
[SugarColumn(ColumnName="OrderNum" )]
public int? OrderNum { get; set; }
/// <summary>
/// 描述
///</summary>
[SugarColumn(ColumnName="Remark" )]
public string? Remark { get; set; }
}
}

View File

@@ -22,7 +22,7 @@ namespace Yi.Framework.Model.Models
///
///</summary>
[SugarColumn(ColumnName="TenantName" )]
public string TenantName { get; set; }
public string? TenantName { get; set; }
/// <summary>
/// 创建者
///</summary>
@@ -62,6 +62,6 @@ namespace Yi.Framework.Model.Models
/// 描述
///</summary>
[SugarColumn(ColumnName="Remark" )]
public string Remark { get; set; }
public string? Remark { get; set; }
}
}

View File

@@ -22,7 +22,7 @@ namespace Yi.Framework.Model.Models
///
///</summary>
[SugarColumn(ColumnName="Name" )]
public string Name { get; set; }
public string? Name { get; set; }
/// <summary>
///
///</summary>
@@ -72,42 +72,42 @@ namespace Yi.Framework.Model.Models
///
///</summary>
[SugarColumn(ColumnName="Salt" )]
public string Salt { get; set; }
public string? Salt { get; set; }
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="Icon" )]
public string Icon { get; set; }
public string? Icon { get; set; }
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="Nick" )]
public string Nick { get; set; }
public string? Nick { get; set; }
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="Email" )]
public string Email { get; set; }
public string? Email { get; set; }
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="Ip" )]
public string Ip { get; set; }
public string? Ip { get; set; }
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="Address" )]
public string Address { get; set; }
public string? Address { get; set; }
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="Phone" )]
public string Phone { get; set; }
public string? Phone { get; set; }
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="Introduction" )]
public string Introduction { get; set; }
public string? Introduction { get; set; }
/// <summary>
/// 排序字段
///</summary>
@@ -117,7 +117,7 @@ namespace Yi.Framework.Model.Models
/// 描述
///</summary>
[SugarColumn(ColumnName="Remark" )]
public string Remark { get; set; }
public string? Remark { get; set; }
/// <summary>
/// 部门id
///</summary>

View File

@@ -67,6 +67,6 @@ namespace Yi.Framework.Model.Models
/// 描述
///</summary>
[SugarColumn(ColumnName="Remark" )]
public string Remark { get; set; }
public string? Remark { get; set; }
}
}

View File

@@ -10,9 +10,9 @@ namespace Yi.Framework.Model.Models
{
[Navigate(typeof(RoleMenuEntity),nameof(RoleMenuEntity.RoleId),nameof(RoleMenuEntity.MenuId))]
public List<MenuEntity> Menus { get; set; }
public List<MenuEntity>? Menus { get; set; }
[Navigate(typeof(RoleDeptEntity), nameof(RoleDeptEntity.RoleId), nameof(RoleDeptEntity.DeptId))]
public List<DeptEntity> Depts { get; set; }
public List<DeptEntity>? Depts { get; set; }
}
}

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using SqlSugar;
namespace Yi.Framework.Model.Models
{
/// <summary>
/// Sku表
///</summary>
public partial class SkuEntity:IBaseModelEntity
{
/// <summary>
/// 规格sku信息
///</summary>
[SugarColumn(ColumnName = "SpecsSkuInfo", IsJson = true)]
public List<SpecsSkuInfoModel>? SpecsSkuInfo { get; set; }
/// <summary>
/// 规格sku完整信息
///</summary>
[SugarColumn(ColumnName = "SpecsSkuAllInfo", IsJson = true)]
public List<SpecsSkuAllInfoModel>? SpecsSkuAllInfo { get; set; }
}
public class SpecsSkuAllInfoModel
{
public string? SpecsGroupName { get; set; }
public string? SpecsName { get; set; }
}
public class SpecsSkuInfoModel
{
public long? SpecsGroupId { get; set; }
public long? SpecsId { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using SqlSugar;
namespace Yi.Framework.Model.Models
{
/// <summary>
/// 商品规格组表
///</summary>
public partial class SpecsGroupEntity:IBaseModelEntity
{
[Navigate(NavigateType.OneToMany, nameof(SpecsEntity.SpecsGroupId))]
public List<SpecsEntity>? Specses { get; set; }
}
}

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using SqlSugar;
namespace Yi.Framework.Model.Models
{
public partial class SpuEntity:IBaseModelEntity
{
/// <summary>
/// 规格Spu完整信息
///</summary>
[SugarColumn(ColumnName = "SpecsAllInfo", IsJson = true)]
public List<SpecsSpuAllInfoModel>? SpecsSpuAllInfo { get; set; }
/// <summary>
/// 规格Spu信息
///</summary>
[SugarColumn(ColumnName = "SpecsInfo", IsJson = true)]
public List<SpecsSpuInfoModel>? SpecsSpuInfo { get; set; }
[Navigate(NavigateType.OneToMany, nameof(SkuEntity.SpuId))]
public List<SkuEntity>? Skus { get; set; }
}
public class SpecsSpuAllInfoModel
{
public string? SpecsGroupName { get; set; }
public List<string>? SpecsNames{ get;set;}
}
public class SpecsSpuInfoModel
{
public long? SpecsGroupId{ get; set; }
public List<long>? SpecsIds { get; set; }
}
}

View File

@@ -12,13 +12,13 @@ namespace Yi.Framework.Model.Models
/// 看好啦ORM精髓导航属性
///</summary>
[Navigate(typeof(UserRoleEntity), nameof(UserRoleEntity.UserId), nameof(UserRoleEntity.RoleId))]
public List<RoleEntity> Roles { get; set; }
public List<RoleEntity>? Roles { get; set; }
[Navigate(typeof(UserPostEntity), nameof(UserPostEntity.UserId), nameof(UserPostEntity.PostId))]
public List<PostEntity> Posts { get; set; }
public List<PostEntity>? Posts { get; set; }
[Navigate( NavigateType.OneToOne,nameof(DeptId))]
public DeptEntity Dept { get; set; }
public DeptEntity? Dept { get; set; }
/// <summary>
/// 构建密码MD5盐值加密

View File

@@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>

View File

@@ -0,0 +1,14 @@
using SqlSugar;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Service
{
public partial class CategoryService : BaseService<CategoryEntity>, ICategoryService
{
public CategoryService(IRepository<CategoryEntity> repository) : base(repository)
{
}
}
}

View File

@@ -0,0 +1,14 @@
using SqlSugar;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Service
{
public partial class SkuService : BaseService<SkuEntity>, ISkuService
{
public SkuService(IRepository<SkuEntity> repository) : base(repository)
{
}
}
}

View File

@@ -0,0 +1,14 @@
using SqlSugar;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Service
{
public partial class SpecsGroupService : BaseService<SpecsGroupEntity>, ISpecsGroupService
{
public SpecsGroupService(IRepository<SpecsGroupEntity> repository) : base(repository)
{
}
}
}

View File

@@ -0,0 +1,14 @@
using SqlSugar;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Service
{
public partial class SpecsService : BaseService<SpecsEntity>, ISpecsService
{
public SpecsService(IRepository<SpecsEntity> repository) : base(repository)
{
}
}
}

View File

@@ -0,0 +1,14 @@
using SqlSugar;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Service
{
public partial class SpuService : BaseService<SpuEntity>, ISpuService
{
public SpuService(IRepository<SpuEntity> repository) : base(repository)
{
}
}
}

View File

@@ -0,0 +1,25 @@
using SqlSugar;
using System.Collections.Generic;
using System.Threading.Tasks;
using Yi.Framework.Common.Models;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Service
{
public partial class SkuService : BaseService<SkuEntity>, ISkuService
{
public async Task<PageModel<List<SkuEntity>>> SelctPageList(SkuEntity enetity, PageParModel page)
{
RefAsync<int> total = 0;
var data = await _repository._DbQueryable
.WhereIF(page.StartTime is not null && page.EndTime is not null, u => u.CreateTime >= page.StartTime && u.CreateTime <= page.EndTime)
.WhereIF(enetity.IsDeleted is not null, u => u.IsDeleted == enetity.IsDeleted)
.OrderBy(u => u.CreateTime, OrderByType.Desc)
.ToPageListAsync(page.PageNum, page.PageSize, total);
return new PageModel<List<SkuEntity>>(data, total);
}
}
}

View File

@@ -0,0 +1,25 @@
using SqlSugar;
using System.Collections.Generic;
using System.Threading.Tasks;
using Yi.Framework.Common.Models;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Service
{
public partial class SpuService : BaseService<SpuEntity>, ISpuService
{
public async Task<PageModel<List<SpuEntity>>> SelctPageList(SpuEntity enetity, PageParModel page)
{
RefAsync<int> total = 0;
var data = await _repository._DbQueryable
.Includes(spu=>spu.Skus)
.WhereIF(page.StartTime is not null && page.EndTime is not null, u => u.CreateTime >= page.StartTime && u.CreateTime <= page.EndTime)
.WhereIF(enetity.IsDeleted is not null, u => u.IsDeleted == enetity.IsDeleted)
.OrderBy(u => u.CreateTime, OrderByType.Desc)
.ToPageListAsync(page.PageNum, page.PageSize, total);
return new PageModel<List<SpuEntity>>(data, total);
}
}
}

View File

@@ -11,8 +11,8 @@ namespace Yi.Framework.WebCore
/// </summary>
public class Appsettings
{
static IConfiguration Configuration { get; set; }
static string contentPath { get; set; }
static IConfiguration? Configuration { get; set; }
static string? contentPath { get; set; }
public Appsettings(string contentPath)
{
@@ -37,14 +37,14 @@ namespace Yi.Framework.WebCore
/// </summary>
/// <param name="sections">节点配置</param>
/// <returns></returns>
public static string app(params string[] sections)
public static string? app(params string[] sections)
{
try
{
if (sections.Any())
{
return Configuration[string.Join(":", sections)];
return Configuration?[string.Join(":", sections)];
}
}
catch (Exception) { }
@@ -59,7 +59,7 @@ namespace Yi.Framework.WebCore
}
public static bool Bool(object thisValue)
public static bool Bool(object? thisValue)
{
bool reval = false;
if (thisValue != null && thisValue != DBNull.Value && bool.TryParse(thisValue.ToString(), out reval))
@@ -84,9 +84,9 @@ namespace Yi.Framework.WebCore
}
public static IConfiguration appConfiguration(params string[] sections)
public static IConfiguration? appConfiguration(params string[] sections)
{
return Configuration.GetSection(string.Join(":", sections));
return Configuration?.GetSection(string.Join(":", sections));
}
}
}

View File

@@ -35,9 +35,8 @@ namespace Yi.Framework.WebCore.AttributeExtend
if (context.ActionDescriptor is not ControllerActionDescriptor controllerActionDescriptor) return;
//查找标签,获取标签对象
LogAttribute logAttribute = controllerActionDescriptor.MethodInfo.GetCustomAttributes(inherit: true)
LogAttribute? logAttribute = controllerActionDescriptor.MethodInfo.GetCustomAttributes(inherit: true)
.FirstOrDefault(a => a.GetType().Equals(typeof(LogAttribute))) as LogAttribute;
//空对象直接返回
if (logAttribute is null) return;
@@ -72,7 +71,7 @@ namespace Yi.Framework.WebCore.AttributeExtend
{
if (context.Result is ContentResult result && result.ContentType == "application/json")
{
logEntity.RequestResult = result.Content.Replace("\r\n", "").Trim();
logEntity.RequestResult = result.Content?.Replace("\r\n", "").Trim();
}
if (context.Result is JsonResult result2)
{

View File

@@ -50,12 +50,16 @@ namespace Yi.Framework.WebCore.BuilderExtend
{
foreach (var apolloProvider in root.Providers.Where(p => p is ApolloConfigurationProvider))
{
var property = apolloProvider.GetType().BaseType.GetProperty("Data", BindingFlags.Instance | BindingFlags.NonPublic);
var data = property.GetValue(apolloProvider) as IDictionary<string, string>;
foreach (var item in data)
var property = apolloProvider.GetType().BaseType?.GetProperty("Data", BindingFlags.Instance | BindingFlags.NonPublic);
var data = property?.GetValue(apolloProvider) as IDictionary<string, string>;
if (data is not null)
{
Console.WriteLine($"key {item.Key} value {item.Value}");
foreach (var item in data)
{
Console.WriteLine($"key {item.Key} value {item.Value}");
}
}
}
});
}

View File

@@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace Yi.Framework.WebCore.BuilderExtend
@@ -13,11 +14,14 @@ namespace Yi.Framework.WebCore.BuilderExtend
{
public static void AddJsonFileService(this IMvcBuilder builder)
{
builder.AddJsonOptions(options =>
options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter()));
builder.AddNewtonsoftJson(options =>
{
options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm";
//options.SerializerSettings.Converters.Add(new ValueToStringConverter());
});

View File

@@ -15,12 +15,12 @@ internal class JsonOptionsWritable<TOptions> : FileOptionsWritableBase<TOptions>
public override void Update(Action<TOptions> configuration)
{
JObject jObject = JsonConvert.DeserializeObject<JObject>(File.ReadAllText(this.FileName));
JObject? jObject = JsonConvert.DeserializeObject<JObject>(File.ReadAllText(this.FileName));
if (jObject != null)
{
TOptions option = this.Monitor.CurrentValue ?? new TOptions();
if (jObject.TryGetValue(this.Section, out JToken jtoken))
if (jObject.TryGetValue(this.Section, out JToken? jtoken))
{
option = JsonConvert.DeserializeObject<TOptions>(jtoken.ToString()) ?? new TOptions();
configuration?.Invoke(option);

View File

@@ -50,7 +50,7 @@ namespace Yi.Framework.WebCore
/// </summary>
/// <param name="httpContext"></param>
/// <returns></returns>
public static string GetUserNameInfo(this HttpContext httpContext)
public static string? GetUserNameInfo(this HttpContext httpContext)
{
var p = httpContext;
return httpContext.User.Claims.FirstOrDefault(u => u.Type == "userName")?.Value;
@@ -61,10 +61,10 @@ namespace Yi.Framework.WebCore
/// </summary>
/// <param name="httpContext"></param>
/// <returns></returns>
public static string GetDeptIdInfo(this HttpContext httpContext)
public static string? GetDeptIdInfo(this HttpContext httpContext)
{
var p = httpContext;
return httpContext.User.Claims.FirstOrDefault(u => u.Type == "deptId").Value;
return httpContext.User.Claims.FirstOrDefault(u => u.Type == "deptId")?.Value;
}
/// <summary>
@@ -72,10 +72,10 @@ namespace Yi.Framework.WebCore
/// </summary>
/// <param name="httpContext"></param>
/// <returns></returns>
public static string GetPermissionInfo(this HttpContext httpContext)
public static string? GetPermissionInfo(this HttpContext httpContext)
{
var p = httpContext;
return httpContext.User.Claims.FirstOrDefault(u => u.Type == "permission").Value;
return httpContext.User.Claims.FirstOrDefault(u => u.Type == "permission")?.Value;
}
@@ -87,7 +87,7 @@ namespace Yi.Framework.WebCore
/// <returns></returns>
public static UserEntity GetUserEntityInfo(this HttpContext httpContext, out List<Guid> menuIds)
{
IEnumerable<Claim> claimlist = null;
IEnumerable<Claim>? claimlist = null;
long resId = 0;
try
{
@@ -139,7 +139,7 @@ namespace Yi.Framework.WebCore
{
string res = "zh-CN";
var str = httpContext.Request.Headers["Accept-Language"].FirstOrDefault();
if (str.IsNotNull())
if (str is not null)
{
res = str.Split(",")[0];
}
@@ -167,7 +167,7 @@ namespace Yi.Framework.WebCore
}
else
{
param = context.Request.QueryString.Value.ToString();
param = context.Request.QueryString.Value is null?"": context.Request.QueryString.Value.ToString();
}
return param;
}

View File

@@ -21,7 +21,7 @@ namespace Yi.Framework.Core
}
//无需授权情况
var userName = httpContext.GetUserNameInfo();
var userName = httpContext?.GetUserNameInfo();
if (userName is null)
{
return;
@@ -35,52 +35,57 @@ namespace Yi.Framework.Core
//这里可以优化一下
//根据缓存获取全部用户信息
var userRoleMenu = ServiceLocator.Instance.GetService<CacheInvoker>().Get<UserRoleMenuDto>("用户id");
var userRoleMenu = ServiceLocator.Instance?.GetService<CacheInvoker>()?.Get<UserRoleMenuDto>("用户id");
var roles = userRoleMenu.Roles;
var roles = userRoleMenu?.Roles;
if (roles.IsNull())
{
roles = new();
}
//先测试部门就是LEBG
long deptId = (long)userRoleMenu.User.DeptId;
long userId = httpContext.GetUserIdInfo();
long deptId = userRoleMenu?.User.DeptId ?? -1;
long userId = httpContext?.GetUserIdInfo()??-1;
//根据角色的数据范围,来添加相对于的数据权限
foreach (var role in roles)
if (roles is not null)
{
DataScopeEnum dataScope = (DataScopeEnum)role.DataScope;
switch (dataScope)
foreach (var role in roles)
{
case DataScopeEnum.ALL:
//直接放行
break;
case DataScopeEnum.DEPT:
//只能查询到自己的部门的数据
db.QueryFilter.Add(new TableFilterItem<UserEntity>(it => it.DeptId == deptId, true));
break;
case DataScopeEnum.USER:
//只能查询到自己
db.QueryFilter.Add(new TableFilterItem<UserEntity>(it => it.Id == userId, true));
break;
case DataScopeEnum.CUSTOM:
//自定义查询
var filter = new TableFilterItem<UserEntity>(it => SqlFunc.Subqueryable<RoleDeptEntity>().Where(f => f.DeptId == it.DeptId && f.RoleId == (long)role.Id).Any(), true);
db.QueryFilter.Add(filter);
break;
case DataScopeEnum.DEPT_FOLLOW:
//放行自己部门及以下
var allChildDepts = db.Queryable<DeptEntity>().ToChildList(it => it.ParentId, deptId);
//默认为全部
DataScopeEnum dataScope = (DataScopeEnum)(role.DataScope ?? DataScopeEnum.ALL.GetHashCode());
switch (dataScope)
{
case DataScopeEnum.ALL:
//直接放行
break;
case DataScopeEnum.DEPT:
//只能查询到自己的部门的数据
db.QueryFilter.Add(new TableFilterItem<UserEntity>(it => it.DeptId == deptId, true));
break;
case DataScopeEnum.USER:
//只能查询到自己
db.QueryFilter.Add(new TableFilterItem<UserEntity>(it => it.Id == userId, true));
break;
case DataScopeEnum.CUSTOM:
//自定义查询
var filter = new TableFilterItem<UserEntity>(it => SqlFunc.Subqueryable<RoleDeptEntity>().Where(f => f.DeptId == it.DeptId && f.RoleId == (long)role.Id).Any(), true);
db.QueryFilter.Add(filter);
break;
case DataScopeEnum.DEPT_FOLLOW:
//放行自己部门及以下
var allChildDepts = db.Queryable<DeptEntity>().ToChildList(it => it.ParentId, deptId);
var filter1 = new TableFilterItem<UserEntity>(it => allChildDepts.Select(f => f.Id).ToList().Contains((long)it.DeptId), true);
db.QueryFilter.Add(filter1);
var filter1 = new TableFilterItem<UserEntity>(it => allChildDepts.Select(f => f.Id).ToList().Contains(it.DeptId ?? -1), true);
//部门无需过滤
//var filter2 = new TableFilterItem<DeptEntity>(it => allChildDepts.Select(f => f.Id).ToList().Contains(it.Id),true);
//db.QueryFilter.Add(filter2);
break;
default:
break;
db.QueryFilter.Add(filter1);
//部门无需过滤
//var filter2 = new TableFilterItem<DeptEntity>(it => allChildDepts.Select(f => f.Id).ToList().Contains(it.Id),true);
//db.QueryFilter.Add(filter2);
break;
default:
break;
}
}
}
}

View File

@@ -13,7 +13,12 @@ namespace Yi.Framework.WebCore.DbExtend
{
public static class DbSeedExtend
{
public static bool Invoer(ISqlSugarClient _Db)
/// <summary>
/// 初始化数据
/// </summary>
/// <param name="_Db"></param>
/// <returns></returns>
public static bool DataInvoer(ISqlSugarClient _Db)
{
bool res = false;
var users = SeedFactory.GetUserSeed();
@@ -87,14 +92,40 @@ namespace Yi.Framework.WebCore.DbExtend
return res;
}
/// <summary>
/// codeFirst初始化表
/// </summary>
/// <param name="_Db"></param>
/// <returns></returns>
public static void TableInvoer(ISqlSugarClient _Db)
{
//创建数据库
_Db.DbMaintenance.CreateDatabase();
var typeList = Common.Helper.AssemblyHelper.GetClass("Yi.Framework.Model");
foreach (var t in typeList)
{
//扫描如果存在SugarTable特性直接codefirst
if (t.GetCustomAttributes(false).Any(a => a.GetType().Equals(typeof(SugarTable))))
{
_Db.CodeFirst.SetStringDefaultLength(200).InitTables(t);//这样一个表就能成功创建了
}
}
}
public static void UseDbSeedInitService(this IApplicationBuilder app)
{
if (Appsettings.appBool("DbCodeFirst_Enabled"))
{
var _Db = app.ApplicationServices.GetRequiredService<ISqlSugarClient>();
TableInvoer(_Db);
}
if (Appsettings.appBool("DbSeed_Enabled"))
{
var _Db = app.ApplicationServices.GetService<ISqlSugarClient>();
Invoer(_Db);
var _Db = app.ApplicationServices.GetRequiredService<ISqlSugarClient>();
DataInvoer(_Db);
}
}

View File

@@ -15,7 +15,7 @@ namespace Yi.Framework.WebCore.FilterExtend
/// </summary>
public class CustomExceptionFilterAttribute : IExceptionFilter
{
private ILogger<CustomExceptionFilterAttribute> _logger = null;
private ILogger<CustomExceptionFilterAttribute> _logger;
public CustomExceptionFilterAttribute(ILogger<CustomExceptionFilterAttribute> logger)
{
this._logger = logger;
@@ -27,8 +27,8 @@ namespace Yi.Framework.WebCore.FilterExtend
{
context.Result = new JsonResult(
Result.Error("操作失败").SetData(context.Exception.Message));
string url = context.HttpContext.Request.Path.Value;
string actionName = context.ActionDescriptor.DisplayName;
string? url = context.HttpContext.Request.Path.Value;
string? actionName = context.ActionDescriptor.DisplayName;
var logModel = new LogModel()
{

View File

@@ -11,7 +11,7 @@ namespace Yi.Framework.WebCore.FilterExtend
/// </summary>
public class CustomIOCFilterFactoryAttribute : Attribute, IFilterFactory
{
private readonly Type _FilterType = null;
private readonly Type _FilterType;
public CustomIOCFilterFactoryAttribute(Type type)
{
@@ -23,7 +23,7 @@ namespace Yi.Framework.WebCore.FilterExtend
{
//return (IFilterMetadata)serviceProvider.GetService(typeof(CustomExceptionFilterAttribute));
return (IFilterMetadata)serviceProvider.GetService(this._FilterType);
return (IFilterMetadata)serviceProvider.GetService(this._FilterType)!;
}
}

View File

@@ -12,7 +12,7 @@ namespace Yi.Framework.WebCore.FilterExtend
/// </summary>
public class CustomResourceFilterAttribute : Attribute, IResourceFilter, IFilterMetadata
{
private static Dictionary<string, IActionResult> CustomCache = new Dictionary<string, IActionResult>();
private static Dictionary<string, IActionResult?> CustomCache = new Dictionary<string, IActionResult?>();
/// <summary>
/// 发生在其他动作之前
/// </summary>

View File

@@ -14,7 +14,7 @@ namespace Yi.Framework.WebCore.FilterExtend
/// </summary>
public class LogActionFilterAttribute : ActionFilterAttribute
{
private ILogger<LogActionFilterAttribute> _logger = null;
private ILogger<LogActionFilterAttribute> _logger ;
public LogActionFilterAttribute(ILogger<LogActionFilterAttribute> logger)
{
this._logger = logger;
@@ -22,11 +22,11 @@ namespace Yi.Framework.WebCore.FilterExtend
public override void OnActionExecuting(ActionExecutingContext context)
{
string url = context.HttpContext.Request.Path.Value;
string? url = context.HttpContext.Request.Path.Value;
string argument = JsonConvert.SerializeObject(context.ActionArguments);
string controllerName = context.Controller.GetType().FullName;
string actionName = context.ActionDescriptor.DisplayName;
string? controllerName = context.Controller.GetType().FullName;
string? actionName = context.ActionDescriptor.DisplayName;
LogModel logModel = new LogModel()
{

View File

@@ -0,0 +1,126 @@
using Consul;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using System;
using System.Threading;
using System.Threading.Tasks;
using Yi.Framework.Common.IOCOptions;
namespace Yi.Framework.WebCore.MiddlewareExtend
{
/// <summary>
/// 注册ConsulRegisterService 这个servcie在app启动的时候会自动注册服务信息
/// </summary>
public class ConsulRegisterHostExtend : IHostedService
{
private readonly ConsulRegisterOption _consulRegisterOptions;
private readonly ConsulClientOption _consulClientOptions;
public ConsulRegisterHostExtend()
{
_consulRegisterOptions = Appsettings.app<ConsulRegisterOption>("ConsulRegisterOption");
_consulClientOptions = Appsettings.app<ConsulClientOption>("ConsulClientOption");
}
public async Task StartAsync(CancellationToken cancellationToken)
{
var httpPort = this._consulRegisterOptions.Port;
//var grpcPort = Convert.ToInt32(Appsettings.app("GrpcPort"));
//------------------Http------------------
using (ConsulClient client = new ConsulClient(c =>
{
c.Address = new Uri($"http://{this._consulClientOptions.IP}:{this._consulClientOptions.Port}/");
c.Datacenter = this._consulClientOptions.Datacenter;
}))
{
var serviceId = $"{this._consulRegisterOptions.IP}:{httpPort}-{this._consulRegisterOptions.GroupName}";
await client.Agent.ServiceDeregister(serviceId, cancellationToken);
Console.WriteLine($"开始向Consul注册Http[{serviceId}]服务 ...");
await client.Agent.ServiceRegister(new AgentServiceRegistration()
{
ID = serviceId,//唯一Id
Name = this._consulRegisterOptions.GroupName,//组名称-Group
Address = this._consulRegisterOptions.IP,
Port = httpPort,
Tags = new string[] { "Http" },
Check = new AgentServiceCheck()
{
Interval = TimeSpan.FromSeconds(this._consulRegisterOptions.Interval),
HTTP = $"http://{_consulRegisterOptions.IP}:{httpPort}/Health",
//GRPC = $"{this._consulRegisterOptions.IP}:{grpcPort}",//gRPC特有
GRPCUseTLS = false,//支持http
Timeout = TimeSpan.FromSeconds(this._consulRegisterOptions.Timeout),
DeregisterCriticalServiceAfter = TimeSpan.FromSeconds(this._consulRegisterOptions.DeregisterCriticalServiceAfter),
}
});
}
//------------------Grpc------------------
//using (ConsulClient client = new ConsulClient(c =>
//{
// c.Address = new Uri($"http://{this._consulClientOptions.IP}:{this._consulClientOptions.Port}/");
// c.Datacenter = this._consulClientOptions.Datacenter;
//}))
//{
// var serviceId = $"{this._consulRegisterOptions.IP}:{grpcPort}-{this._consulRegisterOptions.GrpcGroupName}";
// await client.Agent.ServiceDeregister(serviceId, cancellationToken);
// Console.WriteLine($"开始向Consul注册Grpc[{serviceId}]服务 ...");
// await client.Agent.ServiceRegister(new AgentServiceRegistration()
// {
// ID = serviceId,//唯一Id
// Name = this._consulRegisterOptions.GrpcGroupName,//组名称-Group
// Address = this._consulRegisterOptions.IP,
// Port = grpcPort,
// Tags = new string[] { "Grpc" },
// Check = new AgentServiceCheck()
// {
// Interval = TimeSpan.FromSeconds(this._consulRegisterOptions.Interval),
// //HTTP = this._consulRegisterOption.HealthCheckUrl,
// GRPC = $"{this._consulRegisterOptions.IP}:{grpcPort}",//gRPC特有
// GRPCUseTLS = false,//支持http
// Timeout = TimeSpan.FromSeconds(this._consulRegisterOptions.Timeout),
// DeregisterCriticalServiceAfter = TimeSpan.FromSeconds(this._consulRegisterOptions.DeregisterCriticalServiceAfter),
// }
// });
//}
}
/// <summary>
/// 正常注销调用
/// </summary>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public async Task StopAsync(CancellationToken cancellationToken)
{
var httpPort = this._consulRegisterOptions.Port;
//var grpcPort = Appsettings.app<int>("GrpcPort");
using (ConsulClient client = new ConsulClient(c =>
{
c.Address = new Uri($"http://{this._consulClientOptions.IP}:{this._consulClientOptions.Port}/");
c.Datacenter = this._consulClientOptions.Datacenter;
})) {
var serviceId = $"{this._consulRegisterOptions.GroupName}:{this._consulRegisterOptions.IP}-{httpPort}";
//var grpcServiceId = $"{this._consulRegisterOptions.GrpcGroupName}:{this._consulRegisterOptions.IP}-{grpcPort}";
await client.Agent.ServiceDeregister(serviceId, cancellationToken);
//await client.Agent.ServiceDeregister(grpcServiceId, cancellationToken);
Console.WriteLine($"开始Consul注销[{serviceId}]服务 ...");
}
}
}
}

View File

@@ -4,14 +4,16 @@ using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Common.Models;
namespace Yi.Framework.WebCore.MiddlewareExtend
{
public static class SqlsugarExtension
{
public static void AddSqlsugarServer(this IServiceCollection services, Action<SqlSugarClient> action = null)
public static void AddSqlsugarServer(this IServiceCollection services, Action<SqlSugarClient>? action = null)
{
DbType dbType;
var slavaConFig = new List<SlaveConnectionConfig>();
@@ -49,9 +51,16 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
{
EntityService = (c, p) =>
{
// int? decimal?这种 isnullable=true
if (c.PropertyType.IsGenericType &&
c.PropertyType.GetGenericTypeDefinition() == typeof(Nullable<>))
//// int? decimal?这种 isnullable=true
//if (c.PropertyType.IsGenericType &&
//c.PropertyType.GetGenericTypeDefinition() == typeof(Nullable<>))
//{
// p.IsNullable = true;
//}
//高版C#写法 支持string?和string
if (new NullabilityInfoContext()
.Create(c).WriteState is NullabilityState.Nullable)
{
p.IsNullable = true;
}
@@ -60,7 +69,7 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
},
db =>
{
if (action.IsNotNull())
if (action is not null)
{
action(db);
}
@@ -95,10 +104,9 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
};
db.Aop.OnLogExecuting = (s, p) =>
{
//暂时先关闭sql打印
if (false)
if (GobalModel.SqlLogEnable)
{
var _logger = ServiceLocator.Instance.GetService<ILogger<SqlSugarClient>>();
var _logger = ServiceLocator.Instance?.GetRequiredService<ILogger<SqlSugarClient>>();
StringBuilder sb = new StringBuilder();
sb.Append("执行SQL:" + s.ToString());
@@ -106,8 +114,7 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
{
sb.Append($"\r\n参数:{i.ParameterName},参数值:{i.Value}");
}
_logger.LogInformation(sb.ToString());
_logger?.LogInformation(sb.ToString());
}

View File

@@ -31,7 +31,7 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
{
if (this._supportDelete && "Delete".Equals(context.Request.Query["ActionHeader"]))
{
this.DeleteHmtl(context.Request.Path.Value);
this.DeleteHmtl(context.Request.Path.Value??"");
context.Response.StatusCode = 200;
}
else if (this._supportWarmup && "ClearAll".Equals(context.Request.Query["ActionHeader"]))
@@ -52,7 +52,7 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
copyStream.Position = 0;
var reader = new StreamReader(copyStream);
var content = await reader.ReadToEndAsync();
string url = context.Request.Path.Value;
string url = context.Request.Path.Value??"";
this.SaveHmtl(url, content);

View File

@@ -31,6 +31,10 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
//为 Swagger JSON and UI设置xml文档注释路径
//获取应用程序所在目录(绝对路径不受工作目录影响建议采用此方法获取路径使用windwos&Linux
var basePath = Path.GetDirectoryName(typeof(Program).Assembly.Location);
if (basePath is null)
{
throw new Exception("未找到swagger文件");
}
var apiXmlPath = Path.Combine(basePath, @"Config/SwaggerDoc.xml");//控制器层注释
//var entityXmlPath = Path.Combine(basePath, @"SwaggerDoc.xml");//实体注释
//c.IncludeXmlComments(apiXmlPath, true);//true表示显示控制器注释

View File

@@ -7,14 +7,14 @@ namespace Yi.Framework.WebCore
{
public static class ServiceLocator
{
public static IServiceProvider Instance { get; set; }
public static IServiceProvider? Instance { get; set; }
public static string Admin { get; set; } = "cc";
public static bool GetHttp(out HttpContext httpContext)
public static bool GetHttp(out HttpContext? httpContext)
{
httpContext = null;
var httpContextAccessor = Instance.GetService<IHttpContextAccessor>();
var httpContextAccessor = Instance?.GetService<IHttpContextAccessor>();
if (httpContextAccessor is null)
{
return false;

View File

@@ -16,7 +16,7 @@ namespace Yi.Framework.WebCore.SignalRHub
public static readonly List<OnlineUser> clientUsers = new();
private HttpContext _httpContext;
private HttpContext? _httpContext;
private ILogger<MainHub> _logger;
public MainHub(IHttpContextAccessor httpContextAccessor,ILogger<MainHub> logger)
{
@@ -32,20 +32,20 @@ namespace Yi.Framework.WebCore.SignalRHub
/// <returns></returns>
public override Task OnConnectedAsync()
{
var name = _httpContext.GetUserNameInfo();
var loginUser = _httpContext.GetLoginLogInfo();
var name = _httpContext?.GetUserNameInfo();
var loginUser = _httpContext?.GetLoginLogInfo();
var user = clientUsers.Any(u => u.ConnnectionId == Context.ConnectionId);
//判断用户是否存在,否则添加集合
if (!user && Context.User.Identity.IsAuthenticated)
if (!user && (Context.User?.Identity?.IsAuthenticated??false))
{
OnlineUser users = new(Context.ConnectionId)
{
Browser= loginUser.Browser,
LoginLocation = loginUser.LoginLocation,
Ipaddr= loginUser.LoginIp,
Browser= loginUser?.Browser,
LoginLocation = loginUser?.LoginLocation,
Ipaddr= loginUser?.LoginIp,
LoginTime=DateTime.Now,
Os=loginUser.Os,
UserName= name
Os=loginUser?.Os,
UserName= name??""
};
clientUsers.Add(users);
_logger.LogInformation($"{DateTime.Now}{name},{Context.ConnectionId}连接服务端success当前已连接{clientUsers.Count}个");
@@ -63,7 +63,7 @@ namespace Yi.Framework.WebCore.SignalRHub
/// </summary>
/// <param name="exception"></param>
/// <returns></returns>
public override Task OnDisconnectedAsync(Exception exception)
public override Task OnDisconnectedAsync(Exception? exception)
{
var user = clientUsers.Where(p => p.ConnnectionId == Context.ConnectionId).FirstOrDefault();
//判断用户是否存在,否则添加集合

View File

@@ -19,18 +19,18 @@ namespace Yi.Framework.WebCore.SignalRHub
/// <summary>
/// 客户端连接Id
/// </summary>
public string ConnnectionId { get; }
public string? ConnnectionId { get; }
/// <summary>
/// 用户id
/// </summary>
public long? UserId { get; set; }
public string UserName { get; set; }
public DateTime LoginTime { get; set; }
public string Ipaddr { get; set; }
public string LoginLocation { get; set; }
public string? UserName { get; set; }
public DateTime? LoginTime { get; set; }
public string? Ipaddr { get; set; }
public string? LoginLocation { get; set; }
public string Os { get; set; }
public string Browser { get; set; }
public string? Os { get; set; }
public string? Browser { get; set; }
}

View File

@@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>

View File

@@ -15,7 +15,6 @@ declare module '@vue/runtime-core' {
RouterView: typeof import('vue-router')['RouterView']
VanActionSheet: typeof import('vant/es')['ActionSheet']
VanButton: typeof import('vant/es')['Button']
VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanCol: typeof import('vant/es')['Col']
VanDivider: typeof import('vant/es')['Divider']
@@ -27,10 +26,11 @@ declare module '@vue/runtime-core' {
VanList: typeof import('vant/es')['List']
VanLoading: typeof import('vant/es')['Loading']
VanNavBar: typeof import('vant/es')['NavBar']
VanPopup: typeof import('vant/es')['Popup']
VanPullRefresh: typeof import('vant/es')['PullRefresh']
VanRow: typeof import('vant/es')['Row']
VanSticky: typeof import('vant/es')['Sticky']
VanSwipe: typeof import('vant/es')['Swipe']
VanSwipeItem: typeof import('vant/es')['SwipeItem']
VanTab: typeof import('vant/es')['Tab']
VanTabbar: typeof import('vant/es')['Tabbar']
VanTabbarItem: typeof import('vant/es')['TabbarItem']

View File

@@ -3,7 +3,6 @@ import { ArticleEntity } from '@/type/interface/ArticleEntity'
export default {
add(data:any) {
console.log(data)
return myaxios({
url: `/article/add`,
method: 'post',

View File

@@ -0,0 +1,18 @@
import myaxios from '@/utils/myaxios'
export default {
add(data:any) {
return myaxios({
url: `/sku/add`,
method: 'post',
data: data
})
},
pageList(data:any) {
return myaxios({
url: '/sku/pageList',
method: 'get',
params: data
})
}
}

View File

@@ -0,0 +1,18 @@
import myaxios from '@/utils/myaxios'
export default {
add(data:any) {
return myaxios({
url: `/spu/add`,
method: 'post',
data: data
})
},
pageList(data:any) {
return myaxios({
url: '/spu/pageList',
method: 'get',
params: data
})
}
}

Some files were not shown because too many files have changed in this diff Show More