Compare commits

...

136 Commits

Author SHA1 Message Date
wcg
c8c30ca2e1 fix(api): 修复请求中错误对象的类型断言问题 2026-02-12 10:01:55 +08:00
wcg
d8d1e25972 docs(readme): 更新README 2026-02-12 10:01:38 +08:00
dubai
fc5779225e docs(readme): 更新 API 响应风格兼容说明 2026-02-12 01:01:13 +08:00
dubai
287b30e2c4 fix(request): 针对ABP 风格响应添加防御性检查,处理 HTTP 200 状态下返回的 error 对象 2026-02-12 00:51:02 +08:00
dubai
d00cdcf122 feat(api): 兼容多种后端API响应风格
- 在环境变量中新增VITE_GLOB_API_STYLE配置项以支持auto、furion和abp三种响应风格
- 在全局类型定义中添加apiStyle字段,支持对应响应风格类型约束
- request.ts中实现Furion风格响应判断和自动切换ABP风格处理逻辑
- 增加ABP风格错误处理,包含401/403自动登出及验证错误提示
- ABP风格下支持HTTP 200直接成功返回数据和不同成功提示模式
- use-app-config.ts中添加apiStyle配置读取及默认值逻辑
- 注释掉YiAbpWebModule中Furion统一响应API的启用代码,改为默认使用ABP风格
2026-02-12 00:43:52 +08:00
dubai
92064cc4f5 fix: 切换回默认接口风格 2026-02-12 00:42:35 +08:00
dubai
b1f9aba4f6 fix: 把 Yi.Vben5.Vue3 下的 public 目录放出来 2026-02-11 23:32:12 +08:00
dubai
e07714ee54 fix(api): 优化401和403错误处理,增加403错误登出逻辑 2026-02-11 23:17:10 +08:00
wcg
f5da80de9e refactor(system): 移除岗位关联部门功能并优化岗位加载逻辑
- 删除岗位表单中的部门选择组件及相关联动逻辑
- 修改岗位接口调用为无参数版本,加载全部岗位数据
- 优化用户手机号字段验证规则,支持字符串和数字
- 用户界面中岗位选择不再依赖部门选择,初始化时加载全部岗位
- 移除岗位抽屉中部门树获取及展示逻辑,简化表单结构
- 调整岗位数据提交时移除部门字段,确保数据一致性
- 修正岗位选择组件占位符及禁用状态逻辑,提升用户体验
2026-02-11 16:43:08 +08:00
wcg
1fd75a198d refactor(vite): 修复代理配置类型错误 2026-02-11 10:16:12 +08:00
wcg
16b2238f5b fix(preferences): 详细说明本地图片路径为"apps/web-antd/public/"目录 2026-02-10 16:26:30 +08:00
wcg
9afeb59766 fix(rbac): 角色菜单树接口增加菜单来源参数 2026-01-27 18:11:52 +08:00
chenchun
960d8a309c fix: 允许静态文件返回未知文件类型并设置默认内容类型
在 UseStaticFiles 配置中启用 ServeUnknownFileTypes 并将 DefaultContentType 设为 application/octet-stream,确保像
2026-01-23 16:52:58 +08:00
dubai
adf09f4753 feat(menu): 添加 Vben5 路由构建功能并优化菜单转换逻辑
- 为 MenuAggregateRoot 添加 Vben5RouterBuild 扩展方法,支持 Vben5 框架的路由构建
- 在 Vben5RouterBuild 中实现完整的 URL 类型检测和内嵌 iframe 处理逻辑
- 添加对内嵌链接、外部链接和普通路由的不同处理策略
- 优化路由名称生成规则,支持开头大写处理
- 在种子数据中添加示例并注释说明
2026-01-11 20:49:47 +08:00
dubai
dc0c83a620 chore(menu): 注释代码生成菜单种子数据 2026-01-11 19:14:34 +08:00
dubai
a1210c1efd fix(menu): 修复菜单列表接口参数缺失menuSource
- 不传递参数时后端默认为ruoyi菜单
2026-01-11 18:41:53 +08:00
dubai
18f253371b fix(rbac): 修复角色授权用户菜单数据种子中的父子关系配置
- 为 roleAuthUser 菜单实体添加了正确的 ParentId系统管理
2026-01-11 18:33:22 +08:00
dubai
bd410087af fix(profile): 暂不支持社交账号绑定提示 2026-01-11 14:28:05 +08:00
dubai
d4678f2fe3 refactor(system): 移除旧用户个人主页信息接口定义 2026-01-11 14:24:21 +08:00
dubai
6f64ebfba3 fix(profile): 修复个人中心接口报错 2026-01-11 14:23:26 +08:00
dubai
689b136724 fix(core): 统一创建时间字段名从 createTime 到 creationTime 2026-01-11 14:15:58 +08:00
dubai
d9d3118879 chore(app): 移除更新提示功能 2026-01-11 14:11:37 +08:00
dubai
1d78fec144 fix(core): 统一电话号码字段名称从 phonenumber 改为 phone 2026-01-11 14:06:04 +08:00
dubai
d12769dd29 fix(core): 统一用户昵称字段名称从 nickName 改为 nick 2026-01-11 14:04:57 +08:00
dubai
bd51228293 docs(readme): 更新项目文档 2026-01-11 14:02:38 +08:00
dubai
eaf5c01a33 fix(project): 移除不必要的项目引用
- 移除 Yi.Abp.SqlSugarCore 中对 Yi.Framework.Stock.SqlSugarCore 的引用
- 移除 Yi.Framework.Rbac.Application.Contracts 中对 Yi.Framework.Bbs.Domain.Shared 的引用
2026-01-11 14:01:44 +08:00
橙子
369d5ef54e update README.md.
Signed-off-by: 橙子 <454313500@qq.com>
2026-01-10 10:31:36 +00:00
橙子
8975b76e79 update README.md.
Signed-off-by: 橙子 <454313500@qq.com>
2026-01-10 10:29:36 +00:00
橙子
7512a373a6 update README.md.
Signed-off-by: 橙子 <454313500@qq.com>
2026-01-10 10:23:55 +00:00
橙子
7b3b7292ea style: 新增vben系统截图
Signed-off-by: 橙子 <454313500@qq.com>
2026-01-10 10:23:09 +00:00
橙子
816f680672 update README.md.
Signed-off-by: 橙子 <454313500@qq.com>
2026-01-10 10:19:31 +00:00
橙子
50e86f99a4 update README.md.
Signed-off-by: 橙子 <454313500@qq.com>
2026-01-10 10:15:16 +00:00
橙子
6701a09ad1 update README.md.
Signed-off-by: 橙子 <454313500@qq.com>
2026-01-10 10:11:38 +00:00
ccnetcore
ecba8d5c66 ci: 修改发布 2026-01-10 18:06:48 +08:00
ccnetcore
69618eef33 Merge remote-tracking branch 'origin/main' 2026-01-10 18:06:15 +08:00
ccnetcore
44394dffac ci: 修改发布 2026-01-10 18:06:04 +08:00
橙子
66c2d641a8 update README.md.
Signed-off-by: 橙子 <454313500@qq.com>
2026-01-10 10:04:56 +00:00
ccnetcore
7e90624467 chore: 调整发布脚本打包目录路径 2026-01-10 17:34:08 +08:00
ccnetcore
19e26f4383 ci: 新增发布流程 2026-01-10 17:24:19 +08:00
ccnetcore
699fc54885 feat: 精简模板代码 2026-01-10 17:11:37 +08:00
ccnetcore
05b81b710f feat: 合并提交 2026-01-10 15:41:12 +08:00
wcg
3c9c882c42 feat: 新增系统字典:Vben5通知类型 2026-01-04 14:11:47 +08:00
dubai
176af22572 fix: 把 Yi.Vben5.Vue3 下的 packages 目录放出来 2026-01-04 14:10:59 +08:00
wcg
51ee3fb460 feat(project): 添加vben5前端 2026-01-04 13:45:07 +08:00
wcg
2c0689fe02 fix:删除文件夹 2026-01-04 13:43:01 +08:00
dubai
1c8899ed4f feat: 新增vben5前端 2026-01-04 13:40:02 +08:00
wcg
30c45eeb59 fix(rbac): 修复字典数据种子和菜单种子中的错误 2026-01-04 13:01:12 +08:00
wcg
cbd76d2952 config(App): 允许vben5默认端口5666跨域请求 2026-01-04 11:50:40 +08:00
wcg
9a121af7bd feat(rbac): 添加操作日志标题模糊搜索 2026-01-04 11:31:28 +08:00
wcg
96503a2f15 feat(role): 添加角色菜单和部门树获取功能 2026-01-04 11:29:52 +08:00
wcg
29f61e1dc9 feat(menu): 添加菜单树构建功能和相关接口 2026-01-04 11:05:53 +08:00
wcg
80d8ac2bc8 feat(menu): 添加菜单树构建功能和相关接口 2026-01-04 11:02:13 +08:00
wcg
f77c775229 feat(rbac): 添加Vben5菜单 2026-01-04 10:55:28 +08:00
wcg
38463fc477 feat(rbac): 为字典种子数据添加列表样式类 2026-01-04 10:43:19 +08:00
wcg
5a212d7949 refactor(application): 将 GetSelectDataListAsync 方法返回类型从 PagedResultDto<T> 改为 List<T> 2026-01-04 10:33:16 +08:00
wcg
fe7e2eb660 feat(user): 添加按部门获取用户列表功能 2026-01-04 10:31:46 +08:00
wcg
225d8d4726 feat(dept): 添加排除指定部门及其子孙部门的查询功能 2026-01-04 10:29:10 +08:00
wcg
b69c6d86c1 feat(dept): 添加部门树形结构功能和相关API接口 2026-01-04 10:23:42 +08:00
wcg
fe7c1763ba feat(config): 添加配置数据种子和根据key查询配置功能
- 添加初始密码配置项的种子数据 (sys.user.initPassword: 123456)
- 在 ConfigService 中新增 GetConfigKeyAsync 方法支持根据key查询配置值
2026-01-04 10:13:51 +08:00
橙子
a50c45f7a3 !102 修正删除部门无效问题
Merge pull request !102 from Po/cherry-pick-1765609320
2025-12-14 04:37:59 +00:00
Po
2bc8837155 修正删除部门无效问题 2025-12-13 07:02:19 +00:00
ccnetcore
8a6e5abf48 fix: 修复token鉴权 2025-12-11 23:32:57 +08:00
ccnetcore
8b191330b8 Revert "fix: 仅从 Query 获取 access_token/refresh_token,简化 OnMessageReceived 逻辑"
This reverts commit 0d2f2cb826.
2025-12-11 23:31:29 +08:00
chenchun
0d2f2cb826 fix: 仅从 Query 获取 access_token/refresh_token,简化 OnMessageReceived 逻辑
- 修改文件:Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs
- 将 JwtBearerEvents.OnMessageReceived 的上下文参数名改为 messageContext,统一变量名。
- 简化 Token 获取逻辑:只从 request.Query 中读取 access_token 与 refresh_token,移除从 Cookies(Token)和请求头(refresh_token)读取的分支。
2025-12-11 17:41:38 +08:00
chenchun
571df74c43 chore: 在 common.props 添加 SatelliteResourceLanguages=en;zh-CN
在 Yi.Abp.Net8/common.props 中新增 SatelliteResourceLanguages 属性,指定生成卫星资源语言为 en 和 zh-CN,以便打包对应的本地化资源。
2025-12-10 15:53:18 +08:00
chenchun
cefde6848d perf: 去除35MB又臭又大的腾讯云sdk 2025-12-10 15:10:54 +08:00
ccnetcore
551597765c perf: 优化sqlsguar分页查询 2025-12-07 18:50:02 +08:00
chenchun
5eaffe2ec2 feat: 新增更新并发乐观锁配置与支持
- 在 DbConnOptions 新增 EnabledConcurrencyException(bool,默认 false) 配置项。
- 在 SqlSugarRepository 引入 IAbpLazyServiceProvider,通过 IOptions<DbConnOptions> 延迟获取配置。
- UpdateAsync 改为仅当 EnabledConcurrencyException 为 true 且实体实现 IHasConcurrencyStamp 时,使用 ExecuteCommandWithOptLockAsync 并捕获 VersionExceptions 抛出 AbpDbConcurrencyException;否则回退到原有的 UpdateAsync 实现。
- 清理/调整部分 using 引用,新增 Microsoft.Extensions.Options 与 Volo.Abp.DependencyInjection 引用。

注意:默认值为 false,需在配置中显式开启 EnabledConcurrencyException 才会启用乐观并发校验,开启后会改变之前对带版本实体自动使用乐观锁的行为。
2025-11-17 11:19:15 +08:00
chenchun
2ec7b5f4fd fix: 修复软删除时空引用异常
在 SqlSugarRepository.cs 中对 ISoftDelete 分支增加 GetByIdAsync 返回 null 的判断,避免在实体为 null 时继续反射赋值导致 NullReferenceException。若实体不存在,直接返回 false。
2025-11-13 16:49:44 +08:00
chenchun
4521212a90 feat: 新增文件缓存功能
- 在 Yi.Framework.Rbac.Application.Services.FileService 中注入 IMemoryCache,用于缓存文件元数据,减少对仓储的重复读取。
  - 在 Get 方法中通过 key "File:{code}" 缓存 FileCacheItem,设置绝对过期时间为 1 天。
  - 缓存项使用 Mapster 适配为 FileCacheItem,再适配回 FileAggregateRoot(保留现有逻辑判断和路径获取)。
- 新增缓存模型 Yi.Framework.Rbac.Domain.Shared.Caches.FileCacheItem(包含 Id、FileSize、FileName、FilePath、创建/修改信息等)。
- 增加并调整相关 using 引用(Microsoft.Extensions.Caching.Memory、Volo.Abp.Caching、Domain.Shared.Caches)。
- 同时修复了保存多文件时的缩进/空格格式(不影响功能)。
2025-11-06 11:29:21 +08:00
chenchun
94834f45c3 perf: 使用 FileStreamResult 流式返回文件,避免一次性读取到内存
改为 FileStream 并返回 FileStreamResult,减小内存占用并支持大型文件;修正变量名拼写并添加 null-forgiving 标记。
2025-11-06 11:13:50 +08:00
chenchun
22ac150acd fix: 修正 FileAggregateRoot.FilePath 的赋值,保存目录路径而非包含文件名的完整路径 2025-11-06 10:58:33 +08:00
ccnetcore
1cc5f2a14f refactor: 注释掉 Furion 统一结果 API 注册,保留 ABP 默认处理方式 2025-09-27 17:26:13 +08:00
橙子
d9997eeb28 !100 update Yi.Abp.Net8/framework/Yi.Framework.AspNetCore/UnifyResult/Fiters/FriendlyExceptionFilter.cs.
Merge pull request !100 from Gary/N/A
2025-09-22 07:14:02 +00:00
Gary
06e77aa8fd update Yi.Abp.Net8/framework/Yi.Framework.AspNetCore/UnifyResult/Fiters/FriendlyExceptionFilter.cs.
判断是否为模型验证错误,如果是,将errors传回,并打印日志

Signed-off-by: Gary <1511313969@qq.com>
2025-09-22 07:13:46 +00:00
橙子
e9e2228f6e !97 岗位状态修改
Merge pull request !97 from 嗳摸嫫/jun
2025-09-22 07:13:45 +00:00
橙子
d516a381d0 !98 update Yi.Abp.Net8/framework/Yi.Framework.Mapster/YiFrameworkMapsterModule.cs.
Merge pull request !98 from Gary/N/A
2025-09-22 07:13:26 +00:00
Gary
4e792ba976 update Yi.Abp.Net8/framework/Yi.Framework.Mapster/YiFrameworkMapsterModule.cs.
自动扫描所有继承IRegister 的Mapster 配置

Signed-off-by: Gary <1511313969@qq.com>
2025-09-22 02:58:59 +00:00
chenchun
f90d3871fa feat: 启用 Furion 统一返回结果并优化过滤器配置
- 在 `YiAbpWebModule` 中启用 `AddFurionUnifyResultApi` 以支持 Furion 风格的统一 API 返回格式
- 调整 `UnifyResultExtensions`,移除 `AbpExceptionFilter` 和 `AbpNoContentActionFilter`,确保统一结果过滤器优先执行
2025-09-16 11:48:36 +08:00
HW-July
6005b9329d 岗位状态修改 2025-08-25 17:12:18 +08:00
橙子
9d4b3e7d0c update README.md.
Signed-off-by: 橙子 <454313500@qq.com>
2025-07-05 07:50:10 +00:00
chenchun
72795382a1 style: 调整样式 2025-07-02 15:03:16 +08:00
橙子
35cdff2afa update README.md.
Signed-off-by: 橙子 <454313500@qq.com>
2025-07-02 06:04:18 +00:00
橙子
dcf547f513 style: 新增赞助
Signed-off-by: 橙子 <454313500@qq.com>
2025-07-02 06:03:28 +00:00
橙子
8660d45f36 update README.md.
Signed-off-by: 橙子 <454313500@qq.com>
2025-07-02 06:01:51 +00:00
橙子
63dd55e7a4 !95 修正分页导致部门结构显示异常。取消后台分页功能,同菜单结构无需分页。
Merge pull request !95 from Po/N/A
2025-07-02 03:49:56 +00:00
Po
40cd89f90c 修正分页导致部门结构显示异常。取消后台分页功能,同菜单结构无需分页。
Signed-off-by: Po <448443959@qq.com>
2025-07-02 02:50:06 +00:00
ccnetcore
901ccc7314 feat: 处理短信升级问题 2025-06-02 02:40:22 +08:00
ccnetcore
629add1e8a feat: 支持用户限制 2025-06-02 02:12:38 +08:00
chenchun
8b92cd6bed perf: 支持ai转义 2025-05-01 15:58:43 +08:00
chenchun
e63fb71ef6 fix: 支持ai转义功能 2025-05-01 15:58:03 +08:00
chenchun
aa122d2d82 Merge remote-tracking branch 'origin/abp' into abp 2025-05-01 14:55:45 +08:00
chenchun
5d6bfe36d0 logs: 日志调整 2025-05-01 14:55:32 +08:00
橙子
26dadd7dae !92 优化动态下拉框宽度样式,和延迟获取数据
Merge pull request !92 from JiangCY/abp
2025-04-17 07:09:43 +00:00
橙子
520dca6953 !93 update Yi.RuoYi.Vue3/src/utils/index.js.
Merge pull request !93 from fenngmr/fix-utils-parseTime
2025-04-17 07:09:23 +00:00
fenngmr
699f7febe4 update Yi.RuoYi.Vue3/src/utils/index.js.
Signed-off-by: fenngmr <guo_fengxian@163.com>
2025-04-14 08:11:32 +00:00
橙子
87a14ebac1 feat: 社区新增有偿悬赏功能 2025-04-12 23:18:06 +08:00
JiangCYkk
29573342b5 优化动态下拉框宽度样式,和延迟获取数据 2025-04-08 17:27:26 +08:00
橙子
91b216c06e !91 1.处理删除菜单传参错误的问题;
Merge pull request !91 from JiangCY/abp
2025-03-30 03:29:35 +00:00
JiangCYkk
83a6ec1b98 1.处理删除菜单传参错误的问题;
2.处理字典数据新增修改窗口没有提交按钮的问题;
2025-03-28 16:46:05 +08:00
JiangCYkk
c5d636d697 添加动态数据下拉框,可以通过下拉框筛选获取后台数据;
未实现滚动分页;
2025-03-28 16:45:36 +08:00
JiangCYkk
3d704220f3 添加数据库上下文改为 services.Add() 方法,TryAdd() 让后面的 YiRbacDbContext 无法注入,导致数据权限过滤失效了 2025-03-28 16:45:26 +08:00
橙子
b830317608 Merge remote-tracking branch 'origin/abp' into abp 2025-03-23 17:16:37 +08:00
橙子
21ff599a4e fix: 修复更新事件 2025-03-23 17:15:17 +08:00
chenchun
224c2b96e4 feat: 新增模型 2025-03-21 18:25:22 +08:00
chenchun
cbb3510d94 feat: 重构聊天室语义内核 2025-03-21 18:24:59 +08:00
chenchun
0b111852ec fix: 修复点数问题 2025-03-21 15:51:44 +08:00
chenchun
ff8038a616 fix: 修复股市问题 2025-03-21 15:36:22 +08:00
橙子
710ad95eda feat: 支持默认启用redis 2025-03-18 23:13:16 +08:00
橙子
f7d9effa07 feat: 上线ai股市模块 2025-03-15 00:58:10 +08:00
橙子
cec28faaf7 perf: 优化提示词 2025-03-14 00:14:44 +08:00
橙子
bcdcca82eb fix: 修复排序问题 2025-03-14 00:10:31 +08:00
chenchun
4e0cc9a24a feat: 完善前端界面 2025-03-13 20:45:23 +08:00
chenchun
53a402a656 feat: 优化提示词 2025-03-13 15:30:24 +08:00
橙子
85ed4df1e4 fix: 修复记录时间 2025-03-11 22:00:11 +08:00
chenchun
8ef91ebd03 feat: 完成股票价格生成job 2025-03-11 13:43:26 +08:00
chenchun
ccaebb8ec2 feat: 完善提示词 2025-03-11 13:40:15 +08:00
橙子
4afc1cc492 feat: 新增job db选择 2025-03-10 22:27:54 +08:00
橙子
ddba0f9aa1 style: 修改默认redisdb 2025-03-10 22:08:38 +08:00
橙子
c782246a1d feat: 完成提示词工程 2025-03-09 23:51:30 +08:00
橙子
afa5fad8c6 Merge remote-tracking branch 'origin/stock' into stock 2025-03-09 16:21:52 +08:00
橙子
d605809932 feat: 完善对接接口 2025-03-09 16:21:47 +08:00
橙子
30250db0fb feat: 完善对接接口 2025-03-09 16:21:39 +08:00
橙子
b48f584db8 style: 修改定时任务种子数据 2025-03-08 23:36:03 +08:00
橙子
56d850d74b chorm: 构建 2025-03-08 23:22:01 +08:00
橙子
3ef1323f05 stly: 更换样式 2025-03-08 22:49:08 +08:00
橙子
d9ed547a20 stly: 更换样式 2025-03-08 22:47:30 +08:00
橙子
82865631fc feat: ai完成stock模块搭建 2025-03-08 22:14:26 +08:00
橙子
337088c908 feat: 补充部分功能 2025-03-07 00:35:32 +08:00
橙子
c092ee46e9 feat: 完成ai生成 2025-03-05 23:08:58 +08:00
橙子
287634cf99 feat: 新增ai-stock模块 2025-03-02 01:54:12 +08:00
橙子
c1535fd116 perf: 优化错误提示 2025-03-01 23:43:19 +08:00
橙子
d7d4fd8a48 perf: 优化排行榜页面 2025-03-01 14:58:21 +08:00
橙子
1552b00516 perf: 优化首页 2025-03-01 02:41:33 +08:00
橙子
a40d9b79b4 feat:新增stock页面 2025-03-01 01:53:55 +08:00
橙子
0bc5b1a940 feat:新增stock页面 2025-03-01 01:53:42 +08:00
2195 changed files with 138982 additions and 14633 deletions

6
.gitignore vendored
View File

@@ -154,6 +154,10 @@ PublishScripts/
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# 把 Yi.Vben5.Vue3 下的 packages 目录重新放出来
!**/Yi.Vben5.Vue3/packages/
!**/Yi.Vben5.Vue3/packages/**
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
@@ -265,6 +269,8 @@ src/Acme.BookStore.Blazor.Server.Tiered/Logs/*
**/wwwroot/libs/*
public
dist
# 把 Yi.Vben5.Vue3 下的 public 目录重新放出来
!**/Yi.Vben5.Vue3/apps/web-antd/public/
.vscode
/Yi.Abp.Net8/src/Yi.Abp.Web/appsettings.Development.json
/Yi.Abp.Net8/src/Yi.Abp.Web/appsettings.Production.json

View File

@@ -1,12 +1,18 @@
<h1 align="center"><img align="left" height="150px" src="https://ccnetcore.com/prod-api/wwwroot/logo.png"> Yi框架</h1>
<h4 align="center">一套以用户体验出发的.Net8 Web开源框架</h4>
<h5 align="center">支持Abp.vNext 版本原生版本、Furion版本前端接入Ruoyi/Pure Vue</h5>
<h5 align="center">支持Abp.vNext 版本原生版本、Furion版本前端接入Vben/Ruoyi/Pure Vue</h5>
<h2 align="center">集大成者,终究轮子</h2>
[![star](https://gitee.com/ccnetcore/yi/badge/star.svg?theme=dark)](https://gitee.com/ccnetcore/Yi)
[![fork](https://gitee.com/ccnetcore/yi/badge/fork.svg?theme=dark)](https://gitee.com/ccnetcore/Yi)
[![license](https://img.shields.io/badge/license-MIT-yellow)](https://gitee.com/ccnetcore/Yi)
本项目 CDN 加速及安全防护由 Tencent EdgeOne 赞助
[亚洲最佳CDN、边缘和安全解决方案 - Tencent EdgeOne](https://edgeone.ai/zh?from=github)
<img src="readme/edgeone.png"/>
[English](README-en.md) | 简体中文
****
## 🍍 简介:
@@ -33,14 +39,17 @@ Yi框架-一套与SqlSugar一样爽的.Net8开源框架。
**分支目录:**
- 分支**Abp**: 基于Abp.vNext分支DDD领域驱动设计,回归开发本质,极度简单,一个后台支持以下多个前端
- 分支**main**: 基于Abp.vNext分支默认分支只使用Rbac权限管理后台
- 分支**abp**: 基于Abp.vNext分支完整分支具备超多内置模块
- Yi.Abp.Net8后端
- Yi.Bbs.Vue3Bbs社区 前端
- Yi.Doc.Md: 开源文档教程
- Yi.Vben5.Vue3Vben ts后台前端
- Yi.Pure.Vue3Pure ts后台前端
- Yi.RuoYi.Vue3RuoYi js后台前端
****
## 🍉 docker 一键启动
@@ -50,7 +59,7 @@ Yi框架-一套与SqlSugar一样爽的.Net8开源框架。
bbs前端`docker run -d --name yi.bbs -p 18001:18001 -v /home/Yi/Yi.Bbs.Vue3/yi-bbs.conf:/etc/nginx/conf.d/yi-bbs.conf jiftcc/yi.bbs:last`
> 另外我们提供docker的build操作我们更希望你能通过此种方式二开构建属于自己的镜像
> 另外我们提供docker的build操作我们更希望你能通过此种方式二开构建属于自己的镜像,因为上面镜像更新不及时
****
@@ -58,11 +67,24 @@ bbs前端`docker run -d --name yi.bbs -p 18001:18001 -v /home/Yi/Yi.Bbs.Vue3/
废话少说直接上地址
Yi社区官网网址Bbs社区正式[ccnetcore.com](https://ccnetcore.com) (已上线,欢迎加入)
- Yi社区官网网址Bbs社区正式[ccnetcore.com](https://ccnetcore.com) (已上线,欢迎加入)
Rbac后台演示地址https://ccnetcore.com:1000 用户cc、密码123456
DotNet后端主要由SharpDance 意框架官方团队 及 数百名 开源用户 共同维护
Pure后台演示地址https://ccnetcore.com:1001 用户cc、密码123456
- Vben后台演示地址https://data.ccnetcore.com:2000 用户cc、密码123456
Vben前端主要由【https://gitee.com/vichen2021】贡献维护
- Ruoyi后台演示地址https://data.ccnetcore.com:1000 用户cc、密码123456
Ruoyi前端主要由30多名开源用户共同贡献维护
- Pure后台演示地址https://data.ccnetcore.com:1001 用户cc、密码123456
Pure前端主要由3名开源用户共同贡献维护
## 🍏 支持:
@@ -112,8 +134,13 @@ Pure后台演示地址https://ccnetcore.com:1001 用户cc、密码123456
- [SqlSugar官网](https://www.donet5.com/home/doc)
## 🍅 内置模块简介
- Rbac权限管理系统已上线支持pure、ruoyi前端
- Bbs论坛社区系统已上线
- rbac 权限管理系统已上线支持vben、pure、ruoyi前端
- bbs 论坛社区系统(已上线)
- ai-stock Ai模拟炒股系统已上线
- chat-hub Ai在线聊天室系统已上线
- code-gen 代码生成器工具系统(已上线)
- digital-collectibles 数字藏品小程序系统(已上线)
> 重复的东西,无需再写一遍,这也是优雅的体现之一
@@ -134,14 +161,6 @@ C# Asp.NetCore 8.0
- [x] 分布式缓存Abp.vNext
- [x] 事件总线Abp.vNext
#### 前端
js Vue3
- [x] 异步请求axios
- [x] 图表echarts
- [x] uielement-plus
- [x] 存储pinia
- [x] 路由vue-router
- [x] 打包vite
#### 运维
- [x] 部署nginx
@@ -168,24 +187,16 @@ js Vue3
- 缓存列表
- 服务监控
#### 🍐 BBS社区论坛系统持续更新
采用vue3前端
- 文章功能
- 板块功能
- 主题功能
- 个人中心
- 授权中心
- 权限管理
#### 🍉 演示截图:
<table>
<tr>
<td><img src="readme/101.png"/></td>
<td><img src="readme/102.png"/></td>
<td><img src="readme/303.png"/></td>
<td><img src="readme/304.png"/></td>
</tr>
<tr>
<td><img src="readme/103.png"/></td>
<td><img src="readme/104.png"/></td>
<td><img src="readme/301.png"/></td>
<td><img src="readme/302.png"/></td>
</tr>
</table>
@@ -256,6 +267,8 @@ js Vue3
[Furion百小僧]https://furion.baiqian.ltd/
[du白]https://gitee.com/vichen2021
****
## 🌽 联系我们:
@@ -263,7 +276,7 @@ js Vue3
QQ交流群官方一群已满、官方二群已满、官方三群`786308927`(已满)、官方四群:`498310311`(已满)、官方五群:`981136525`
微信交流群:官方微信一群(已满)、官方微信二群(已满)、官方微信三群
微信交流群:官方微信一群(已满)、官方微信二群(已满)、官方微信三群(已满)、官方微信四群(即满)
微信交流群:加作者微信 chengzilaoge520 橙子老哥520备注拉群
@@ -274,6 +287,12 @@ QQ交流群官方一群已满、官方二群已满、官方三群
****
## 🍄 FQA:
前往官网查看留言区
如何修改仓库代码请直接pr即可官方团队会第一时间处理目前前端都是pr来的
gitee仓库官方地址https://gitee.com/ccnetcore/Yi
github仓库官方地址https://github.com/ccnetcore/Yi.Abp.Admin
前往官网查看留言区:
[留言区](https://ccnetcore.com/discuss/1641030787056930818)

View File

@@ -64,18 +64,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Rbac.Domain.Sh
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Rbac.SqlSugarCore", "module\rbac\Yi.Framework.Rbac.SqlSugarCore\Yi.Framework.Rbac.SqlSugarCore.csproj", "{4503A2F9-139D-4CBC-AF11-689C34F0D77B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "bbs", "bbs", "{E902A945-4F41-4E96-A0DA-9F66CDA22261}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Bbs.Domain.Shared", "module\bbs\Yi.Framework.Bbs.Domain.Shared\Yi.Framework.Bbs.Domain.Shared.csproj", "{EB9349E2-256D-41EB-A345-21635A1361B3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Bbs.Domain", "module\bbs\Yi.Framework.Bbs.Domain\Yi.Framework.Bbs.Domain.csproj", "{4EABBC84-BCED-46C1-8CF1-62A7B8081ED7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Bbs.Application.Contracts", "module\bbs\Yi.Framework.Bbs.Application.Contracts\Yi.Framework.Bbs.Application.Contracts.csproj", "{7E569FD9-B1AB-4848-8AB7-FD9EFA1DBA20}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Bbs.Application", "module\bbs\Yi.Framework.Bbs.Application\Yi.Framework.Bbs.Application.csproj", "{AD4EE9E6-F4A3-4139-AF05-71388167DE5B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Bbs.SqlSugarCore", "module\bbs\Yi.Framework.Bbs.SqlSugarCore\Yi.Framework.Bbs.SqlSugarCore.csproj", "{6C86BA71-9F87-4E2C-B467-2950D77DCDFA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "audit-logging", "audit-logging", "{73CCF2C4-B9FD-44AB-8D4B-0A421805B094}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.AuditLogging.SqlSugarCore", "module\audit-logging\Yi.Framework.AuditLogging.SqlSugarCore\Yi.Framework.AuditLogging.SqlSugarCore.csproj", "{48806510-8E18-4E1E-9BAF-5B97E88C5FC3}"
@@ -98,20 +86,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.TenantManageme
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.TenantManagement.Application.Contracts", "module\tenant-management\Yi.Framework.TenantManagement.Application.Contracts\Yi.Framework.TenantManagement.Application.Contracts.csproj", "{FA735055-CBDD-4EFD-B84B-85810DA1425E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "code-gen", "code-gen", "{4FFE7212-21F2-476D-B628-3C65E6C5075E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.CodeGen.Application", "module\code-gen\Yi.Framework.CodeGen.Application\Yi.Framework.CodeGen.Application.csproj", "{97EC40D7-DBFA-467A-98CB-221AF27B14F2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.CodeGen.Application.Contracts", "module\code-gen\Yi.Framework.CodeGen.Application.Contracts\Yi.Framework.CodeGen.Application.Contracts.csproj", "{882BC563-2F75-4B95-AC96-F4BF23F5E69D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.CodeGen.Domain", "module\code-gen\Yi.Framework.CodeGen.Domain\Yi.Framework.CodeGen.Domain.csproj", "{85CB8517-2B80-42D8-B954-081079AC9BA0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.CodeGen.Domain.Shared", "module\code-gen\Yi.Framework.CodeGen.Domain.Shared\Yi.Framework.CodeGen.Domain.Shared.csproj", "{EEFF0F05-2709-4151-A8CE-667935CEAE0B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Caching.FreeRedis", "framework\Yi.Framework.Caching.FreeRedis\Yi.Framework.Caching.FreeRedis.csproj", "{862BB0EF-3D4E-44FF-AB15-0EB74CE553D3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.CodeGen.SqlSugarCore", "module\code-gen\Yi.Framework.CodeGen.SqlSugarCore\Yi.Framework.CodeGen.SqlSugarCore.csproj", "{FB09ACC2-A27D-4D87-8D85-1435FDED4D04}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "client", "client", "{8B27846A-043D-4F2F-8140-5CEC9D1863B5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Abp.HttpApi.Client", "client\Yi.Abp.HttpApi.Client\Yi.Abp.HttpApi.Client.csproj", "{6B554DCC-3A81-4624-9141-4E39365ADA35}"
@@ -126,18 +102,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.SettingManagem
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.SettingManagement.SqlSugarCore", "module\setting-management\Yi.Framework.SettingManagement.SqlSugarCore\Yi.Framework.SettingManagement.SqlSugarCore.csproj", "{495C4643-39D4-46E7-BDC8-237589627BE4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "chat-hub", "chat-hub", "{D8CDDE99-3684-4EED-A5E5-87F2AF4C78AB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.ChatHub.Application.Contracts", "module\chat-hub\Yi.Framework.ChatHub.Application.Contracts\Yi.Framework.ChatHub.Application.Contracts.csproj", "{65D4D033-5504-44B9-B152-0172ACD64CE6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.ChatHub.Domain.Shared", "module\chat-hub\Yi.Framework.ChatHub.Domain.Shared\Yi.Framework.ChatHub.Domain.Shared.csproj", "{DEEC0B15-190C-4464-B469-C45C6563C592}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.ChatHub.SqlSugarCore", "module\chat-hub\Yi.Framework.ChatHub.SqlSugarCore\Yi.Framework.ChatHub.SqlSugarCore.csproj", "{E476D266-8FB2-4D6B-AE2B-F0D279D4264E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.ChatHub.Domain", "module\chat-hub\Yi.Framework.ChatHub.Domain\Yi.Framework.ChatHub.Domain.csproj", "{C2DCA2FD-BFB4-4E76-967B-0AF8CC4F4D47}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.ChatHub.Application", "module\chat-hub\Yi.Framework.ChatHub.Application\Yi.Framework.ChatHub.Application.csproj", "{B7A1A8F3-CFA6-4ECF-A707-0F33FE0A6F1D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Rbac.Test", "test\Yi.Framework.Rbac.Test\Yi.Framework.Rbac.Test.csproj", "{9ECF0841-53BE-4FD8-95D1-A7223C7F3A07}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tool", "tool", "{084CBEEC-5D37-4716-B9C7-D80D6960DFF4}"
@@ -158,34 +122,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Abp.Tool.HttpApi.Client"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.SettingManagement.Application", "module\setting-management\Yi.Framework.SettingManagement.Application\Yi.Framework.SettingManagement.Application.csproj", "{2A31D7CB-BDCC-4253-BA73-273B6B5E1956}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "digital-collectibles", "digital-collectibles", "{B8F76A6B-2EEB-4E64-9F26-D84584E16B9C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.DigitalCollectibles.Application", "module\digital-collectibles\Yi.Framework.DigitalCollectibles.Application\Yi.Framework.DigitalCollectibles.Application.csproj", "{236B88D4-F018-4A5F-A506-7458F2308C70}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.DigitalCollectibles.Application.Contracts", "module\digital-collectibles\Yi.Framework.DigitalCollectibles.Application.Contracts\Yi.Framework.DigitalCollectibles.Application.Contracts.csproj", "{4FE7AC0E-91CC-4DF1-ACA7-ED83483C3F3B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.DigitalCollectibles.Domain", "module\digital-collectibles\Yi.Framework.DigitalCollectibles.Domain\Yi.Framework.DigitalCollectibles.Domain.csproj", "{9B5CAE1A-E062-4C9B-8121-E58FBF69309C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.DigitalCollectibles.Domain.Shared", "module\digital-collectibles\Yi.Framework.DigitalCollectibles.Domain.Shared\Yi.Framework.DigitalCollectibles.Domain.Shared.csproj", "{FFEC9DA6-1A13-480A-AE9E-2BF8763D3061}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.DigitalCollectibles.SqlSugarCore", "module\digital-collectibles\Yi.Framework.DigitalCollectibles.SqlSugarCore\Yi.Framework.DigitalCollectibles.SqlSugarCore.csproj", "{4CE6E4AE-0BA4-4984-A4F1-A9A414B1BB8F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.WeChat.MiniProgram", "framework\Yi.Framework.WeChat.MiniProgram\Yi.Framework.WeChat.MiniProgram.csproj", "{81CEA2ED-917B-41D8-BE0D-39A785B050C0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.BackgroundWorkers.Hangfire", "framework\Yi.Framework.BackgroundWorkers.Hangfire\Yi.Framework.BackgroundWorkers.Hangfire.csproj", "{862CA181-BEE6-4870-82D2-B662E527ED8C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "stock", "stock", "{DB46873F-981A-43D8-91B0-D464CCB65943}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.Stock.Application", "module\stock\Yi.Framework.Stock.Application\Yi.Framework.Stock.Application.csproj", "{B79CE23C-10F8-48A5-A039-5940A188CF5A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.Stock.Application.Contracts", "module\stock\Yi.Framework.Stock.Application.Contracts\Yi.Framework.Stock.Application.Contracts.csproj", "{846B781A-B77E-4F86-A31F-0B5B57AB0775}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.Stock.Domain", "module\stock\Yi.Framework.Stock.Domain\Yi.Framework.Stock.Domain.csproj", "{162821E4-8FE0-4A68-B3C0-49BD6596446F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.Stock.Domain.Shared", "module\stock\Yi.Framework.Stock.Domain.Shared\Yi.Framework.Stock.Domain.Shared.csproj", "{10273544-715D-4BB3-893C-6F010D947BDD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.Stock.SqlSugarCore", "module\stock\Yi.Framework.Stock.SqlSugarCore\Yi.Framework.Stock.SqlSugarCore.csproj", "{5F49318F-E6C7-4194-BAE0-83D4FB8D1983}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -264,26 +204,6 @@ Global
{4503A2F9-139D-4CBC-AF11-689C34F0D77B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4503A2F9-139D-4CBC-AF11-689C34F0D77B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4503A2F9-139D-4CBC-AF11-689C34F0D77B}.Release|Any CPU.Build.0 = Release|Any CPU
{EB9349E2-256D-41EB-A345-21635A1361B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EB9349E2-256D-41EB-A345-21635A1361B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB9349E2-256D-41EB-A345-21635A1361B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB9349E2-256D-41EB-A345-21635A1361B3}.Release|Any CPU.Build.0 = Release|Any CPU
{4EABBC84-BCED-46C1-8CF1-62A7B8081ED7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4EABBC84-BCED-46C1-8CF1-62A7B8081ED7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4EABBC84-BCED-46C1-8CF1-62A7B8081ED7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4EABBC84-BCED-46C1-8CF1-62A7B8081ED7}.Release|Any CPU.Build.0 = Release|Any CPU
{7E569FD9-B1AB-4848-8AB7-FD9EFA1DBA20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7E569FD9-B1AB-4848-8AB7-FD9EFA1DBA20}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7E569FD9-B1AB-4848-8AB7-FD9EFA1DBA20}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7E569FD9-B1AB-4848-8AB7-FD9EFA1DBA20}.Release|Any CPU.Build.0 = Release|Any CPU
{AD4EE9E6-F4A3-4139-AF05-71388167DE5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AD4EE9E6-F4A3-4139-AF05-71388167DE5B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AD4EE9E6-F4A3-4139-AF05-71388167DE5B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AD4EE9E6-F4A3-4139-AF05-71388167DE5B}.Release|Any CPU.Build.0 = Release|Any CPU
{6C86BA71-9F87-4E2C-B467-2950D77DCDFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6C86BA71-9F87-4E2C-B467-2950D77DCDFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6C86BA71-9F87-4E2C-B467-2950D77DCDFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6C86BA71-9F87-4E2C-B467-2950D77DCDFA}.Release|Any CPU.Build.0 = Release|Any CPU
{48806510-8E18-4E1E-9BAF-5B97E88C5FC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{48806510-8E18-4E1E-9BAF-5B97E88C5FC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{48806510-8E18-4E1E-9BAF-5B97E88C5FC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -320,30 +240,10 @@ Global
{FA735055-CBDD-4EFD-B84B-85810DA1425E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FA735055-CBDD-4EFD-B84B-85810DA1425E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FA735055-CBDD-4EFD-B84B-85810DA1425E}.Release|Any CPU.Build.0 = Release|Any CPU
{97EC40D7-DBFA-467A-98CB-221AF27B14F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{97EC40D7-DBFA-467A-98CB-221AF27B14F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{97EC40D7-DBFA-467A-98CB-221AF27B14F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{97EC40D7-DBFA-467A-98CB-221AF27B14F2}.Release|Any CPU.Build.0 = Release|Any CPU
{882BC563-2F75-4B95-AC96-F4BF23F5E69D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{882BC563-2F75-4B95-AC96-F4BF23F5E69D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{882BC563-2F75-4B95-AC96-F4BF23F5E69D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{882BC563-2F75-4B95-AC96-F4BF23F5E69D}.Release|Any CPU.Build.0 = Release|Any CPU
{85CB8517-2B80-42D8-B954-081079AC9BA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{85CB8517-2B80-42D8-B954-081079AC9BA0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{85CB8517-2B80-42D8-B954-081079AC9BA0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{85CB8517-2B80-42D8-B954-081079AC9BA0}.Release|Any CPU.Build.0 = Release|Any CPU
{EEFF0F05-2709-4151-A8CE-667935CEAE0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EEFF0F05-2709-4151-A8CE-667935CEAE0B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EEFF0F05-2709-4151-A8CE-667935CEAE0B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EEFF0F05-2709-4151-A8CE-667935CEAE0B}.Release|Any CPU.Build.0 = Release|Any CPU
{862BB0EF-3D4E-44FF-AB15-0EB74CE553D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{862BB0EF-3D4E-44FF-AB15-0EB74CE553D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{862BB0EF-3D4E-44FF-AB15-0EB74CE553D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{862BB0EF-3D4E-44FF-AB15-0EB74CE553D3}.Release|Any CPU.Build.0 = Release|Any CPU
{FB09ACC2-A27D-4D87-8D85-1435FDED4D04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FB09ACC2-A27D-4D87-8D85-1435FDED4D04}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FB09ACC2-A27D-4D87-8D85-1435FDED4D04}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FB09ACC2-A27D-4D87-8D85-1435FDED4D04}.Release|Any CPU.Build.0 = Release|Any CPU
{6B554DCC-3A81-4624-9141-4E39365ADA35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6B554DCC-3A81-4624-9141-4E39365ADA35}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6B554DCC-3A81-4624-9141-4E39365ADA35}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -364,26 +264,6 @@ Global
{495C4643-39D4-46E7-BDC8-237589627BE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{495C4643-39D4-46E7-BDC8-237589627BE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{495C4643-39D4-46E7-BDC8-237589627BE4}.Release|Any CPU.Build.0 = Release|Any CPU
{65D4D033-5504-44B9-B152-0172ACD64CE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{65D4D033-5504-44B9-B152-0172ACD64CE6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{65D4D033-5504-44B9-B152-0172ACD64CE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{65D4D033-5504-44B9-B152-0172ACD64CE6}.Release|Any CPU.Build.0 = Release|Any CPU
{DEEC0B15-190C-4464-B469-C45C6563C592}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DEEC0B15-190C-4464-B469-C45C6563C592}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DEEC0B15-190C-4464-B469-C45C6563C592}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DEEC0B15-190C-4464-B469-C45C6563C592}.Release|Any CPU.Build.0 = Release|Any CPU
{E476D266-8FB2-4D6B-AE2B-F0D279D4264E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E476D266-8FB2-4D6B-AE2B-F0D279D4264E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E476D266-8FB2-4D6B-AE2B-F0D279D4264E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E476D266-8FB2-4D6B-AE2B-F0D279D4264E}.Release|Any CPU.Build.0 = Release|Any CPU
{C2DCA2FD-BFB4-4E76-967B-0AF8CC4F4D47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C2DCA2FD-BFB4-4E76-967B-0AF8CC4F4D47}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C2DCA2FD-BFB4-4E76-967B-0AF8CC4F4D47}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C2DCA2FD-BFB4-4E76-967B-0AF8CC4F4D47}.Release|Any CPU.Build.0 = Release|Any CPU
{B7A1A8F3-CFA6-4ECF-A707-0F33FE0A6F1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B7A1A8F3-CFA6-4ECF-A707-0F33FE0A6F1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7A1A8F3-CFA6-4ECF-A707-0F33FE0A6F1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7A1A8F3-CFA6-4ECF-A707-0F33FE0A6F1D}.Release|Any CPU.Build.0 = Release|Any CPU
{9ECF0841-53BE-4FD8-95D1-A7223C7F3A07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9ECF0841-53BE-4FD8-95D1-A7223C7F3A07}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9ECF0841-53BE-4FD8-95D1-A7223C7F3A07}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -420,26 +300,6 @@ Global
{2A31D7CB-BDCC-4253-BA73-273B6B5E1956}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A31D7CB-BDCC-4253-BA73-273B6B5E1956}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A31D7CB-BDCC-4253-BA73-273B6B5E1956}.Release|Any CPU.Build.0 = Release|Any CPU
{236B88D4-F018-4A5F-A506-7458F2308C70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{236B88D4-F018-4A5F-A506-7458F2308C70}.Debug|Any CPU.Build.0 = Debug|Any CPU
{236B88D4-F018-4A5F-A506-7458F2308C70}.Release|Any CPU.ActiveCfg = Release|Any CPU
{236B88D4-F018-4A5F-A506-7458F2308C70}.Release|Any CPU.Build.0 = Release|Any CPU
{4FE7AC0E-91CC-4DF1-ACA7-ED83483C3F3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4FE7AC0E-91CC-4DF1-ACA7-ED83483C3F3B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4FE7AC0E-91CC-4DF1-ACA7-ED83483C3F3B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4FE7AC0E-91CC-4DF1-ACA7-ED83483C3F3B}.Release|Any CPU.Build.0 = Release|Any CPU
{9B5CAE1A-E062-4C9B-8121-E58FBF69309C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9B5CAE1A-E062-4C9B-8121-E58FBF69309C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9B5CAE1A-E062-4C9B-8121-E58FBF69309C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9B5CAE1A-E062-4C9B-8121-E58FBF69309C}.Release|Any CPU.Build.0 = Release|Any CPU
{FFEC9DA6-1A13-480A-AE9E-2BF8763D3061}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FFEC9DA6-1A13-480A-AE9E-2BF8763D3061}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FFEC9DA6-1A13-480A-AE9E-2BF8763D3061}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FFEC9DA6-1A13-480A-AE9E-2BF8763D3061}.Release|Any CPU.Build.0 = Release|Any CPU
{4CE6E4AE-0BA4-4984-A4F1-A9A414B1BB8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CE6E4AE-0BA4-4984-A4F1-A9A414B1BB8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CE6E4AE-0BA4-4984-A4F1-A9A414B1BB8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4CE6E4AE-0BA4-4984-A4F1-A9A414B1BB8F}.Release|Any CPU.Build.0 = Release|Any CPU
{81CEA2ED-917B-41D8-BE0D-39A785B050C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{81CEA2ED-917B-41D8-BE0D-39A785B050C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{81CEA2ED-917B-41D8-BE0D-39A785B050C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -448,26 +308,6 @@ Global
{862CA181-BEE6-4870-82D2-B662E527ED8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{862CA181-BEE6-4870-82D2-B662E527ED8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{862CA181-BEE6-4870-82D2-B662E527ED8C}.Release|Any CPU.Build.0 = Release|Any CPU
{B79CE23C-10F8-48A5-A039-5940A188CF5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B79CE23C-10F8-48A5-A039-5940A188CF5A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B79CE23C-10F8-48A5-A039-5940A188CF5A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B79CE23C-10F8-48A5-A039-5940A188CF5A}.Release|Any CPU.Build.0 = Release|Any CPU
{846B781A-B77E-4F86-A31F-0B5B57AB0775}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{846B781A-B77E-4F86-A31F-0B5B57AB0775}.Debug|Any CPU.Build.0 = Debug|Any CPU
{846B781A-B77E-4F86-A31F-0B5B57AB0775}.Release|Any CPU.ActiveCfg = Release|Any CPU
{846B781A-B77E-4F86-A31F-0B5B57AB0775}.Release|Any CPU.Build.0 = Release|Any CPU
{162821E4-8FE0-4A68-B3C0-49BD6596446F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{162821E4-8FE0-4A68-B3C0-49BD6596446F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{162821E4-8FE0-4A68-B3C0-49BD6596446F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{162821E4-8FE0-4A68-B3C0-49BD6596446F}.Release|Any CPU.Build.0 = Release|Any CPU
{10273544-715D-4BB3-893C-6F010D947BDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{10273544-715D-4BB3-893C-6F010D947BDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{10273544-715D-4BB3-893C-6F010D947BDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{10273544-715D-4BB3-893C-6F010D947BDD}.Release|Any CPU.Build.0 = Release|Any CPU
{5F49318F-E6C7-4194-BAE0-83D4FB8D1983}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5F49318F-E6C7-4194-BAE0-83D4FB8D1983}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5F49318F-E6C7-4194-BAE0-83D4FB8D1983}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5F49318F-E6C7-4194-BAE0-83D4FB8D1983}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -492,12 +332,6 @@ Global
{C04D3F71-1557-46D0-B810-97B1FBB6AB73} = {9CC7A457-1236-40BA-B47B-E7B710A3F061}
{A2BB899D-4F9A-4184-81BD-94B938E2AB03} = {9CC7A457-1236-40BA-B47B-E7B710A3F061}
{4503A2F9-139D-4CBC-AF11-689C34F0D77B} = {9CC7A457-1236-40BA-B47B-E7B710A3F061}
{E902A945-4F41-4E96-A0DA-9F66CDA22261} = {2317227D-7796-4E7B-BEDB-7CD1CAE7B853}
{EB9349E2-256D-41EB-A345-21635A1361B3} = {E902A945-4F41-4E96-A0DA-9F66CDA22261}
{4EABBC84-BCED-46C1-8CF1-62A7B8081ED7} = {E902A945-4F41-4E96-A0DA-9F66CDA22261}
{7E569FD9-B1AB-4848-8AB7-FD9EFA1DBA20} = {E902A945-4F41-4E96-A0DA-9F66CDA22261}
{AD4EE9E6-F4A3-4139-AF05-71388167DE5B} = {E902A945-4F41-4E96-A0DA-9F66CDA22261}
{6C86BA71-9F87-4E2C-B467-2950D77DCDFA} = {E902A945-4F41-4E96-A0DA-9F66CDA22261}
{73CCF2C4-B9FD-44AB-8D4B-0A421805B094} = {2317227D-7796-4E7B-BEDB-7CD1CAE7B853}
{48806510-8E18-4E1E-9BAF-5B97E88C5FC3} = {73CCF2C4-B9FD-44AB-8D4B-0A421805B094}
{791AC2FA-50D3-4408-8D68-31DA72F608BE} = {77B949E9-530E-45A5-9657-20F7D5C6875C}
@@ -509,25 +343,13 @@ Global
{9C8C3C53-3DCE-4516-867E-228858E61B26} = {73CCF2C4-B9FD-44AB-8D4B-0A421805B094}
{17816837-E53B-486B-B796-53C601FE6CD9} = {499A8C71-7892-42D0-A77E-48756E1EFF16}
{FA735055-CBDD-4EFD-B84B-85810DA1425E} = {499A8C71-7892-42D0-A77E-48756E1EFF16}
{4FFE7212-21F2-476D-B628-3C65E6C5075E} = {2317227D-7796-4E7B-BEDB-7CD1CAE7B853}
{97EC40D7-DBFA-467A-98CB-221AF27B14F2} = {4FFE7212-21F2-476D-B628-3C65E6C5075E}
{882BC563-2F75-4B95-AC96-F4BF23F5E69D} = {4FFE7212-21F2-476D-B628-3C65E6C5075E}
{85CB8517-2B80-42D8-B954-081079AC9BA0} = {4FFE7212-21F2-476D-B628-3C65E6C5075E}
{EEFF0F05-2709-4151-A8CE-667935CEAE0B} = {4FFE7212-21F2-476D-B628-3C65E6C5075E}
{862BB0EF-3D4E-44FF-AB15-0EB74CE553D3} = {77B949E9-530E-45A5-9657-20F7D5C6875C}
{FB09ACC2-A27D-4D87-8D85-1435FDED4D04} = {4FFE7212-21F2-476D-B628-3C65E6C5075E}
{6B554DCC-3A81-4624-9141-4E39365ADA35} = {8B27846A-043D-4F2F-8140-5CEC9D1863B5}
{2D23B44A-DFA3-4C36-8516-4F5AE442403C} = {8B27846A-043D-4F2F-8140-5CEC9D1863B5}
{00E49781-C6A0-491C-86A1-46F685C90915} = {8B27846A-043D-4F2F-8140-5CEC9D1863B5}
{8C68059E-F3B1-4D28-A1C9-A5830F53E5D3} = {2317227D-7796-4E7B-BEDB-7CD1CAE7B853}
{6FEE0EB3-EAD2-47F8-B6FC-3D0FD3CCABFF} = {8C68059E-F3B1-4D28-A1C9-A5830F53E5D3}
{495C4643-39D4-46E7-BDC8-237589627BE4} = {8C68059E-F3B1-4D28-A1C9-A5830F53E5D3}
{D8CDDE99-3684-4EED-A5E5-87F2AF4C78AB} = {2317227D-7796-4E7B-BEDB-7CD1CAE7B853}
{65D4D033-5504-44B9-B152-0172ACD64CE6} = {D8CDDE99-3684-4EED-A5E5-87F2AF4C78AB}
{DEEC0B15-190C-4464-B469-C45C6563C592} = {D8CDDE99-3684-4EED-A5E5-87F2AF4C78AB}
{E476D266-8FB2-4D6B-AE2B-F0D279D4264E} = {D8CDDE99-3684-4EED-A5E5-87F2AF4C78AB}
{C2DCA2FD-BFB4-4E76-967B-0AF8CC4F4D47} = {D8CDDE99-3684-4EED-A5E5-87F2AF4C78AB}
{B7A1A8F3-CFA6-4ECF-A707-0F33FE0A6F1D} = {D8CDDE99-3684-4EED-A5E5-87F2AF4C78AB}
{9ECF0841-53BE-4FD8-95D1-A7223C7F3A07} = {0D10EEF2-FBAE-4C72-B816-A52823FC299B}
{4FEBBDD9-E4F4-4BAF-8599-E2D57C08A74F} = {084CBEEC-5D37-4716-B9C7-D80D6960DFF4}
{2CE51D4C-1EF9-462B-BA14-7EA01A7E4AF1} = {084CBEEC-5D37-4716-B9C7-D80D6960DFF4}
@@ -537,20 +359,8 @@ Global
{4AE84CDE-2A47-4D68-8E93-86193F72E4E8} = {084CBEEC-5D37-4716-B9C7-D80D6960DFF4}
{C8F97775-D903-4365-A4FF-3DA97E318CD2} = {084CBEEC-5D37-4716-B9C7-D80D6960DFF4}
{2A31D7CB-BDCC-4253-BA73-273B6B5E1956} = {8C68059E-F3B1-4D28-A1C9-A5830F53E5D3}
{B8F76A6B-2EEB-4E64-9F26-D84584E16B9C} = {2317227D-7796-4E7B-BEDB-7CD1CAE7B853}
{236B88D4-F018-4A5F-A506-7458F2308C70} = {B8F76A6B-2EEB-4E64-9F26-D84584E16B9C}
{4FE7AC0E-91CC-4DF1-ACA7-ED83483C3F3B} = {B8F76A6B-2EEB-4E64-9F26-D84584E16B9C}
{9B5CAE1A-E062-4C9B-8121-E58FBF69309C} = {B8F76A6B-2EEB-4E64-9F26-D84584E16B9C}
{FFEC9DA6-1A13-480A-AE9E-2BF8763D3061} = {B8F76A6B-2EEB-4E64-9F26-D84584E16B9C}
{4CE6E4AE-0BA4-4984-A4F1-A9A414B1BB8F} = {B8F76A6B-2EEB-4E64-9F26-D84584E16B9C}
{81CEA2ED-917B-41D8-BE0D-39A785B050C0} = {77B949E9-530E-45A5-9657-20F7D5C6875C}
{862CA181-BEE6-4870-82D2-B662E527ED8C} = {77B949E9-530E-45A5-9657-20F7D5C6875C}
{DB46873F-981A-43D8-91B0-D464CCB65943} = {2317227D-7796-4E7B-BEDB-7CD1CAE7B853}
{B79CE23C-10F8-48A5-A039-5940A188CF5A} = {DB46873F-981A-43D8-91B0-D464CCB65943}
{846B781A-B77E-4F86-A31F-0B5B57AB0775} = {DB46873F-981A-43D8-91B0-D464CCB65943}
{162821E4-8FE0-4A68-B3C0-49BD6596446F} = {DB46873F-981A-43D8-91B0-D464CCB65943}
{10273544-715D-4BB3-893C-6F010D947BDD} = {DB46873F-981A-43D8-91B0-D464CCB65943}
{5F49318F-E6C7-4194-BAE0-83D4FB8D1983} = {DB46873F-981A-43D8-91B0-D464CCB65943}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {23D6FBC9-C970-4641-BC1E-2AEA59F51C18}

View File

@@ -12,6 +12,7 @@
</PropertyGroup>
<PropertyGroup>
<SatelliteResourceLanguages>en;zh-CN</SatelliteResourceLanguages>
<LangVersion>latest</LangVersion>
<Version>1.0.0</Version>
<NoWarn>$(NoWarn);CS1591;CS8618;CS1998;CS8604;CS8620;CS8600;CS8602</NoWarn>

View File

@@ -20,12 +20,12 @@ namespace Yi.Framework.AspNetCore.Microsoft.AspNetCore.Middlewares
/// <returns>异步任务</returns>
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
{
// 在响应开始时处理文件下载相关的响应头
context.Response.OnStarting(() =>
{
HandleFileDownloadResponse(context);
return Task.CompletedTask;
});
// // 在响应开始时处理文件下载相关的响应头
// context.Response.OnStarting(() =>
// {
// HandleFileDownloadResponse(context);
// return Task.CompletedTask;
// });
// 继续处理管道中的下一个中间件
await next(context);

View File

@@ -1,4 +1,4 @@
// MIT 许可证
// MIT 许可证
//
// 版权 © 2020-present 百小僧, 百签科技(广东)有限公司 和所有贡献者
//
@@ -17,25 +17,25 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Validation;
using Yi.Framework.Core.Extensions;
namespace Yi.Framework.AspNetCore.UnifyResult.Fiters;
/// <summary>
/// 友好异常拦截器
/// 友好异常拦截器
/// </summary>
public sealed class FriendlyExceptionFilter : IAsyncExceptionFilter
{
/// <summary>
/// 异常拦截
/// 异常拦截
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public async Task OnExceptionAsync(ExceptionContext context)
{
// 排除 WebSocket 请求处理
if (context.HttpContext.IsWebSocketRequest()) return;
@@ -44,20 +44,23 @@ public sealed class FriendlyExceptionFilter : IAsyncExceptionFilter
// 解析异常信息
var exceptionMetadata = GetExceptionMetadata(context);
IUnifyResultProvider unifyResult = context.GetRequiredService<IUnifyResultProvider>();
var unifyResult = context.GetRequiredService<IUnifyResultProvider>();
// 执行规范化异常处理
context.Result = unifyResult.OnException(context, exceptionMetadata);
// 创建日志记录器
var logger = context.HttpContext.RequestServices.GetRequiredService<ILogger<FriendlyExceptionFilter>>();
var errorMsg = "";
if (exceptionMetadata.Errors != null) errorMsg = "\n" + JsonConvert.SerializeObject(exceptionMetadata.Errors);
// 记录拦截日常
logger.LogError(context.Exception, context.Exception.Message);
logger.LogError(context.Exception, context.Exception.Message + errorMsg);
}
/// <summary>
/// 获取异常元数据
/// 获取异常元数据
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
@@ -74,22 +77,25 @@ public sealed class FriendlyExceptionFilter : IAsyncExceptionFilter
// 判断是否是 ExceptionContext 或者 ActionExecutedContext
var exception = context is ExceptionContext exContext
? exContext.Exception
: (
context is ActionExecutedContext edContext
? edContext.Exception
: default
);
: context is ActionExecutedContext edContext
? edContext.Exception
: default;
if (exception is AbpValidationException validationException)
{
errors = validationException.ValidationErrors;
isValidationException = true;
}
// 判断是否是友好异常
if (exception is UserFriendlyException friendlyException)
{
int statusCode2 = 500;
var statusCode2 = 500;
int.TryParse(friendlyException.Code, out statusCode2);
isFriendlyException = true;
errorCode = friendlyException.Code;
originErrorCode = friendlyException.Code;
statusCode = statusCode2==0?403:statusCode2;
isValidationException = false;
statusCode = statusCode2 == 0 ? 403 : statusCode2;
errors = friendlyException.Message;
data = friendlyException.Data;
}

View File

@@ -2,6 +2,7 @@
using Microsoft.Extensions.DependencyInjection;
using Swashbuckle.AspNetCore.SwaggerGen;
using Volo.Abp.AspNetCore.Mvc.ExceptionHandling;
using Volo.Abp.AspNetCore.Mvc.Response;
using Yi.Framework.AspNetCore.UnifyResult.Fiters;
namespace Yi.Framework.AspNetCore.UnifyResult;
@@ -20,9 +21,10 @@ public static class UnifyResultExtensions
services.AddTransient<FriendlyExceptionFilter>();
services.AddMvc(options =>
{
options.Filters.RemoveAll(x => (x as ServiceFilterAttribute)?.ServiceType == typeof(AbpExceptionFilter));
options.Filters.RemoveAll(x => (x as ServiceFilterAttribute)?.ServiceType == typeof(AbpNoContentActionFilter));
options.Filters.AddService<SucceededUnifyResultFilter>(99);
options.Filters.AddService<FriendlyExceptionFilter>(100);
options.Filters.RemoveAll(x => (x as ServiceFilterAttribute)?.ServiceType == typeof(AbpExceptionFilter));
});
return services;
}

View File

@@ -0,0 +1,8 @@
namespace Yi.Framework.Core.Options;
public class SemanticKernelOptions
{
public List<string> ModelIds { get; set; }
public string Endpoint { get; set; }
public string ApiKey { get; set; }
}

View File

@@ -11,12 +11,12 @@ namespace Yi.Framework.Ddd.Application
/// <summary>
/// CRUD应用服务基类 - 基础版本
/// </summary>
public abstract class YiCrudAppService<TEntity, TEntityDto, TKey>
public abstract class YiCrudAppService<TEntity, TEntityDto, TKey>
: YiCrudAppService<TEntity, TEntityDto, TKey, PagedAndSortedResultRequestDto>
where TEntity : class, IEntity<TKey>
where TEntityDto : IEntityDto<TKey>
{
protected YiCrudAppService(IRepository<TEntity, TKey> repository)
protected YiCrudAppService(IRepository<TEntity, TKey> repository)
: base(repository)
{
}
@@ -30,7 +30,7 @@ namespace Yi.Framework.Ddd.Application
where TEntity : class, IEntity<TKey>
where TEntityDto : IEntityDto<TKey>
{
protected YiCrudAppService(IRepository<TEntity, TKey> repository)
protected YiCrudAppService(IRepository<TEntity, TKey> repository)
: base(repository)
{
}
@@ -44,7 +44,7 @@ namespace Yi.Framework.Ddd.Application
where TEntity : class, IEntity<TKey>
where TEntityDto : IEntityDto<TKey>
{
protected YiCrudAppService(IRepository<TEntity, TKey> repository)
protected YiCrudAppService(IRepository<TEntity, TKey> repository)
: base(repository)
{
}
@@ -58,7 +58,7 @@ namespace Yi.Framework.Ddd.Application
where TEntity : class, IEntity<TKey>
where TEntityDto : IEntityDto<TKey>
{
protected YiCrudAppService(IRepository<TEntity, TKey> repository)
protected YiCrudAppService(IRepository<TEntity, TKey> repository)
: base(repository)
{
}
@@ -78,7 +78,7 @@ namespace Yi.Framework.Ddd.Application
/// </summary>
private const string TempFilePath = "/wwwroot/temp";
protected YiCrudAppService(IRepository<TEntity, TKey> repository)
protected YiCrudAppService(IRepository<TEntity, TKey> repository)
: base(repository)
{
}
@@ -96,7 +96,7 @@ namespace Yi.Framework.Ddd.Application
// 获取并验证实体
var entity = await GetEntityByIdAsync(id);
// 检查更新输入
await CheckUpdateInputDtoAsync(entity, input);
@@ -124,10 +124,10 @@ namespace Yi.Framework.Ddd.Application
{
// 检查创建权限
await CheckCreatePolicyAsync();
// 检查创建输入
await CheckCreateInputDtoAsync(input);
// 映射到实体
var entity = await MapToEntityAsync(input);
@@ -156,13 +156,13 @@ namespace Yi.Framework.Ddd.Application
public override async Task<PagedResultDto<TGetListOutputDto>> GetListAsync(TGetListInput input)
{
List<TEntity> entities;
// 根据输入类型决定查询方式
if (input is IPagedResultRequest pagedInput)
{
// 分页查询
entities = await Repository.GetPagedListAsync(
pagedInput.SkipCount,
pagedInput.SkipCount,
pagedInput.MaxResultCount,
string.Empty
);
@@ -176,10 +176,24 @@ namespace Yi.Framework.Ddd.Application
// 获取总数并映射结果
var totalCount = await Repository.GetCountAsync();
var dtos = await MapToGetListOutputDtosAsync(entities);
return new PagedResultDto<TGetListOutputDto>(totalCount, dtos);
}
/// <summary>
/// 获取实体动态下拉框列表,子类重写该方法,通过 keywords 进行筛选
/// </summary>
/// <param name="keywords">查询关键字</param>
/// <returns></returns>
public virtual async Task<List<TGetListOutputDto>> GetSelectDataListAsync(string? keywords = null)
{
List<TEntity> entities = await Repository.GetListAsync();
// 获取总数并映射结果
var dtos = await MapToGetListOutputDtosAsync(entities);
return dtos;
}
/// <summary>
/// 批量删除实体
/// </summary>

View File

@@ -1,7 +1,8 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Modularity;
using Volo.Abp.ObjectMapping;
using Yi.Framework.Core;
using Mapster;
namespace Yi.Framework.Mapster
{
@@ -22,7 +23,8 @@ namespace Yi.Framework.Mapster
public override void ConfigureServices(ServiceConfigurationContext context)
{
var services = context.Services;
// 扫描并注册所有映射配置
TypeAdapterConfig.GlobalSettings.Scan(AppDomain.CurrentDomain.GetAssemblies());
// 注册Mapster相关服务
services.AddTransient<IAutoObjectMappingProvider, MapsterAutoObjectMappingProvider>();
services.AddTransient<IObjectMapper, MapsterObjectMapper>();

View File

@@ -58,5 +58,10 @@ namespace Yi.Framework.SqlSugarCore.Abstractions
/// 是否启用SaaS多租户
/// </summary>
public bool EnabledSaasMultiTenancy { get; set; } = false;
/// <summary>
/// 是否开启更新并发乐观锁
/// </summary>
public bool EnabledConcurrencyException { get;set; } = false;
}
}

View File

@@ -213,6 +213,10 @@ public class DefaultSqlSugarDbContext : SqlSugarDbContext
{
EntityChangeEventHelperService.PublishEntityDeletedEvent(entityInfo.EntityValue);
}
else
{
EntityChangeEventHelperService.PublishEntityUpdatedEvent(entityInfo.EntityValue);
}
}
else
{

View File

@@ -1,12 +1,9 @@
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using Microsoft.Extensions.Logging;
using System.Linq.Expressions;
using Microsoft.Extensions.Options;
using Nito.AsyncEx;
using SqlSugar;
using Volo.Abp;
using Volo.Abp.Auditing;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Linq;
@@ -17,12 +14,17 @@ namespace Yi.Framework.SqlSugarCore.Repositories
{
public class SqlSugarRepository<TEntity> : ISqlSugarRepository<TEntity>, IRepository<TEntity> where TEntity : class, IEntity, new()
{
[Obsolete("使用GetDbContextAsync()")]
public ISqlSugarClient _Db => AsyncContext.Run(async () => await GetDbContextAsync());
[Obsolete("使用AsQueryable()")]
public ISugarQueryable<TEntity> _DbQueryable => _Db.Queryable<TEntity>();
private readonly ISugarDbContextProvider<ISqlSugarDbContext> _dbContextProvider;
public IAbpLazyServiceProvider LazyServiceProvider { get; set; }
protected DbConnOptions? Options => LazyServiceProvider?.LazyGetService<IOptions<DbConnOptions>>().Value;
/// <summary>
/// 异步查询执行器
/// </summary>
@@ -264,6 +266,7 @@ namespace Yi.Framework.SqlSugarCore.Repositories
if (typeof(ISoftDelete).IsAssignableFrom(typeof(TEntity)))
{
var entity = await GetByIdAsync(id);
if (entity == null) return false;
//反射赋值
ReflexHelper.SetModelValue(nameof(ISoftDelete.IsDeleted), true, entity);
return await UpdateAsync(entity);
@@ -319,12 +322,12 @@ namespace Yi.Framework.SqlSugarCore.Repositories
public virtual async Task<List<TEntity>> GetPageListAsync(Expression<Func<TEntity, bool>> whereExpression, int pageNum, int pageSize)
{
return await (await GetDbSimpleClientAsync()).GetPageListAsync(whereExpression, new PageModel() { PageIndex = pageNum, PageSize = pageSize });
return await (await AsQueryable()).Where(whereExpression).ToPageListAsync(pageNum, pageSize);
}
public virtual async Task<List<TEntity>> GetPageListAsync(Expression<Func<TEntity, bool>> whereExpression, int pageNum, int pageSize, Expression<Func<TEntity, object>>? orderByExpression = null, OrderByType orderByType = OrderByType.Asc)
{
return await (await GetDbSimpleClientAsync()).GetPageListAsync(whereExpression, new PageModel { PageIndex = pageNum, PageSize = pageSize }, orderByExpression, orderByType);
return await (await AsQueryable()).Where(whereExpression) .OrderBy( orderByExpression,orderByType).ToPageListAsync(pageNum, pageSize);
}
public virtual async Task<TEntity> GetSingleAsync(Expression<Func<TEntity, bool>> whereExpression)
@@ -379,20 +382,24 @@ namespace Yi.Framework.SqlSugarCore.Repositories
public virtual async Task<bool> UpdateAsync(TEntity updateObj)
{
if (typeof(TEntity).IsAssignableTo<IHasConcurrencyStamp>())//带版本号乐观锁更新
if (Options is not null && Options.EnabledConcurrencyException)
{
try
if (typeof(TEntity).IsAssignableTo<IHasConcurrencyStamp>()) //带版本号乐观锁更新
{
int num = await (await GetDbSimpleClientAsync())
.Context.Updateable(updateObj).ExecuteCommandWithOptLockAsync(true);
return num>0;
}
catch (VersionExceptions ex)
{
throw new AbpDbConcurrencyException($"{ex.Message}[更新失败ConcurrencyStamp不是最新版本],entityInfo{updateObj}", ex);
try
{
int num = await (await GetDbSimpleClientAsync())
.Context.Updateable(updateObj).ExecuteCommandWithOptLockAsync(true);
return num > 0;
}
catch (VersionExceptions ex)
{
throw new AbpDbConcurrencyException(
$"{ex.Message}[更新失败ConcurrencyStamp不是最新版本],entityInfo{updateObj}", ex);
}
}
}
return await (await GetDbSimpleClientAsync()).UpdateAsync(updateObj);
}

View File

@@ -26,7 +26,7 @@ public static class SqlSugarCoreExtensions
ServiceLifetime serviceLifetime = ServiceLifetime.Transient)
where TDbContext : class, ISqlSugarDbContextDependencies
{
services.TryAdd(new ServiceDescriptor(
services.Add(new ServiceDescriptor(
typeof(ISqlSugarDbContextDependencies),
typeof(TDbContext),
serviceLifetime));

View File

@@ -1,9 +0,0 @@
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.AccessLog
{
public class AccessLogDto
{
public long Number { get; set; }
public DateTime? LastModificationTime { get; set; }
public DateTime CreationTime { get; set; }
}
}

View File

@@ -1,24 +0,0 @@
using Yi.Framework.Bbs.Domain.Shared.Enums;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Analyse;
/// <summary>
/// 用户排行榜
/// </summary>
public class BaseAnalyseTopUserDto
{
public Guid UserId { get; set; }
public string UserName { get; set; }
public string? Nick { get; set; }
public int Order { get; set; }
public string? Icon { get; set; }
public int Level { get; set; }
/// <summary>
/// 用户等级名称
/// </summary>
public string LevelName { get; set; }
/// <summary>
/// 用户限制
/// </summary>
public UserLimitEnum UserLimit { get; set; }
}

View File

@@ -1,7 +0,0 @@
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Analyse;
public class MoneyTopUserDto:BaseAnalyseTopUserDto
{
public decimal Money { get; set; }
}

View File

@@ -1,8 +0,0 @@
using Yi.Framework.Bbs.Domain.Shared.Enums;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Analyse;
public class PointsTopUserDto:BaseAnalyseTopUserDto
{
public int Points { get; set; }
}

View File

@@ -1,20 +0,0 @@
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Analyse;
public class RegisterAnalyseDto
{
public RegisterAnalyseDto(DateTime time, int number)
{
Time = time;
Number = number;
}
/// <summary>
/// 时间
/// </summary>
public DateTime Time { get; set; }
/// <summary>
/// 人数
/// </summary>
public int Number { get; set; }
}

View File

@@ -1,6 +0,0 @@
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Analyse;
public class ValueTopUserDto:BaseAnalyseTopUserDto
{
public decimal Value { get; set; }
}

View File

@@ -1,24 +0,0 @@
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Argee
{
public class AgreeDto
{
public AgreeDto(bool isAgree)
{
IsAgree = isAgree;
if (isAgree)
{
Message = "点赞成功,点赞+1";
}
else
{
Message = "取消点赞,点赞-1";
}
}
public bool IsAgree { get; set; }
public string Message { get; set; }
}
}

View File

@@ -1,16 +0,0 @@
using Volo.Abp.Application.Dtos;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Article
{
public class ArticleAllOutputDto : EntityDto<Guid>
{
//批量查询,不给内容,性能考虑
//public string Content { get; set; }
public string Name { get; set; }
public Guid DiscussId { get; set; }
public Guid ParentId { get; set; }
public List<ArticleAllOutputDto>? Children { get; set; }
}
}

View File

@@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Article
{
/// <summary>
/// Article输入创建对象
/// </summary>
public class ArticleCreateInputVo
{
public string Content { get; set; }
public string Name { get; set; }
public Guid DiscussId { get; set; }
public Guid ParentId { get; set; }
}
}

View File

@@ -1,13 +0,0 @@
using Volo.Abp.Application.Dtos;
using Yi.Framework.Ddd.Application.Contracts;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Article
{
public class ArticleGetListInputVo : PagedAllResultRequestDto
{
public string? Content { get; set; }
public string? Name { get; set; }
public Guid? DiscussId { get; set; }
public Guid? ParentId { get; set; }
}
}

View File

@@ -1,14 +0,0 @@
using Volo.Abp.Application.Dtos;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Article
{
public class ArticleGetListOutputDto : EntityDto<Guid>
{
public string Name { get; set; }
public Guid DiscussId { get; set; }
public List<ArticleGetListOutputDto>? Children { get; set; }
public DateTime CreationTime { get; set; }
}
}

View File

@@ -1,33 +0,0 @@
using Volo.Abp.Application.Dtos;
using Yi.Framework.Bbs.Domain.Shared.Consts;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Article
{
public class ArticleGetOutputDto : EntityDto<Guid>
{
public string Content { get; set; }
public string Name { get; set; }
public Guid DiscussId { get; set; }
public Guid ParentId { get; set; }
public DateTime CreationTime { get; set; }
public bool HasPermission { get;internal set; }
/// <summary>
/// 设置权限
/// </summary>
public void SetPassPermission()
{
HasPermission = true;
}
/// <summary>
/// 设置无权限
/// </summary>
public void SetNoPermission()
{
HasPermission = false;
Content=DiscussConst.Privacy;
}
}
}

View File

@@ -1,24 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Yi.Framework.Bbs.Domain.Shared.Enums;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Article
{
public class ArticleImprotDto
{
/// <summary>
/// 主题id
/// </summary>
[Required]
public Guid DiscussId { get; set; }
public Guid ArticleParentId { get; set; }= Guid.Empty;
public ArticleImportTypeEnum ImportType { get; set; } = ArticleImportTypeEnum.Default;
}
}

View File

@@ -1,10 +0,0 @@
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Article
{
public class ArticleUpdateInputVo
{
public string Content { get; set; }
public string Name { get; set; }
public Guid DiscussId { get; set; }
public Guid ParentId { get; set; }
}
}

View File

@@ -1,44 +0,0 @@
using Volo.Abp.Application.Dtos;
using Yi.Framework.Bbs.Domain.Shared.Enums;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Assignment;
public class AssignmentDefineGetListOutputDto : EntityDto<Guid>
{
/// <summary>
/// 任务名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remarks { get; set; }
/// <summary>
/// 任务类型
/// </summary>
public AssignmentTypeEnum AssignmentType { get; set; }
/// <summary>
/// 任务需求类型
/// </summary>
public AssignmentRequirementTypeEnum AssignmentRequirementType{ get; set; }
/// <summary>
/// 总共步骤数
/// </summary>
public int TotalStepNumber { get; set; }
/// <summary>
/// 前置任务id
/// </summary>
public Guid? PreAssignmentId { get; set; }
/// <summary>
/// 任务奖励的钱钱数量
/// </summary>
public decimal RewardsMoneyNumber { get; set; }
public int OrderNum { get; set; }
}

View File

@@ -1,24 +0,0 @@
using Volo.Abp.Application.Dtos;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Assignment;
public class AssignmentGetListInput
{
/// <summary>
/// 任务查询条件
/// </summary>
public AssignmentQueryStateEnum AssignmentQueryState { get; set; } = AssignmentQueryStateEnum.Progress;
}
public enum AssignmentQueryStateEnum
{
/// <summary>
/// 正在进行
/// </summary>
Progress,
/// <summary>
/// 已结束
/// </summary>
End
}

View File

@@ -1,54 +0,0 @@
using Volo.Abp.Application.Dtos;
using Yi.Framework.Bbs.Domain.Shared.Enums;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Assignment;
public class AssignmentGetListOutputDto:EntityDto<Guid>
{
/// <summary>
/// 任务名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remarks { get; set; }
/// <summary>
/// 当前步骤数
/// </summary>
public int CurrentStepNumber { get; set; }
/// <summary>
/// 总共步骤数
/// </summary>
public int TotalStepNumber { get; set; }
/// <summary>
/// 任务类型
/// </summary>
public AssignmentTypeEnum AssignmentType { get; set; }
/// <summary>
/// 任务需求类型
/// </summary>
public AssignmentRequirementTypeEnum AssignmentRequirementType{ get; set; }
/// <summary>
/// 任务状态
/// </summary>
public AssignmentStateEnum AssignmentState { get; set; }
/// <summary>
/// 任务奖励的钱钱数量
/// </summary>
public decimal RewardsMoneyNumber { get; set; }
/// <summary>
/// 任务过期时间
/// </summary>
public DateTime? ExpireTime { get; set; }
public DateTime? CompleteTime { get; set; }
public DateTime CreationTime { get; set; }
public int OrderNum { get; set; }
}

View File

@@ -1,44 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Yi.Framework.Bbs.Domain.Shared.Enums;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Bank
{
public class BankCardDto:EntityDto<Guid>
{
/// <summary>
/// 满期限时间,可空
/// </summary>
public DateTime? FulltermTime { get; set; }
public DateTime? LastDepositTime { get; set; }
public DateTime CreationTime { get; set; }
/// <summary>
/// 用户id
/// </summary>
public Guid UserId { get; set; }
/// <summary>
/// 当前存储的钱
/// </summary>
public decimal StorageMoney { get; set; }
/// <summary>
/// 最大可存储的钱钱
/// </summary>
public decimal MaxStorageMoney { get; set; }
/// <summary>
/// 银行卡状态
/// </summary>
public BankCardStateEnum BankCardState { get; set; } = BankCardStateEnum.Unused;
}
}

View File

@@ -1,25 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Bank
{
public class InterestRecordsDto : EntityDto<Guid>
{
public DateTime CreationTime { get; set; }
/// <summary>
/// 当前汇率值
/// </summary>
public decimal Value { get; set; }
/// <summary>
/// 是否波动期
/// </summary>
public bool IsFluctuate { get; set; }
}
}

View File

@@ -1,12 +0,0 @@
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Banner
{
/// <summary>
/// Banner输入创建对象
/// </summary>
public class BannerCreateInputVo
{
public string Name { get; set; }
public string? Logo { get; set; }
public string? Color { get; set; }
}
}

View File

@@ -1,9 +0,0 @@
using Volo.Abp.Application.Dtos;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Banner
{
public class BannerGetListInputVo : PagedAndSortedResultRequestDto
{
public string? Name { get; set; }
}
}

View File

@@ -1,13 +0,0 @@
using Volo.Abp.Application.Dtos;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Banner
{
public class BannerGetListOutputDto : EntityDto<Guid>
{
public string Name { get; set; }
public string? Logo { get; set; }
public string? Color { get; set; }
public DateTime CreationTime { get; set; }
}
}

View File

@@ -1,13 +0,0 @@
using Volo.Abp.Application.Dtos;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Banner
{
public class BannerGetOutputDto : EntityDto<Guid>
{
public string Name { get; set; }
public string? Logo { get; set; }
public string? Color { get; set; }
public DateTime CreationTime { get; set; }
}
}

View File

@@ -1,9 +0,0 @@
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Banner
{
public class BannerUpdateInputVo
{
public string? Name { get; set; }
public string? Logo { get; set; }
public string? Color { get; set; }
}
}

View File

@@ -1,27 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.BbsUser
{
public class BbsUserAnalyseGetOutput
{
/// <summary>
/// 注册人数
/// </summary>
public long RegisterNumber { get; set; }
/// <summary>
/// 在线人数
/// </summary>
public long OnlineNumber { get; set; }
/// <summary>
/// 昨天新增用户
/// </summary>
public long YesterdayNewUser { get; set; }
}
}

View File

@@ -1,39 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Bbs.Domain.Shared.Enums;
using Yi.Framework.Rbac.Application.Contracts.Dtos.User;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.BbsUser
{
public class BbsUserGetListOutputDto: UserGetListOutputDto
{
/// <summary>
/// 用户等级
/// </summary>
public int Level { get; set; }
/// <summary>
/// 用户限制
/// </summary>
public UserLimitEnum UserLimit { get; set; }
/// <summary>
/// 钱钱
/// </summary>
public decimal Money { get; set; }
/// <summary>
/// 经验
/// </summary>
public long Experience { get; set; }
/// <summary>
/// 用户等级名称
/// </summary>
public string LevelName { get; set; }
}
}

View File

@@ -1,23 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Bbs.Domain.Shared.Enums;
using Yi.Framework.Rbac.Application.Contracts.Dtos.User;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.BbsUser
{
public class BbsUserGetOutputDto: UserGetOutputDto
{
/// <summary>
/// 用户等级
/// </summary>
public int Level { get; set; }
/// <summary>
/// 用户限制
/// </summary>
public UserLimitEnum UserLimit { get; set; }
}
}

View File

@@ -1,29 +0,0 @@
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Comment
{
/// <summary>
/// Comment输入创建对象
/// </summary>
public class CommentCreateInputVo
{
/// <summary>
/// 评论id
/// </summary>
public string? Content { get; set; }
/// <summary>
/// 主题id
/// </summary>
public Guid DiscussId { get; set; }
/// <summary>
/// 第一层评论id第一层为0
/// </summary>
public Guid RootId { get; set; }
/// <summary>
/// 被回复的CommentId第一层为0
/// </summary>
public Guid ParentId { get; set; }
}
}

View File

@@ -1,11 +0,0 @@
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Comment
{
public class CommentGetListInputVo
{
public DateTime? creationTime { get; set; }
public string? Content { get; set; }
//应该选择具体莫个主题查询
public Guid? DiscussId { get; set; }
}
}

View File

@@ -1,49 +0,0 @@
using Volo.Abp.Application.Dtos;
using Yi.Framework.Bbs.Application.Contracts.Dtos.BbsUser;
using Yi.Framework.Rbac.Application.Contracts.Dtos.User;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Comment
{
/// <summary>
/// 评论多反
/// </summary>
public class CommentGetListOutputDto : EntityDto<Guid>
{
public DateTime? CreationTime { get; set; }
public string Content { get; set; }
/// <summary>
/// 主题id
/// </summary>
public Guid DiscussId { get; set; }
public Guid ParentId { get; set; }
public Guid RootId { get; set; }
/// <summary>
/// 用户,评论人用户信息
/// </summary>
public BbsUserGetOutputDto CreateUser { get; set; }
public Guid? CreatorId { get; set; }
/// <summary>
/// 被评论的用户信息
/// </summary>
public BbsUserGetOutputDto CommentedUser { get; set; }
/// <summary>
/// 这个不是一个树形而是存在一个二维数组该Children只有在顶级时候只有一层
/// </summary>
public List<CommentGetListOutputDto> Children { get; set; } = new List<CommentGetListOutputDto>();
}
}

View File

@@ -1,35 +0,0 @@
using Volo.Abp.Application.Dtos;
using Yi.Framework.Bbs.Application.Contracts.Dtos.BbsUser;
using Yi.Framework.Rbac.Application.Contracts.Dtos.User;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Comment
{
/// <summary>
/// 单返回,返回单条评论即可
/// </summary>
public class CommentGetOutputDto : EntityDto<Guid>
{
public DateTime? CreateTime { get; set; }
public string Content { get; set; }
public Guid DiscussId { get; set; }
/// <summary>
/// 用户id联表为用户对象
/// </summary>
public BbsUserGetOutputDto User { get; set; }
/// <summary>
/// 根节点的评论id
/// </summary>
public Guid RootId { get; set; }
/// <summary>
/// 被回复的CommentId
/// </summary>
public Guid ParentId { get; set; }
}
}

View File

@@ -1,10 +0,0 @@
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Comment
{
public class CommentUpdateInputVo
{
public string Content { get; set; }
//更新不能将评论转移
}
}

View File

@@ -1,45 +0,0 @@
using Yi.Framework.Bbs.Domain.Shared.Enums;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Discuss
{
/// <summary>
/// Discuss输入创建对象
/// </summary>
public class DiscussCreateInputVo
{
public string Title { get; set; }
public string? Types { get; set; }
public string? Introduction { get; set; }
public DateTime? CreateTime { get; set; } = DateTime.Now;
public string Content { get; set; }
public string? Color { get; set; }
public Guid PlateId { get; set; }
/// <summary>
/// 默认公开
/// </summary>
public DiscussPermissionTypeEnum PermissionType { get; set; } = DiscussPermissionTypeEnum.Public;
/// <summary>
/// 封面
/// </summary>
public string? Cover { get; set; }
public int OrderNum { get; set; } = 0;
/// <summary>
/// 是否禁止评论创建功能
/// </summary>
public bool IsDisableCreateComment { get; set; }
/// <summary>
/// 标签
/// </summary>
public List<Guid>? DiscussLableIds { get; set; }
/// <summary>
/// 角色
/// </summary>
public List<string>? PermissionRoleCodes { get; set; } = new List<string>();
}
}

View File

@@ -1,25 +0,0 @@
using Volo.Abp.Application.Dtos;
using Yi.Framework.Bbs.Domain.Shared.Enums;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Discuss
{
public class DiscussGetListInputVo : PagedAndSortedResultRequestDto
{
/// <summary>
/// 创建者的用户名
/// </summary>
public string? UserName { get; set; }
public Guid? UserId { get; set; }
public string? Title { get; set; }
public Guid? PlateId { get; set; }
//默认查询非置顶
public bool? IsTop { get; set; }
//查询方式
public QueryDiscussTypeEnum Type { get; set; } = QueryDiscussTypeEnum.New;
}
}

View File

@@ -1,56 +0,0 @@
using Volo.Abp.Application.Dtos;
using Yi.Framework.Bbs.Application.Contracts.Dtos.BbsUser;
using Yi.Framework.Bbs.Application.Contracts.Dtos.DiscussLable;
using Yi.Framework.Bbs.Domain.Shared.Consts;
using Yi.Framework.Bbs.Domain.Shared.Enums;
using Yi.Framework.Rbac.Application.Contracts.Dtos.User;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Discuss
{
public class DiscussGetListOutputDto : EntityDto<Guid>
{
/// <summary>
/// 是否禁止评论创建功能
/// </summary>
public bool IsDisableCreateComment { get; set; }
/// <summary>
/// 是否已点赞,默认未登录不点赞
/// </summary>
public bool IsAgree { get; set; } = false;
public string Title { get; set; }
public string? Introduction { get; set; }
public int AgreeNum { get; set; }
public int SeeNum { get; set; }
//批量查询,不给内容,性能考虑
//public string Content { get; set; }
public string? Color { get; set; }
public Guid PlateId { get; set; }
//是否置顶默认false
public bool IsTop { get; set; }
public DiscussPermissionTypeEnum PermissionType { get; set; }
//是否禁止默认false
public bool IsBan { get; set; }
/// <summary>
/// 封面
/// </summary>
public string? Cover { get; set; }
public DateTime CreationTime { get; set; }
/// <summary>
/// 所需角色
/// </summary>
public List<string>? PermissionRoleCodes { get; set; } = new List<string>();
public BbsUserGetListOutputDto User { get; set; }
public List<Guid>? DiscussLableIds { get; set; } = new List<Guid>();
public List<DiscussLableGetOutputDto> Lables { get; set; } = new List<DiscussLableGetOutputDto>();
}
}

View File

@@ -1,69 +0,0 @@
using Volo.Abp.Application.Dtos;
using Yi.Framework.Bbs.Application.Contracts.Dtos.BbsUser;
using Yi.Framework.Bbs.Application.Contracts.Dtos.DiscussLable;
using Yi.Framework.Bbs.Application.Contracts.Dtos.Plate;
using Yi.Framework.Bbs.Domain.Shared.Consts;
using Yi.Framework.Bbs.Domain.Shared.Enums;
using Yi.Framework.Rbac.Application.Contracts.Dtos.User;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Discuss
{
public class DiscussGetOutputDto : EntityDto<Guid>
{
/// <summary>
/// 是否禁止评论创建功能
/// </summary>
public bool IsDisableCreateComment { get; set; }
public string Title { get; set; }
public string? Introduction { get; set; }
public int AgreeNum { get; set; }
public int SeeNum { get; set; }
public string Content { get; set; }
public string? Color { get; set; }
public Guid PlateId { get; set; }
//是否置顶默认false
public bool IsTop { get; set; }
/// <summary>
/// 封面
/// </summary>
public string? Cover { get; set; }
//是否私有默认false
public bool IsPrivate { get; set; }
//私有需要判断code权限
public string? PrivateCode { get; set; }
public DateTime CreationTime { get; set; }
public DiscussPermissionTypeEnum PermissionType { get; set; }
public bool IsAgree { get; set; } = false;
public List<string> PermissionRoleCodes { get; set; } = new List<string>();
public BbsUserGetListOutputDto User { get; set; }
public PlateGetOutputDto Plate { get; set; }
public List<Guid>? DiscussLableIds { get; set; } = new List<Guid>();
public List<DiscussLableGetOutputDto> Lables { get; set; } =new List<DiscussLableGetOutputDto>();
public bool HasPermission { get;internal set; }
/// <summary>
/// 设置权限
/// </summary>
public void SetPassPermission()
{
HasPermission = true;
}
/// <summary>
/// 设置无权限
/// </summary>
public void SetNoPermission()
{
HasPermission = false;
Content=DiscussConst.Privacy;
}
}
}

View File

@@ -1,39 +0,0 @@
using Yi.Framework.Bbs.Domain.Shared.Enums;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Discuss
{
public class DiscussUpdateInputVo
{
public string Title { get; set; }
public string? Types { get; set; }
public string? Introduction { get; set; }
public string Content { get; set; }
public string? Color { get; set; }
public List<Guid>? PermissionUserIds { get; set; }
public DiscussPermissionTypeEnum PermissionType { get; set; }
/// <summary>
/// 封面
/// </summary>
public string? Cover { get; set; }
public int OrderNum { get; set; }
/// <summary>
/// 是否禁止评论创建功能
/// </summary>
public bool IsDisableCreateComment { get; set; }
/// <summary>
/// 标签
/// </summary>
public List<Guid>? DiscussLableIds { get; set; }
/// <summary>
/// 需求角色
/// </summary>
public List<string>? PermissionRoleCodes { get; set; } = new List<string>();
}
}

View File

@@ -1,11 +0,0 @@
using Volo.Abp.Application.Dtos;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.DiscussLable;
public class DiscussLableGetOutputDto:EntityDto<Guid>
{
public Guid Id { get; set; }
public string Name { get; set; }
public string? Color { get; set; }
public string? BackgroundColor { get; set; }
}

View File

@@ -1,31 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Integral
{
public class SignInDto
{
/// <summary>
/// 签到数据
/// </summary>
public List<SignInItemDto> SignInItem { get; set; }=new List<SignInItemDto>();
/// <summary>
/// 当前连续签到次数
/// </summary>
public int CurrentContinuousNumber { get; set; }
}
public class SignInItemDto : EntityDto<Guid>
{
/// <summary>
/// 签到时间
/// </summary>
public DateTime CreationTime { get; set; }
}
}

View File

@@ -1,21 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Level
{
public class LevelGetListInputDto:PagedResultRequestDto
{ /// <summary>
/// 当前等级
/// </summary>
public int? MinLevel { get; set; }
/// <summary>
/// 等级名称
/// </summary>
public string? Name { get; set; }
}
}

View File

@@ -1,34 +0,0 @@
using Volo.Abp.Application.Dtos;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Level
{
public class LevelOutputDto : EntityDto<Guid>
{
public Guid Id { get; set; }
/// <summary>
/// 当前等级
/// </summary>
public int CurrentLevel { get; set; }
/// <summary>
/// 最小所需经验值
/// </summary>
public decimal MinExperience { get; set; }
/// <summary>
/// 等级名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 等级称号
/// </summary>
public string? Nick { get; set; }
/// <summary>
/// 等候logo
/// </summary>
public string? Logo { get; set; }
}
}

View File

@@ -1,12 +0,0 @@
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.MyType
{
/// <summary>
/// Label输入创建对象
/// </summary>
public class DiscussLableCreateInputVo
{
public string Name { get; set; }
public string? Color { get; set; }
public string? BackgroundColor { get; set; }
}
}

View File

@@ -1,9 +0,0 @@
using Volo.Abp.Application.Dtos;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.MyType
{
public class DiscussLableGetListInputVo : PagedAndSortedResultRequestDto
{
public string? Name { get; set; }
}
}

View File

@@ -1,11 +0,0 @@
using Volo.Abp.Application.Dtos;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.MyType
{
public class DiscussLableGetListOutputDto : EntityDto<Guid>
{
public string Name { get; set; }
public string? Color { get; set; }
public string? BackgroundColor { get; set; }
}
}

View File

@@ -1,12 +0,0 @@
using Volo.Abp.Application.Dtos;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.MyType
{
public class DiscussLableOutputDto : EntityDto<Guid>
{
public string Name { get; set; }
public string? Color { get; set; }
public string? BackgroundColor { get; set; }
public Guid UserId { get; set; }
}
}

View File

@@ -1,9 +0,0 @@
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.MyType
{
public class DiscussLableUpdateInputVo
{
public string Name { get; set; }
public string? Color { get; set; }
public string? BackgroundColor { get; set; }
}
}

View File

@@ -1,14 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Yi.Framework.Ddd.Application.Contracts;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Notice
{
public class BbsNoticeGetListInputVo:PagedAllResultRequestDto
{
}
}

View File

@@ -1,37 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Bbs.Domain.Shared.Enums;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Notice
{
public class BbsNoticeGetListOutputDto
{
/// <summary>
/// 消息,支持html
/// </summary>
public string Message { get; set; }
/// <summary>
/// 消息类型
/// </summary>
public NoticeTypeEnum NoticeType { get; }
/// <summary>
/// 是否已读
/// </summary>
public bool IsRead { get; private set; }
/// <summary>
/// 已读时间
/// </summary>
public DateTime? ReadTime { get; private set; }
/// <summary>
/// 消息创建时间
/// </summary>
public DateTime CreationTime { get; set; }
}
}

View File

@@ -1,18 +0,0 @@
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Plate
{
/// <summary>
/// Plate输入创建对象
/// </summary>
public class PlateCreateInputVo
{
public string Name { get; set; }
public string? Logo { get; set; }
public string? Introduction { get; set; }
public string Code { get; set; }
public int OrderNum { get; set; }
public bool IsDisableCreateDiscuss { get; set; }
}
}

View File

@@ -1,11 +0,0 @@
using Volo.Abp.Application.Dtos;
using Yi.Framework.Ddd.Application.Contracts;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Plate
{
public class PlateGetListInputVo : PagedAllResultRequestDto
{
public string? Name { get; set; }
public string? Code { get; set; }
}
}

View File

@@ -1,19 +0,0 @@
using Volo.Abp.Application.Dtos;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Plate
{
public class PlateGetListOutputDto : EntityDto<Guid>
{
public string Name { get; set; }
public string? Logo { get; set; }
public string? Introduction { get; set; }
public string Code { get; set; }
public DateTime CreationTime { get; set; }
public int OrderNum { get; set; }
public bool IsDisableCreateDiscuss { get; set; }
}
}

View File

@@ -1,17 +0,0 @@
using Volo.Abp.Application.Dtos;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Plate
{
public class PlateGetOutputDto : EntityDto<Guid>
{
public string Name { get; set; }
public string? Logo { get; set; }
public string? Introduction { get; set; }
public string Code { get; set; }
public DateTime CreationTime { get; set; }
public int OrderNum { get; set; }
public bool IsDisableCreateDiscuss { get; set; }
}
}

View File

@@ -1,16 +0,0 @@
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Plate
{
public class PlateUpdateInputVo
{
public string? Name { get; set; }
public string? Logo { get; set; }
public string? Introduction { get; set; }
public string? Code { get; set; }
public int OrderNum { get; set; }
public bool IsDisableCreateDiscuss { get; set; }
}
}

View File

@@ -1,19 +0,0 @@
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Shop;
public class BbsShopAccountDto
{
/// <summary>
/// 钱钱
/// </summary>
public decimal Money { get; set; }
/// <summary>
/// 积分
/// </summary>
public int Points { get; set; }
/// <summary>
/// 价值
/// </summary>
public decimal Value { get; set; }
}

View File

@@ -1,7 +0,0 @@
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Shop;
public class BuyShopInputDto
{
public Guid GoodsId { get; set; }
public string ContactInformation { get; set; }
}

View File

@@ -1,74 +0,0 @@
using Volo.Abp.Application.Dtos;
using Yi.Framework.Bbs.Domain.Shared.Enums;
namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Shop;
public class ShopGetListOutput:EntityDto<Guid>
{
/// <summary>
/// 上架时间
/// </summary>
public DateTime CreationTime { get; set; }
/// <summary>
/// 商品类型
/// </summary>
public GoodsTypeEnum GoodsType{ get; set; }
/// <summary>
/// 下架时间
/// </summary>
public DateTime? EndTime { get; set; }
/// <summary>
/// 商品名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 每人限购数量
/// </summary>
public int LimitNumber { get; set; }
/// <summary>
/// 当前库存数量
/// </summary>
public int StockNumber { get; set; }
/// <summary>
/// 商品图片url
/// </summary>
public string ImageUrl { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Describe { get; set; }
/// <summary>
/// 编号
/// </summary>
public string Code { get; set; }
/// <summary>
/// 所需钱钱
/// </summary>
public decimal NeedMoney { get; set; }
/// <summary>
/// 所需价值
/// </summary>
public decimal NeedValue { get; set; }
/// <summary>
/// 所需积分
/// </summary>
public decimal NeedPoints { get; set; }
public int OrderNum { get; set; }
/// <summary>
/// 是否已限制
/// </summary>
public bool IsLimit { get; set; }
}

View File

@@ -1,12 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.Bbs.Application.Contracts.IServices
{
public interface IAccessLogService
{
}
}

View File

@@ -1,13 +0,0 @@
using Yi.Framework.Bbs.Application.Contracts.Dtos.Article;
using Yi.Framework.Ddd.Application.Contracts;
namespace Yi.Framework.Bbs.Application.Contracts.IServices
{
/// <summary>
/// Article服务抽象
/// </summary>
public interface IArticleService : IYiCrudAppService<ArticleGetOutputDto, ArticleGetListOutputDto, Guid, ArticleGetListInputVo, ArticleCreateInputVo, ArticleUpdateInputVo>
{
}
}

View File

@@ -1,13 +0,0 @@
using Yi.Framework.Bbs.Application.Contracts.Dtos.Banner;
using Yi.Framework.Ddd.Application.Contracts;
namespace Yi.Framework.Bbs.Application.Contracts.IServices
{
/// <summary>
/// Banner抽象
/// </summary>
public interface IBannerService : IYiCrudAppService<BannerGetOutputDto, BannerGetListOutputDto, Guid, BannerGetListInputVo, BannerCreateInputVo, BannerUpdateInputVo>
{
}
}

View File

@@ -1,12 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.Bbs.Application.Contracts.IServices
{
public interface IBbsUserInfoService
{
}
}

View File

@@ -1,13 +0,0 @@
using Yi.Framework.Bbs.Application.Contracts.Dtos.Comment;
using Yi.Framework.Ddd.Application.Contracts;
namespace Yi.Framework.Bbs.Application.Contracts.IServices
{
/// <summary>
/// Comment服务抽象
/// </summary>
public interface ICommentService : IYiCrudAppService<CommentGetOutputDto, CommentGetListOutputDto, Guid, CommentGetListInputVo, CommentCreateInputVo, CommentUpdateInputVo>
{
}
}

View File

@@ -1,12 +0,0 @@
using Yi.Framework.Bbs.Application.Contracts.Dtos.MyType;
using Yi.Framework.Ddd.Application.Contracts;
namespace Yi.Framework.Bbs.Application.Contracts.IServices
{
/// <summary>
/// Label服务抽象
/// </summary>
public interface IDiscussLableService : IYiCrudAppService<DiscussLableOutputDto, DiscussLableGetListOutputDto, Guid, DiscussLableGetListInputVo, DiscussLableCreateInputVo, DiscussLableUpdateInputVo>
{
}
}

View File

@@ -1,12 +0,0 @@
using Yi.Framework.Bbs.Application.Contracts.Dtos.Discuss;
using Yi.Framework.Ddd.Application.Contracts;
namespace Yi.Framework.Bbs.Application.Contracts.IServices
{
/// <summary>
/// Discuss服务抽象
/// </summary>
public interface IDiscussService : IYiCrudAppService<DiscussGetOutputDto, DiscussGetListOutputDto, Guid, DiscussGetListInputVo, DiscussCreateInputVo, DiscussUpdateInputVo>
{
}
}

View File

@@ -1,14 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Bbs.Application.Contracts.Dtos.Level;
using Yi.Framework.Ddd.Application.Contracts;
namespace Yi.Framework.Bbs.Application.Contracts.IServices
{
public interface ILevelService : IYiCrudAppService<LevelOutputDto, Guid, LevelGetListInputDto>
{
}
}

View File

@@ -1,13 +0,0 @@
using Yi.Framework.Bbs.Application.Contracts.Dtos.Plate;
using Yi.Framework.Ddd.Application.Contracts;
namespace Yi.Framework.Bbs.Application.Contracts.IServices
{
/// <summary>
/// Plate服务抽象
/// </summary>
public interface IPlateService : IYiCrudAppService<PlateGetOutputDto, PlateGetListOutputDto, Guid, PlateGetListInputVo, PlateCreateInputVo, PlateUpdateInputVo>
{
}
}

View File

@@ -1,11 +0,0 @@
using Volo.Abp.Application.Services;
namespace Yi.Framework.Bbs.Application.Contracts.IServices
{
/// <summary>
/// Setting应用抽象
/// </summary>
public interface ISettingService : IApplicationService
{
}
}

View File

@@ -1,11 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<ItemGroup>
<ProjectReference Include="..\..\digital-collectibles\Yi.Framework.DigitalCollectibles.Application.Contracts\Yi.Framework.DigitalCollectibles.Application.Contracts.csproj" />
<ProjectReference Include="..\..\rbac\Yi.Framework.Rbac.Application.Contracts\Yi.Framework.Rbac.Application.Contracts.csproj" />
<ProjectReference Include="..\Yi.Framework.Bbs.Domain.Shared\Yi.Framework.Bbs.Domain.Shared.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,15 +0,0 @@
using Volo.Abp.Modularity;
using Yi.Framework.Bbs.Domain.Shared;
using Yi.Framework.Rbac.Application.Contracts;
namespace Yi.Framework.Bbs.Application.Contracts
{
[DependsOn(typeof(YiFrameworkBbsDomainSharedModule),
typeof(YiFrameworkRbacApplicationContractsModule)
)]
public class YiFrameworkBbsApplicationContractsModule : AbpModule
{
}
}

View File

@@ -1,12 +0,0 @@
using Microsoft.AspNetCore.Builder;
namespace Yi.Framework.Bbs.Application.Extensions;
public static class AccessLogExtensions
{
public static IApplicationBuilder UseAccessLog(this IApplicationBuilder app)
{
app.UseMiddleware<AccessLogMiddleware>();
return app;
}
}

View File

@@ -1,91 +0,0 @@
using FreeRedis;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Options;
using Volo.Abp.Caching;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus;
using Yi.Framework.Bbs.Domain.Shared.Caches;
using Yi.Framework.Bbs.Domain.Shared.Etos;
namespace Yi.Framework.Bbs.Application.Extensions;
/// <summary>
/// 访问日志中间件
/// 并发最高采用缓存默认10分钟才会真正操作一次数据库
/// 需考虑一致性问题,又不能上锁影响性能
/// </summary>
public class AccessLogMiddleware : IMiddleware, ITransientDependency
{
private static int _accessLogNumber = 0;
internal static void ResetAccessLogNumber()
{
_accessLogNumber = 0;
}
internal static int GetAccessLogNumber()
{
return _accessLogNumber;
}
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
{
await next(context);
Interlocked.Increment(ref _accessLogNumber);
}
}
public class AccessLogResetEventHandler : ILocalEventHandler<AccessLogResetArgs>,
ITransientDependency
{
/// <summary>
/// 缓存前缀
/// </summary>
private string CacheKeyPrefix => LazyServiceProvider.LazyGetRequiredService<IOptions<AbpDistributedCacheOptions>>()
.Value.KeyPrefix;
/// <summary>
/// 使用懒加载防止报错
/// </summary>
private IRedisClient RedisClient => LazyServiceProvider.LazyGetRequiredService<IRedisClient>();
/// <summary>
/// 属性注入
/// </summary>
public IAbpLazyServiceProvider LazyServiceProvider { get; set; }
private bool EnableRedisCache
{
get
{
var redisEnabled = LazyServiceProvider.LazyGetRequiredService<IConfiguration>()["Redis:IsEnabled"];
return redisEnabled.IsNullOrEmpty() || bool.Parse(redisEnabled);
}
}
//该事件由job定时10秒触发
public async Task HandleEventAsync(AccessLogResetArgs eventData)
{
if (EnableRedisCache)
{
//分布式锁
if (await RedisClient.SetNxAsync("AccessLogLock",true,TimeSpan.FromSeconds(5)))
{
//自增长数
var incrNumber= AccessLogMiddleware.GetAccessLogNumber();
//立即重置,开始计算,方式丢失
AccessLogMiddleware.ResetAccessLogNumber();
if (incrNumber>0)
{
await RedisClient.IncrByAsync(
$"{CacheKeyPrefix}{AccessLogCacheConst.Key}:{DateTime.Now.Date:yyyyMMdd}", incrNumber);
}
}
}
}
}

View File

@@ -1,140 +0,0 @@
using Mapster;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Application.Services;
using Yi.Framework.Bbs.Application.Contracts.Dtos.AccessLog;
using Yi.Framework.Bbs.Application.Contracts.IServices;
using Yi.Framework.Bbs.Domain.Entities;
using Yi.Framework.Bbs.Domain.Shared.Enums;
using Yi.Framework.SqlSugarCore.Abstractions;
namespace Yi.Framework.Bbs.Application.Services
{
public class AccessLogService : ApplicationService, IAccessLogService
{
private readonly ISqlSugarRepository<AccessLogAggregateRoot> _repository;
public AccessLogService(ISqlSugarRepository<AccessLogAggregateRoot> repository)
{
_repository = repository;
}
public DateTime GetWeekFirst()
{
var week = DateTime.Now.DayOfWeek;
switch (week)
{
case DayOfWeek.Sunday:
return DateTime.Now.AddDays(-6).Date;
case DayOfWeek.Monday:
return DateTime.Now.AddDays(-0).Date;
case DayOfWeek.Tuesday:
return DateTime.Now.AddDays(-1).Date;
case DayOfWeek.Wednesday:
return DateTime.Now.AddDays(-2).Date;
case DayOfWeek.Thursday:
return DateTime.Now.AddDays(-3).Date;
case DayOfWeek.Friday:
return DateTime.Now.AddDays(-4).Date;
case DayOfWeek.Saturday:
return DateTime.Now.AddDays(-5).Date;
default:
throw new ArgumentException("日期错误");
}
}
/// <summary>
/// 获取全部访问流量(3个月)
/// </summary>
/// <param name="AccessLogType"></param>
/// <returns></returns>
public async Task<List<AccessLogDto>> GetListAsync([FromQuery] AccessLogTypeEnum accessLogType)
{
var entities = await _repository._DbQueryable.Where(x => x.AccessLogType == accessLogType)
.Where(x => x.CreationTime >= DateTime.Now.AddMonths(-3))
.OrderBy(x => x.CreationTime).ToListAsync();
var output = entities.Adapt<List<AccessLogDto>>();
output?.ForEach(x => x.CreationTime = x.CreationTime.Date);
return output;
}
/// <summary>
/// 首页点击触发
/// </summary>
/// <returns></returns>
[HttpPost("access-log")]
public async Task AccessAsync()
{
//可判断http重复防止同一ip多次访问
var last = await _repository._DbQueryable.Where(x=>x.AccessLogType==AccessLogTypeEnum.HomeClick).OrderByDescending(x => x.CreationTime).FirstAsync();
if (last is null || last.CreationTime.Date != DateTime.Today)
{
await _repository.InsertAsync(new AccessLogAggregateRoot(){AccessLogType=AccessLogTypeEnum.HomeClick});
}
else
{
await _repository._Db.Updateable<AccessLogAggregateRoot>().SetColumns(it => it.Number == it.Number + 1)
.Where(it => it.Id == last.Id).ExecuteCommandAsync();
}
}
/// <summary>
/// 获取当前周首页点击数据
/// </summary>
/// <returns></returns>
public async Task<AccessLogDto[]> GetWeekAsync([FromQuery] AccessLogTypeEnum accessLogType)
{
var lastSeven = await _repository._DbQueryable
.Where(x => x.AccessLogType == accessLogType)
.OrderByDescending(x => x.CreationTime).ToPageListAsync(1, 7);
return WeekTimeHandler(lastSeven.ToArray());
}
/// <summary>
/// Todo: 可放入领域层
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
private AccessLogDto[] WeekTimeHandler(AccessLogAggregateRoot[] data)
{
data = data.Where(x => x.CreationTime >= GetWeekFirst()).OrderByDescending(x => x.CreationTime)
.DistinctBy(x => x.CreationTime.DayOfWeek).ToArray();
Dictionary<DayOfWeek, AccessLogDto> processedData = new Dictionary<DayOfWeek, AccessLogDto>();
// 初始化字典将每天的数据都设为0
foreach (DayOfWeek dayOfWeek in Enum.GetValues(typeof(DayOfWeek)))
{
processedData.Add(dayOfWeek, new AccessLogDto());
}
// 处理原始数据
foreach (var item in data)
{
DayOfWeek dayOfWeek = item.CreationTime.DayOfWeek;
// 如果当天有数据则更新字典中的值为对应的Number
var sss = data.Adapt<AccessLogDto>();
processedData[dayOfWeek] = item.Adapt<AccessLogDto>();
}
var result = processedData.Values.ToList();
//此时的时间是周日-周一-周二,需要处理
var first = result[0]; // 获取第一个元素
result.RemoveAt(0); // 移除第一个元素
result.Add(first); // 将第一个元素添加到末尾
return result.ToArray();
}
}
}

View File

@@ -1,132 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Yi.Framework.Bbs.Application.Contracts.Dtos.BbsUser;
using Yi.Framework.Bbs.Application.Contracts.Dtos.Discuss;
using Yi.Framework.Bbs.Domain.Entities;
using Yi.Framework.Bbs.Domain.Entities.Forum;
using Yi.Framework.Bbs.Domain.Managers;
using Yi.Framework.Bbs.Domain.Shared.Enums;
using Yi.Framework.Rbac.Domain.Entities;
using Yi.Framework.Rbac.Domain.Shared.Consts;
using Yi.Framework.SqlSugarCore.Abstractions;
namespace Yi.Framework.Bbs.Application.Services.Analyses
{
public class BbsForumAnalyseService : ApplicationService, IApplicationService
{
private ForumManager _forumManager;
private ISqlSugarRepository<AgreeEntity> _agreeRepository;
public BbsForumAnalyseService(ForumManager forumManager, ISqlSugarRepository<AgreeEntity> agreeRepository)
{
_forumManager = forumManager;
_agreeRepository = agreeRepository;
}
/// <summary>
/// 推荐主题,随机返回主题列表
/// </summary>
/// <returns></returns>
[HttpGet("analyse/bbs-discuss/random")]
public async Task<List<DiscussGetListOutputDto>> GetRandomDiscussAsync([FromQuery] PagedResultRequestDto input)
{
var output = await _forumManager._discussRepository._DbQueryable
.Where(discuss=>discuss.PermissionType== DiscussPermissionTypeEnum.Public)
.LeftJoin<UserAggregateRoot>((discuss, user) => discuss.CreatorId == user.Id)
.LeftJoin<BbsUserExtraInfoEntity>((discuss, user, info) => user.Id == info.UserId)
.OrderBy(discuss => SqlFunc.GetRandom())
.Select((discuss, user, info) => new DiscussGetListOutputDto
{
Id = discuss.Id,
// IsAgree = SqlFunc.Subqueryable<AgreeEntity>().WhereIF(CurrentUser.Id != null, x => x.CreatorId == CurrentUser.Id && x.DiscussId == discuss.Id).Any(),
User = new BbsUserGetListOutputDto()
{
Id = user.Id,
UserName = user.UserName,
Nick = user.Nick,
Icon = user.Icon,
Level = info.Level,
UserLimit = info.UserLimit
}
}, true)
.ToPageListAsync(input.SkipCount, input.MaxResultCount);
var discussId = output.Select(x => x.Id);
//点赞字典key为主题idy为用户ids
var agreeDic =
(await _agreeRepository._DbQueryable.Where(x => discussId.Contains(x.DiscussId)).ToListAsync())
.GroupBy(x => x.DiscussId)
.ToDictionary(x => x.Key, y => y.Select(y => y.CreatorId).ToList());
//等级、是否点赞赋值
output?.ForEach(x =>
{
if (CurrentUser.Id is not null)
{
//默认fasle
if (agreeDic.TryGetValue(x.Id,out var userIds))
{
x.IsAgree = userIds.Contains(CurrentUser.Id);
}
}
});
return output;
}
/// <summary>
/// 作者主题,返回当前作者最新的主题
/// </summary>
/// <returns></returns>
[HttpGet("analyse/bbs-discuss/author/{userId}")]
public async Task<List<DiscussGetListOutputDto>> GetAuthorDiscussAsync(
[FromRoute] Guid userId,
[FromQuery] PagedResultRequestDto input)
{
var output = await _forumManager._discussRepository._DbQueryable.Where(discuss=>discuss.CreatorId==userId)
.Where(discuss=>discuss.PermissionType== DiscussPermissionTypeEnum.Public)
.LeftJoin<UserAggregateRoot>((discuss, user) => discuss.CreatorId == user.Id)
.LeftJoin<BbsUserExtraInfoEntity>((discuss, user, info) => user.Id == info.UserId)
.OrderByDescending(discuss => discuss.CreationTime)
.Select((discuss, user, info) => new DiscussGetListOutputDto
{
Id = discuss.Id,
User = new BbsUserGetListOutputDto()
{
Id = user.Id,
UserName = user.UserName,
Nick = user.Nick,
Icon = user.Icon,
Level = info.Level,
UserLimit = info.UserLimit
}
}, true)
.ToPageListAsync(input.SkipCount, input.MaxResultCount);
var discussId = output.Select(x => x.Id);
//点赞字典key为主题idy为用户ids
var agreeDic =
(await _agreeRepository._DbQueryable.Where(x => discussId.Contains(x.DiscussId)).ToListAsync())
.GroupBy(x => x.DiscussId)
.ToDictionary(x => x.Key, y => y.Select(y => y.CreatorId).ToList());
//等级、是否点赞赋值
output?.ForEach(x =>
{
if (CurrentUser.Id is not null)
{
//默认fasle
if (agreeDic.TryGetValue(x.Id,out var userIds))
{
x.IsAgree = userIds.Contains(CurrentUser.Id);
}
}
});
return output;
}
}
}

View File

@@ -1,294 +0,0 @@
using Mapster;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Yi.Framework.Bbs.Application.Contracts.Dtos.Analyse;
using Yi.Framework.Bbs.Application.Contracts.Dtos.BbsUser;
using Yi.Framework.Bbs.Domain.Entities;
using Yi.Framework.Bbs.Domain.Entities.Integral;
using Yi.Framework.Bbs.Domain.Managers;
using Yi.Framework.Bbs.Domain.Shared.Enums;
using Yi.Framework.DigitalCollectibles.Application.Contracts.IServices;
using Yi.Framework.Rbac.Application.Contracts.IServices;
using Yi.Framework.Rbac.Domain.Authorization;
using Yi.Framework.Rbac.Domain.Shared.Consts;
using Yi.Framework.Rbac.Domain.Shared.Model;
namespace Yi.Framework.Bbs.Application.Services.Analyses
{
public class BbsUserAnalyseService : ApplicationService, IApplicationService
{
private BbsUserManager _bbsUserManager;
private IOnlineService _onlineService;
private readonly IPointAnalyseService _pointAnalyseService;
private readonly IValueAnalyseService _valueAnalyseService;
public BbsUserAnalyseService(BbsUserManager bbsUserManager, IOnlineService onlineService,
IPointAnalyseService pointAnalyseService, IValueAnalyseService valueAnalyseService)
{
_bbsUserManager = bbsUserManager;
_onlineService = onlineService;
_pointAnalyseService = pointAnalyseService;
_valueAnalyseService = valueAnalyseService;
}
/// <summary>
/// 人数注册统计(近3个月)
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet("analyse/bbs-user/register")]
public async Task<List<RegisterAnalyseDto>> GetRegisterAsync()
{
using (DataFilter.DisablePermissionHandler())
{
var users = await _bbsUserManager._userRepository._DbQueryable
.Where(u => u.CreationTime >= DateTime.Now.AddMonths(-3))
.LeftJoin<BbsUserExtraInfoEntity>((u, info) => u.Id == info.UserId)
.Select((u, info) => new BbsUserGetListOutputDto()
{
Id = u.Id,
Icon = u.Icon,
Level = info.Level,
UserLimit = info.UserLimit,
Money = info.Money,
Experience = info.Experience,
CreationTime = u.CreationTime
})
.ToListAsync();
var minCreateUser = users.MinBy(x => x.CreationTime);
var userCreateTimeDic = users.OrderBy(x => x.CreationTime)
.GroupBy(x => x.CreationTime.Date)
.ToDictionary(x => x.Key.Date, y => y.Count());
DateTime startDate = minCreateUser.CreationTime.Date;
DateTime endDate = DateTime.Today;
List<RegisterAnalyseDto> output = new List<RegisterAnalyseDto>();
// 计算从起始日期到今天的所有天数
for (DateTime date = startDate; date <= endDate; date = date.AddDays(1))
{
var count = 0;
userCreateTimeDic.TryGetValue(date, out count);
RegisterAnalyseDto dayInfo = new RegisterAnalyseDto(date, count);
output.Add(dayInfo);
}
return output;
}
}
/// <summary>
/// 财富排行榜
/// </summary>
/// <returns></returns>
[HttpGet("analyse/bbs-user/money-top/{userId?}")]
public async Task<PagedResultDto<MoneyTopUserDto>> GetMoneyTopAsync([FromQuery] PagedResultRequestDto input,
[FromRoute] Guid? userId)
{
using (DataFilter.DisablePermissionHandler())
{
var pageIndex = input.SkipCount;
RefAsync<int> total = 0;
var output = await _bbsUserManager._userRepository._DbQueryable
.LeftJoin<BbsUserExtraInfoEntity>((u, info) => u.Id == info.UserId)
.OrderByDescending((u, info) => info.Money)
.Select((u, info) =>
new MoneyTopUserDto
{
UserName = u.UserName,
Nick = u.Nick,
Money = info.Money,
Icon = u.Icon,
Level = info.Level,
UserLimit = info.UserLimit,
Order = SqlFunc.RowNumber(SqlFunc.Desc(info.Money))
}
)
.ToPageListAsync(pageIndex, input.MaxResultCount, total);
var levelCache = await _bbsUserManager.GetLevelCacheMapAsync();
output.ForEach(x => { x.LevelName = levelCache[x.Level].Name; });
return new PagedResultDto<MoneyTopUserDto>
{
Items = output,
TotalCount = total
};
}
}
/// <summary>
/// 推荐好友,随机返回好友列表
/// </summary>
/// <returns></returns>
[HttpGet("analyse/bbs-user/random")]
public async Task<List<BbsUserGetListOutputDto>> GetRandomUserAsync([FromQuery] PagedResultRequestDto input)
{
using (DataFilter.DisablePermissionHandler())
{
var randUserIds = await _bbsUserManager._userRepository._DbQueryable
//.Where(x => x.UserName != UserConst.Admin)
.OrderBy(x => SqlFunc.GetRandom())
.Select(x => x.Id).ToPageListAsync(input.SkipCount, input.MaxResultCount);
var output = await _bbsUserManager.GetBbsUserInfoAsync(randUserIds);
return output.Adapt<List<BbsUserGetListOutputDto>>();
//这里关闭了数据权限,所有用户都能查询的到
}
//这里有数据权限,会根据用户角色进行过滤
}
/// <summary>
/// 用户分析
/// </summary>
/// <returns></returns>
[HttpGet("analyse/bbs-user")]
public async Task<BbsUserAnalyseGetOutput> GetUserAnalyseAsync()
{
using (DataFilter.DisablePermissionHandler())
{
var sss = DataFilter.IsEnabled<IDataPermission>();
var registerUser = await _bbsUserManager._userRepository._DbQueryable.CountAsync();
DateTime now = DateTime.Now;
DateTime yesterday = now.AddDays(-1);
DateTime startTime = new DateTime(yesterday.Year, yesterday.Month, yesterday.Day, 0, 0, 0);
DateTime endTime = startTime.AddHours(24);
var yesterdayNewUser = await _bbsUserManager._userRepository._DbQueryable
.Where(x => x.CreationTime >= startTime && x.CreationTime <= endTime).CountAsync();
var userOnline = (await _onlineService.GetListAsync(new OnlineUserModel { })).TotalCount;
var output = new BbsUserAnalyseGetOutput()
{ OnlineNumber = userOnline, RegisterNumber = registerUser, YesterdayNewUser = yesterdayNewUser };
return output;
}
}
/// <summary>
/// 积分排行榜
/// </summary>
/// <returns></returns>
[HttpGet("analyse/dc-user/points-top/{userId?}")]
public async Task<PagedResultDto<PointsTopUserDto>> GetPointsTopAsync([FromQuery] PagedResultRequestDto input,
[FromRoute] Guid? userId)
{
var result = await _pointAnalyseService.GetValueTopAsync(input, null);
var userIds = result.Items.Select(x => x.UserId).ToList();
var baseOutput = await _bbsUserManager._userRepository._DbQueryable
.Where(u => userIds.Contains(u.Id))
.LeftJoin<BbsUserExtraInfoEntity>((u, info) => u.Id == info.UserId)
.Select((u, info) =>
new BaseAnalyseTopUserDto
{
UserName = u.UserName,
Nick = u.Nick,
Icon = u.Icon,
Level = info.Level,
UserLimit = info.UserLimit,
UserId = info.UserId
}
).ToListAsync();
var output = new List<PointsTopUserDto>();
var levelCache = await _bbsUserManager.GetLevelCacheMapAsync();
result.Items.ToList().ForEach(x =>
{
var currentUserInfo = baseOutput.Where(u => u.UserId == x.UserId).FirstOrDefault();
if (currentUserInfo is not null)
{
output.Add(new PointsTopUserDto
{
UserName = currentUserInfo.UserName,
Nick = currentUserInfo.Nick,
Order = x.Order,
Icon = currentUserInfo.Icon,
Level = currentUserInfo.Level,
LevelName = levelCache[currentUserInfo.Level].Name,
UserLimit = UserLimitEnum.Normal,
Points = x.Points
});
}
});
return new PagedResultDto<PointsTopUserDto>
{
Items = output,
TotalCount = result.TotalCount
};
}
/// <summary>
/// 价值排行榜
/// </summary>
/// <returns></returns>
[HttpGet("analyse/dc-user/value-top/{userId?}")]
public async Task<PagedResultDto<ValueTopUserDto>> GetValueTopAsync([FromQuery] PagedResultRequestDto input,
[FromRoute] Guid? userId)
{
var result = await _valueAnalyseService.GetValueTopAsync(input, null);
var userIds = result.Items.Select(x => x.UserId).ToList();
var baseOutput = await _bbsUserManager._userRepository._DbQueryable
.Where(u => userIds.Contains(u.Id))
.LeftJoin<BbsUserExtraInfoEntity>((u, info) => u.Id == info.UserId)
.Select((u, info) =>
new BaseAnalyseTopUserDto
{
UserName = u.UserName,
Nick = u.Nick,
Icon = u.Icon,
Level = info.Level,
UserLimit = info.UserLimit,
UserId = info.UserId
}
).ToListAsync();
var output = new List<ValueTopUserDto>();
var levelCache = await _bbsUserManager.GetLevelCacheMapAsync();
result.Items.ToList().ForEach(x =>
{
var currentUserInfo = baseOutput.Where(u => u.UserId == x.UserId).FirstOrDefault();
if (currentUserInfo is not null)
{
output.Add(new ValueTopUserDto
{
UserName = currentUserInfo.UserName,
Nick = currentUserInfo.Nick,
Order = x.Order,
Icon = currentUserInfo.Icon,
Level = currentUserInfo.Level,
LevelName =levelCache[currentUserInfo.Level].Name,
UserLimit = UserLimitEnum.Normal,
Value = x.Value
});
}
});
return new PagedResultDto<ValueTopUserDto>
{
Items = output,
TotalCount = result.TotalCount
};
}
}
}

View File

@@ -1,82 +0,0 @@
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Application.Services;
using Volo.Abp.Users;
using Yi.Framework.Bbs.Application.Contracts.Dtos.Assignment;
using Yi.Framework.Bbs.Domain.Entities.Assignment;
using Yi.Framework.Bbs.Domain.Managers;
using Yi.Framework.Bbs.Domain.Shared.Enums;
namespace Yi.Framework.Bbs.Application.Services;
/// <summary>
/// 任务系统
/// </summary>
[Authorize]
public class AssignmentService : ApplicationService
{
private readonly AssignmentManager _assignmentManager;
public AssignmentService(AssignmentManager assignmentManager)
{
_assignmentManager = assignmentManager;
}
/// <summary>
/// 接收任务
/// </summary>
/// <param name="id"></param>
[HttpPost("assignment/accept/{id}")]
public async Task AcceptAsync([FromRoute] Guid id)
{
await _assignmentManager.AcceptAsync(CurrentUser.GetId(), id);
}
/// <summary>
/// 领取任务奖励
/// </summary>
/// <param name="id"></param>
[HttpPost("assignment/complete/{id}")]
public async Task ReceiveRewardsAsync([FromRoute] Guid id)
{
await _assignmentManager.ReceiveRewardsAsync(id);
}
/// <summary>
/// 查看可接受的任务
/// </summary>
/// <returns></returns>
[HttpGet("assignment/receive")]
public async Task<List<AssignmentDefineGetListOutputDto>> GetCanReceiveListAsync()
{
var entities = await _assignmentManager.GetCanReceiveListAsync(CurrentUser.GetId());
var output = entities.Adapt<List<AssignmentDefineGetListOutputDto>>();
return output;
}
/// <summary>
/// 查询接受的任务
/// </summary>
[HttpGet("assignment")]
public async Task<List<AssignmentGetListOutputDto>> GetListAsync([FromQuery] AssignmentGetListInput input)
{
var output = await _assignmentManager._assignmentRepository._DbQueryable
.Where(x => x.UserId == CurrentUser.GetId())
.WhereIF(input.AssignmentQueryState == AssignmentQueryStateEnum.Progress,
x => x.AssignmentState == AssignmentStateEnum.Progress||
x.AssignmentState == AssignmentStateEnum.Completed)
.WhereIF(input.AssignmentQueryState == AssignmentQueryStateEnum.End,
x => x.AssignmentState == AssignmentStateEnum.End ||
x.AssignmentState == AssignmentStateEnum.Expired)
.OrderBy(x=>x.CreationTime)
.LeftJoin<AssignmentDefineAggregateRoot>((x, define) => x.AssignmentDefineId==define.Id)
.Select((x, define) => new AssignmentGetListOutputDto
{
Id = x.Id
},true)
.ToListAsync();
return output;
}
}

View File

@@ -1,109 +0,0 @@
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Application.Services;
using Yi.Framework.Bbs.Application.Contracts.Dtos.Bank;
using Yi.Framework.Bbs.Domain.Entities.Bank;
using Yi.Framework.Bbs.Domain.Managers;
using Yi.Framework.SqlSugarCore.Abstractions;
namespace Yi.Framework.Bbs.Application.Services.Bank
{
public class BankService : ApplicationService
{
private BankManager _bankManager;
private BbsUserManager _bbsUserManager;
private ISqlSugarRepository<BankCardAggregateRoot, Guid> _repository;
private ISqlSugarRepository<InterestRecordsAggregateRoot, Guid> _interestRepository;
public BankService(BankManager bankManager, BbsUserManager userManager, ISqlSugarRepository<BankCardAggregateRoot, Guid> repository, ISqlSugarRepository<InterestRecordsAggregateRoot, Guid> interestRepository)
{
_bankManager = bankManager;
_bbsUserManager = userManager;
_repository = repository;
_interestRepository = interestRepository;
}
/// <summary>
/// 获取最近24小时汇率记录
/// </summary>
/// <returns></returns>
[HttpGet("bank/interest")]
public async Task<List<InterestRecordsDto>> GetInterestRecordsAsync()
{
var entities = await _interestRepository._DbQueryable.OrderByDescending(x => x.CreationTime).ToPageListAsync(1, 24);
var output = entities.Adapt<List<InterestRecordsDto>>().OrderBy(x=>x.CreationTime).ToList();
return output;
}
/// <summary>
/// 获取登录用户全部银行卡信息
/// </summary>
/// <returns></returns>
[Authorize]
[HttpGet("bank")]
public async Task<List<BankCardDto>> GetBankCardListAsync()
{
var entities = await _repository._DbQueryable.Where(x => x.UserId == CurrentUser.Id).OrderBy(x=>x.CreationTime).ToListAsync();
var output = entities.Adapt<List<BankCardDto>>();
return output;
}
/// <summary>
/// 给用户申请银行卡
/// </summary>
/// <returns></returns>
[Authorize]
[HttpPost("bank/applying")]
public async Task ApplyingBankCardAsync()
{
var userInfo = await _bbsUserManager.GetBbsUserInfoAsync(CurrentUser.Id!.Value);
var banCardNum = await _repository.CountAsync(x => x.UserId == CurrentUser.Id!.Value);
var diffNum = userInfo.Level - banCardNum;
if (diffNum <= 0)
{
throw new UserFriendlyException($"申请失败,当前等级-【{userInfo.Level}】,最多可申领-【{userInfo.Level}】张银行卡,目前已拥有-【{banCardNum}】,请提升你的等级信誉,行长会考虑的");
}
else
{
await _bankManager.ApplyingBankCardAsync(CurrentUser.Id.Value, diffNum);
}
}
/// <summary>
/// 给银行卡提款
/// </summary>
/// <param name="cardId"></param>
/// <returns></returns>
[Authorize]
[HttpPut("bank/draw/{cardId}")]
public Task DrawMoneyAsync(Guid cardId)
{
return _bankManager.DrawMoneyAsync(cardId);
}
/// <summary>
/// 给银行卡存款
/// </summary>
/// <param name="cardId"></param>
/// <param name="moneyNum"></param>
/// <returns></returns>
[Authorize]
[HttpPut("bank/deposit/{cardId}/{moneyNum}")]
public async Task DepositAsync(Guid cardId, decimal moneyNum)
{
if (moneyNum < 50)
{
throw new UserFriendlyException("存款金额不能小于50");
}
var userInfo = await _bbsUserManager.GetBbsUserInfoAsync(CurrentUser.Id!.Value);
if (userInfo.Money < moneyNum)
{
throw new UserFriendlyException("存钱失败!你的钱钱不足,再存进去,就负数啦~");
}
await _bankManager.DepositAsync(cardId, moneyNum);
}
}
}

View File

@@ -1,72 +0,0 @@
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Yi.Framework.Bbs.Application.Contracts.Dtos.Notice;
using Yi.Framework.Bbs.Domain.Entities;
using Yi.Framework.SqlSugarCore.Abstractions;
namespace Yi.Framework.Bbs.Application.Services
{
public class BbsNoticeService : ApplicationService
{
private ISqlSugarRepository<BbsNoticeAggregateRoot, Guid> _repository;
public BbsNoticeService(ISqlSugarRepository<BbsNoticeAggregateRoot, Guid> repository)
{
_repository = repository;
}
/// <summary>
/// 查询用户的消息,需登录
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[Authorize]
public async Task<PagedResultDto<BbsNoticeGetListOutputDto>> GetListAsync(BbsNoticeGetListInputVo input)
{
RefAsync<int> total = 0;
var entities = await _repository._DbQueryable.Where(x => x.AcceptUserId == CurrentUser.Id)
.OrderByDescending(x => x.CreationTime)
.ToPageListAsync(input.SkipCount, input.MaxResultCount, total);
var output = entities.Adapt<List<BbsNoticeGetListOutputDto>>();
return new PagedResultDto<BbsNoticeGetListOutputDto>(total, output);
}
/// <summary>
/// 已读消息,不传guid代表一键已读需登录
/// </summary>
/// <returns></returns>
[Authorize]
[Route("bbs-notice/read/{noticeId?}")]
public async Task PutReadAsync(Guid? noticeId)
{
//一键已读
if (noticeId is null)
{
await _repository._Db.Updateable<BbsNoticeAggregateRoot>()
.SetColumns(it => it.IsRead == true)
.Where(x => x.AcceptUserId == CurrentUser.Id)
.Where(x => x.IsRead == false)
.ExecuteCommandAsync();
}
//已读一条
else
{
await _repository._Db.Updateable<BbsNoticeAggregateRoot>()
.SetColumns(it => it.IsRead == true)
.Where(x => x.AcceptUserId == CurrentUser.Id)
.Where(x => x.IsRead == false)
.Where(x => x.Id == noticeId)
.ExecuteCommandAsync();
}
}
}
}

View File

@@ -1,46 +0,0 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Application.Services;
using Yi.Framework.Bbs.Application.Contracts.IServices;
using Yi.Framework.Bbs.Domain.Managers;
namespace Yi.Framework.Bbs.Application.Services
{
public class BbsUserInfoService : ApplicationService, IBbsUserInfoService
{
private BbsUserManager _bbsUserManager;
public BbsUserInfoService(BbsUserManager bbsUserManager)
{
_bbsUserManager = bbsUserManager;
}
[HttpGet("bbs-user/{userNameOrUserId}")]
public async Task<BbsUserInfoDto> GetUserInfoByUserNameOrUserIdAsync([FromRoute][Required] string userNameOrUserId)
{
Guid userId;
if (Guid.TryParse(userNameOrUserId, out var userGuidId))
{
userId = userGuidId;
}
else
{
var userEntity = await _bbsUserManager._userRepository.GetFirstAsync(x => x.UserName == userNameOrUserId);
if (userEntity == null)
{
throw new UserFriendlyException("该用户不存在");
}
userId= userEntity.Id;
}
var output =await _bbsUserManager.GetBbsUserInfoAsync(userId);
//不是自己
if (CurrentUser.Id != output.Id)
{
output.Phone = null;
output.Email=null;
}
return output!;
}
}
}

View File

@@ -1,69 +0,0 @@
using Microsoft.AspNetCore.Authorization;
using Volo.Abp;
using Volo.Abp.Application.Services;
using Volo.Abp.Uow;
using Yi.Framework.Bbs.Application.Contracts.Dtos.Argee;
using Yi.Framework.Bbs.Domain.Entities.Forum;
using Yi.Framework.SqlSugarCore.Abstractions;
namespace Yi.Framework.Bbs.Application.Services.Forum
{
/// <summary>
/// 点赞功能
/// </summary>
public class AgreeService : ApplicationService, IApplicationService
{
public AgreeService(ISqlSugarRepository<AgreeEntity> repository, ISqlSugarRepository<DiscussAggregateRoot> discssRepository)
{
_repository = repository;
_discssRepository = discssRepository;
}
private ISqlSugarRepository<AgreeEntity> _repository { get; set; }
private ISqlSugarRepository<DiscussAggregateRoot> _discssRepository { get; set; }
/// <summary>
/// 点赞,返回true为点赞+1返回false为点赞-1
/// Todo: 可放入领域层
/// </summary>
/// <returns></returns>
[Authorize]
public async Task<AgreeDto> PostOperateAsync(Guid discussId)
{
var entity = await _repository.GetFirstAsync(x => x.DiscussId == discussId && x.CreatorId == CurrentUser.Id);
//判断是否已经点赞过
if (entity is null)
{
//没点赞过,添加记录即可,,修改总点赞数量
await _repository.InsertAsync(new AgreeEntity(discussId));
var discussEntity = await _discssRepository.GetByIdAsync(discussId);
if (discussEntity is null)
{
throw new UserFriendlyException("主题为空");
}
discussEntity.AgreeNum += 1;
await _discssRepository.UpdateAsync(discussEntity);
return new AgreeDto(true);
}
else
{
//点赞过,删除即可,修改总点赞数量
await _repository.DeleteAsync(entity);
var discussEntity = await _discssRepository.GetByIdAsync(discussId);
if (discussEntity is null)
{
throw new UserFriendlyException("主题为空");
}
discussEntity.AgreeNum -= 1;
await _discssRepository.UpdateAsync(discussEntity);
return new AgreeDto(false);
}
}
}
}

View File

@@ -1,207 +0,0 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Repositories;
using Yi.Framework.Bbs.Application.Contracts.Dtos.Article;
using Yi.Framework.Bbs.Application.Contracts.Dtos.Plate;
using Yi.Framework.Bbs.Application.Contracts.IServices;
using Yi.Framework.Bbs.Domain.Entities.Forum;
using Yi.Framework.Bbs.Domain.Managers;
using Yi.Framework.Bbs.Domain.Repositories;
using Yi.Framework.Bbs.Domain.Shared.Consts;
using Yi.Framework.Bbs.Domain.Shared.Model;
using Yi.Framework.Core.Extensions;
using Yi.Framework.Ddd.Application;
using Yi.Framework.Rbac.Domain.Authorization;
using Yi.Framework.Rbac.Domain.Extensions;
using Yi.Framework.Rbac.Domain.Shared.Consts;
using Yi.Framework.SqlSugarCore.Abstractions;
namespace Yi.Framework.Bbs.Application.Services.Forum
{
/// <summary>
/// Article服务实现
/// </summary>
public class ArticleService : YiCrudAppService<ArticleAggregateRoot, ArticleGetOutputDto, ArticleGetListOutputDto,
Guid, ArticleGetListInputVo, ArticleCreateInputVo, ArticleUpdateInputVo>,
IArticleService
{
public ArticleService(IArticleRepository articleRepository,
ISqlSugarRepository<DiscussAggregateRoot> discussRepository,
IDiscussService discussService,
ForumManager forumManager) : base(articleRepository)
{
_articleRepository = articleRepository;
_discussRepository = discussRepository;
_discussService = discussService;
_forumManager = forumManager;
}
private ForumManager _forumManager;
private IArticleRepository _articleRepository;
private ISqlSugarRepository<DiscussAggregateRoot> _discussRepository;
private IDiscussService _discussService;
public override async Task<PagedResultDto<ArticleGetListOutputDto>> GetListAsync(ArticleGetListInputVo input)
{
RefAsync<int> total = 0;
var entities = await _articleRepository._DbQueryable
.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name!))
.WhereIF(input.StartTime is not null && input.EndTime is not null,
x => x.CreationTime >= input.StartTime && x.CreationTime <= input.EndTime)
.ToPageListAsync(input.SkipCount, input.MaxResultCount, total);
return new PagedResultDto<ArticleGetListOutputDto>(total, await MapToGetListOutputDtosAsync(entities));
}
/// <summary>
/// 查询文章
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public override async Task<ArticleGetOutputDto> GetAsync(Guid id)
{
var entity = await _articleRepository.GetAsync(id);
var output = entity.Adapt<ArticleGetOutputDto>();
if (!await _forumManager.VerifyDiscussPermissionAsync(entity.DiscussId, CurrentUser.Id, CurrentUser.Roles))
{
output.SetNoPermission();
}
else
{
output.SetPassPermission();
}
return output;
}
/// <summary>
/// 获取文章全部树级信息
/// </summary>
/// <param name="discussId"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
[Route("article/all/discuss-id/{discussId}")]
public async Task<List<ArticleAllOutputDto>> GetAllAsync([FromRoute] Guid discussId)
{
var entities = await _articleRepository.GetTreeAsync(x => x.DiscussId == discussId);
var items = entities.Adapt<List<ArticleAllOutputDto>>();
return items;
}
/// <summary>
/// 查询文章概述
/// </summary>
/// <param name="discussId"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
public async Task<List<ArticleGetListOutputDto>> GetDiscussIdAsync([FromRoute] Guid discussId)
{
if (!await _discussRepository.IsAnyAsync(x => x.Id == discussId))
{
throw new UserFriendlyException(DiscussConst.No_Exist);
}
var entities = await _articleRepository.GetTreeAsync(x => x.DiscussId == discussId);
var items = await MapToGetListOutputDtosAsync(entities);
return items;
}
/// <summary>
/// 发表文章
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
[Permission("bbs:article:add")]
[Authorize]
public async override Task<ArticleGetOutputDto> CreateAsync(ArticleCreateInputVo input)
{
await VerifyPermissionAsync(input.DiscussId);
return await base.CreateAsync(input);
}
/// <summary>
/// 更新文章
/// </summary>
/// <param name="id"></param>
/// <param name="input"></param>
/// <returns></returns>
public override async Task<ArticleGetOutputDto> UpdateAsync(Guid id, ArticleUpdateInputVo input)
{
var entity = await _articleRepository.GetByIdAsync(id);
await VerifyPermissionAsync(entity.DiscussId);
return await base.UpdateAsync(id, input);
}
/// <summary>
/// 删除文章
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public override async Task DeleteAsync(Guid id)
{
var entity = await _articleRepository.GetByIdAsync(id);
await VerifyPermissionAsync(entity.DiscussId);
await base.DeleteAsync(id);
}
/// <summary>
/// 导入文章
/// </summary>
/// <returns></returns>
public async Task PostImportAsync([FromQuery] ArticleImprotDto input,
[FromForm] [Required] IFormFileCollection file)
{
await VerifyPermissionAsync(input.DiscussId);
var fileObjs = new List<FileObject>();
if (file.Count > 0)
{
foreach (var item in file)
{
if (item.Length > 0)
{
using (var stream = item.OpenReadStream())
{
using (var fileStream = new MemoryStream())
{
await item.CopyToAsync(fileStream);
var bytes = fileStream.ToArray();
// 将字节转换成字符串
var content = Encoding.UTF8.GetString(bytes);
fileObjs.Add(new FileObject() { FileName = item.FileName, Content = content });
}
}
}
}
}
else
{
throw new UserFriendlyException("未选择文件");
}
//使用简单工厂根据传入的类型进行判断
await _forumManager.PostImportAsync(input.DiscussId, input.ArticleParentId, fileObjs, input.ImportType);
}
private async Task VerifyPermissionAsync(Guid discussId)
{
if (!await _forumManager.VerifyDiscussPermissionAsync(discussId, CurrentUser.Id, isVerifyLook: false))
{
throw new UserFriendlyException("您无权限进行操作", "403");
}
}
}
}

View File

@@ -1,32 +0,0 @@
using SqlSugar;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Repositories;
using Yi.Framework.Bbs.Application.Contracts.Dtos.Banner;
using Yi.Framework.Bbs.Application.Contracts.IServices;
using Yi.Framework.Bbs.Domain.Entities.Forum;
using Yi.Framework.Ddd.Application;
using Yi.Framework.SqlSugarCore.Abstractions;
namespace Yi.Framework.Bbs.Application.Services.Forum
{
/// <summary>
/// Banner服务实现
/// </summary>
public class BannerService : YiCrudAppService<BannerAggregateRoot, BannerGetOutputDto, BannerGetListOutputDto, Guid, BannerGetListInputVo, BannerCreateInputVo, BannerUpdateInputVo>,
IBannerService
{
private ISqlSugarRepository<BannerAggregateRoot, Guid> _repository;
public BannerService(ISqlSugarRepository<BannerAggregateRoot, Guid> repository) : base(repository)
{
_repository = repository;
}
public override async Task<PagedResultDto<BannerGetListOutputDto>> GetListAsync(BannerGetListInputVo input)
{
RefAsync<int> total = 0;
var entities = await _repository._DbQueryable.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name!))
.ToPageListAsync(input.SkipCount, input.MaxResultCount, total);
return new PagedResultDto<BannerGetListOutputDto>(total, await MapToGetListOutputDtosAsync(entities));
}
}
}

View File

@@ -1,149 +0,0 @@
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Yi.Framework.Bbs.Application.Contracts.Dtos.BbsUser;
using Yi.Framework.Bbs.Application.Contracts.Dtos.Comment;
using Yi.Framework.Bbs.Application.Contracts.IServices;
using Yi.Framework.Bbs.Domain.Entities.Forum;
using Yi.Framework.Bbs.Domain.Managers;
using Yi.Framework.Bbs.Domain.Shared.Consts;
using Yi.Framework.Ddd.Application;
using Yi.Framework.Rbac.Domain.Authorization;
using Yi.Framework.Rbac.Domain.Extensions;
using Yi.Framework.Rbac.Domain.Shared.Consts;
using Yi.Framework.SqlSugarCore.Abstractions;
namespace Yi.Framework.Bbs.Application.Services.Forum
{
/// <summary>
/// 评论
/// </summary>
public class CommentService : YiCrudAppService<CommentAggregateRoot, CommentGetOutputDto, CommentGetListOutputDto, Guid, CommentGetListInputVo, CommentCreateInputVo, CommentUpdateInputVo>,
ICommentService
{
private readonly ISqlSugarRepository<CommentAggregateRoot, Guid> _repository;
private readonly BbsUserManager _bbsUserManager;
public CommentService(ForumManager forumManager, ISqlSugarRepository<DiscussAggregateRoot> discussRepository, IDiscussService discussService, ISqlSugarRepository<CommentAggregateRoot, Guid> CommentRepository, BbsUserManager bbsUserManager) : base(CommentRepository)
{
_forumManager = forumManager;
_discussRepository = discussRepository;
_discussService = discussService;
_repository = CommentRepository;
_bbsUserManager = bbsUserManager;
}
private ForumManager _forumManager { get; set; }
private ISqlSugarRepository<DiscussAggregateRoot> _discussRepository { get; set; }
private IDiscussService _discussService { get; set; }
/// <summary>
/// 获取改主题下的评论,结构为二维列表,该查询无分页
/// </summary>
/// <param name="discussId"></param>
/// <param name="input"></param>
/// <returns></returns>
public async Task<PagedResultDto<CommentGetListOutputDto>> GetDiscussIdAsync([FromRoute] Guid discussId, [FromQuery] CommentGetListInputVo input)
{
await _forumManager.VerifyDiscussPermissionAsync(discussId,CurrentUser.Id);
var entities = await _repository._DbQueryable.WhereIF(!string.IsNullOrEmpty(input.Content), x => x.Content.Contains(input.Content))
.Where(x => x.DiscussId == discussId)
.Includes(x => x.CreateUser)
.ToListAsync();
//该实体需要进行转换
//同时为所有用户id进行bbs的扩展即可
List<Guid> userIds = entities.Where(x => x.CreatorId != null).Select(x => x.CreatorId ?? Guid.Empty).ToList();
var bbsUserInfoDic = (await _bbsUserManager.GetBbsUserInfoAsync(userIds)).ToDictionary(x => x.Id);
//------数据查询完成------,以下只是dto的简单组装
//从根目录开始组装
//结果初始值,第一层等于全部根节点
var allOutPut = entities.OrderByDescending(x => x.CreationTime).ToList();
//获取全量主题评论, 先获取顶级的,将其他子组合到顶级下,形成一个二维,先转成dto
List<CommentGetListOutputDto> allOutoutDto = await MapToGetListOutputDtosAsync(allOutPut);
//开始映射额外用户信息字段
allOutoutDto?.ForEach(x => x.CreateUser = bbsUserInfoDic[x.CreatorId ?? Guid.Empty].Adapt<BbsUserGetOutputDto>());
//开始组装dto的层级关系
//将全部数据进行hash
var dic = allOutoutDto.ToDictionary(x => x.Id);
foreach (var comment in allOutoutDto)
{
//不是根节点,需要赋值 被评论者用户信息等
if (comment.ParentId != Guid.Empty)
{
if (dic.ContainsKey(comment.ParentId))
{
var parentComment = dic[comment.ParentId];
comment.CommentedUser = parentComment.CreateUser;
}
else
{
continue;
}
}
//root或者parent id根节点都是等于0的
var id = comment.RootId;
if (id != Guid.Empty)
{
dic[id].Children.Add(comment);
}
}
//子类需要排序
var rootOutoutDto = allOutoutDto.Where(x => x.ParentId == Guid.Empty).ToList();
rootOutoutDto?.ForEach(x =>
{
x.Children = x.Children.OrderByDescending(x => x.CreationTime).ToList();
});
return new PagedResultDto<CommentGetListOutputDto>(entities.Count(), rootOutoutDto);
}
/// <summary>
/// 发表评论
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
[Permission("bbs:comment:add")]
[Authorize]
public override async Task<CommentGetOutputDto> CreateAsync(CommentCreateInputVo input)
{
if (string.IsNullOrWhiteSpace(input.Content)|| input.Content=="<p><br></p>")
{
throw new UserFriendlyException("评论不能为空");
}
var discuess = await _discussRepository.GetFirstAsync(x => x.Id == input.DiscussId);
if (discuess is null)
{
throw new UserFriendlyException(DiscussConst.No_Exist);
}
//不是超级管理员,且主题开启禁止评论
if (discuess.IsDisableCreateComment == true && !CurrentUser.GetPermissions().Contains(UserConst.AdminPermissionCode))
{
throw new UserFriendlyException("该主题已禁止评论功能");
}
var entity = await _forumManager.CreateCommentAsync(input.DiscussId, input.ParentId, input.RootId, input.Content);
return await MapToGetOutputDtoAsync(entity);
}
}
}

View File

@@ -1,53 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Data;
using Yi.Framework.Bbs.Application.Contracts.Dtos.MyType;
using Yi.Framework.Bbs.Application.Contracts.IServices;
using Yi.Framework.Bbs.Domain.Entities.Forum;
using Yi.Framework.Ddd.Application;
using Yi.Framework.SqlSugarCore.Abstractions;
namespace Yi.Framework.Bbs.Application.Services.Forum
{
/// <summary>
/// DiscussLable服务实现
/// </summary>
public class DiscussLableService : YiCrudAppService<DiscussLableAggregateRoot, DiscussLableOutputDto,
DiscussLableGetListOutputDto, Guid, DiscussLableGetListInputVo, DiscussLableCreateInputVo,
DiscussLableUpdateInputVo>,
IDiscussLableService
{
private ISqlSugarRepository<DiscussLableAggregateRoot, Guid> _repository;
public DiscussLableService(ISqlSugarRepository<DiscussLableAggregateRoot, Guid> repository) : base(repository)
{
_repository = repository;
}
[HttpGet("discuss-lable/all")]
public async Task<ListResultDto<DiscussLableGetListOutputDto>> GetAllListAsync(DiscussLableGetListInputVo input)
{
var order = input.Sorting ?? nameof(DiscussLableAggregateRoot.Name);
var output = await _repository._DbQueryable
.WhereIF(input.Name is not null, x => x.Name.Contains(input.Name))
.OrderBy(order)
.Select(x => new DiscussLableGetListOutputDto(), true)
.ToListAsync();
return new ListResultDto<DiscussLableGetListOutputDto>(output);
}
public override async Task<PagedResultDto<DiscussLableGetListOutputDto>> GetListAsync(
DiscussLableGetListInputVo input)
{
RefAsync<int> total = 0;
var order = input.Sorting ?? nameof(DiscussLableAggregateRoot.Name);
var output = await _repository._DbQueryable
.WhereIF(input.Name is not null, x => x.Name.Contains(input.Name))
.OrderBy(order)
.Select(x => new DiscussLableGetListOutputDto(), true)
.ToPageListAsync(input.SkipCount, input.MaxResultCount, total);
return new PagedResultDto<DiscussLableGetListOutputDto>(total, output);
}
}
}

View File

@@ -1,313 +0,0 @@
using System.Linq;
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using TencentCloud.Pds.V20210701.Models;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.EventBus.Local;
using Volo.Abp.Users;
using Yi.Framework.Bbs.Application.Contracts.Dtos.BbsUser;
using Yi.Framework.Bbs.Application.Contracts.Dtos.Discuss;
using Yi.Framework.Bbs.Application.Contracts.Dtos.DiscussLable;
using Yi.Framework.Bbs.Application.Contracts.IServices;
using Yi.Framework.Bbs.Domain.Entities;
using Yi.Framework.Bbs.Domain.Entities.Forum;
using Yi.Framework.Bbs.Domain.Managers;
using Yi.Framework.Bbs.Domain.Repositories;
using Yi.Framework.Bbs.Domain.Shared.Consts;
using Yi.Framework.Bbs.Domain.Shared.Enums;
using Yi.Framework.Bbs.Domain.Shared.Etos;
using Yi.Framework.Ddd.Application;
using Yi.Framework.Rbac.Application.Contracts.Dtos.User;
using Yi.Framework.Rbac.Domain.Authorization;
using Yi.Framework.Rbac.Domain.Entities;
using Yi.Framework.Rbac.Domain.Extensions;
using Yi.Framework.Rbac.Domain.Shared.Consts;
using Yi.Framework.SqlSugarCore.Abstractions;
namespace Yi.Framework.Bbs.Application.Services.Forum
{
/// <summary>
/// Discuss应用服务实现,用于参数校验、领域服务业务组合、日志记录、事务处理、账户信息
/// </summary>
public class DiscussService : YiCrudAppService<DiscussAggregateRoot, DiscussGetOutputDto, DiscussGetListOutputDto,
Guid, DiscussGetListInputVo, DiscussCreateInputVo, DiscussUpdateInputVo>,
IDiscussService
{
private ISqlSugarRepository<DiscussTopEntity> _discussTopRepository;
private ISqlSugarRepository<AgreeEntity> _agreeRepository;
private BbsUserManager _bbsUserManager;
private IDiscussLableRepository _discussLableRepository;
public DiscussService(BbsUserManager bbsUserManager, ForumManager forumManager,
ISqlSugarRepository<DiscussTopEntity> discussTopRepository,
ISqlSugarRepository<PlateAggregateRoot> plateEntityRepository, ILocalEventBus localEventBus,
ISqlSugarRepository<AgreeEntity> agreeRepository, IDiscussLableRepository discussLableRepository) : base(forumManager._discussRepository)
{
_forumManager = forumManager;
_plateEntityRepository = plateEntityRepository;
_localEventBus = localEventBus;
_agreeRepository = agreeRepository;
_discussLableRepository = discussLableRepository;
_discussTopRepository = discussTopRepository;
_bbsUserManager = bbsUserManager;
}
private readonly ILocalEventBus _localEventBus;
private ForumManager _forumManager { get; set; }
private ISqlSugarRepository<PlateAggregateRoot> _plateEntityRepository { get; set; }
/// <summary>
/// 单查
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public async override Task<DiscussGetOutputDto> GetAsync(Guid id)
{
//查询主题发布 浏览主题 事件,浏览数+1
var output = await _forumManager._discussRepository._DbQueryable
.LeftJoin<UserAggregateRoot>((discuss, user) => discuss.CreatorId == user.Id)
.LeftJoin<BbsUserExtraInfoEntity>((discuss, user, info) => user.Id == info.UserId)
.LeftJoin<PlateAggregateRoot>((discuss, user, info, plate) => plate.Id == discuss.PlateId)
.Select((discuss, user, info, plate) => new DiscussGetOutputDto
{
Id = discuss.Id,
IsAgree = false,
User = new BbsUserGetListOutputDto()
{
UserName = user.UserName,
Nick = user.Nick,
Icon = user.Icon,
Id = user.Id,
Level = info.Level,
UserLimit = info.UserLimit,
Money = info.Money,
Experience = info.Experience
},
Plate = new Contracts.Dtos.Plate.PlateGetOutputDto()
{
Name = plate.Name,
Id = plate.Id,
Code = plate.Code,
Introduction = plate.Introduction,
Logo = plate.Logo
}
}, true)
.FirstAsync(discuss => discuss.Id == id);
if (output is null)
{
throw new UserFriendlyException("该主题不存在", "404");
}
//组装点赞
var agreeCreatorList =
(await _agreeRepository._DbQueryable.Where(x => x.DiscussId == output.Id).Select(x=>x.CreatorId).ToListAsync());
//已登录
if (CurrentUser.Id is not null)
{
output.IsAgree = agreeCreatorList.Contains(CurrentUser.Id);
}
//组装标签
var lableDic=await _discussLableRepository.GetDiscussLableCacheMapAsync();
foreach (var lableId in output.DiscussLableIds)
{
if (lableDic.TryGetValue(lableId,out var item))
{
output.Lables.Add(item.Adapt<DiscussLableGetOutputDto>());
}
}
//如果没有权限
if (!await _forumManager.VerifyDiscussPermissionAsync(output.Id,CurrentUser.Id, CurrentUser.Roles))
{
output.SetNoPermission();
}
else
{
output.SetPassPermission();
}
await _localEventBus.PublishAsync(new SeeDiscussEventArgs
{ DiscussId = output.Id, OldSeeNum = output.SeeNum });
return output;
}
/// <summary>
/// 查询
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public override async Task<PagedResultDto<DiscussGetListOutputDto>> GetListAsync(
[FromQuery] DiscussGetListInputVo input)
{
//需要关联创建者用户
RefAsync<int> total = 0;
var items = await _forumManager._discussRepository._DbQueryable
.WhereIF(!string.IsNullOrEmpty(input.Title), x => x.Title.Contains(input.Title))
.WhereIF(input.PlateId is not null, x => x.PlateId == input.PlateId)
.WhereIF(input.IsTop is not null, x => x.IsTop == input.IsTop)
.WhereIF(input.UserId is not null, x => x.CreatorId == input.UserId)
.LeftJoin<UserAggregateRoot>((discuss, user) => discuss.CreatorId == user.Id)
.WhereIF(input.UserName is not null, (discuss, user) => user.UserName == input.UserName!)
.LeftJoin<BbsUserExtraInfoEntity>((discuss, user, info) => user.Id == info.UserId)
.OrderByDescending(discuss => discuss.OrderNum)
//已提示杰哥新增表达式
// .OrderByIF(input.Type == QueryDiscussTypeEnum.New,
// @"COALESCE(discuss.LastModificationTime, discuss.CreationTime) DESC")
//采用上方写法
.OrderByIF(input.Type == QueryDiscussTypeEnum.New,discuss=>SqlFunc.Coalesce(discuss.LastModificationTime,discuss.CreationTime),OrderByType.Desc)
.OrderByIF(input.Type == QueryDiscussTypeEnum.Host, discuss => discuss.SeeNum, OrderByType.Desc)
.OrderByIF(input.Type == QueryDiscussTypeEnum.Suggest, discuss => discuss.AgreeNum, OrderByType.Desc)
.Select((discuss, user, info) => new DiscussGetListOutputDto
{
Id = discuss.Id,
// 优化查询,不使用子查询
// IsAgree = SqlFunc.Subqueryable<AgreeEntity>().WhereIF(CurrentUser.Id != null, x => x.CreatorId == CurrentUser.Id && x.DiscussId == discuss.Id).Any(),
User = new BbsUserGetListOutputDto()
{
Id = user.Id,
UserName = user.UserName,
Nick = user.Nick,
Icon = user.Icon,
Level = info.Level,
UserLimit = info.UserLimit,
Money = info.Money,
Experience = info.Experience
}
}, true)
.ToPageListAsync(input.SkipCount, input.MaxResultCount, total);
var discussId = items.Select(x => x.Id);
//点赞字典key为主题idy为用户ids
var agreeDic =
(await _agreeRepository._DbQueryable.Where(x => discussId.Contains(x.DiscussId)).ToListAsync())
.GroupBy(x => x.DiscussId)
.ToDictionary(x => x.Key, y => y.Select(y => y.CreatorId).ToList());
var levelCacheDic= await _bbsUserManager.GetLevelCacheMapAsync();
var lableDic=await _discussLableRepository.GetDiscussLableCacheMapAsync();
//组装等级、是否点赞赋值、标签
items?.ForEach(x =>
{
x.User.LevelName = levelCacheDic[x.User.Level].Name;
if (CurrentUser.Id is not null)
{
//默认fasle
if (agreeDic.TryGetValue(x.Id,out var userIds))
{
x.IsAgree = userIds.Contains(CurrentUser.Id);
}
}
foreach (var lableId in x.DiscussLableIds)
{
if (lableDic.TryGetValue(lableId,out var item))
{
x.Lables.Add(item.Adapt<DiscussLableGetOutputDto>());
}
}
});
return new PagedResultDto<DiscussGetListOutputDto>(total, items);
}
/// <summary>
/// 获取首页的置顶主题
/// </summary>
/// <returns></returns>
public async Task<List<DiscussGetListOutputDto>> GetListTopAsync()
{
var output = await _discussTopRepository._DbQueryable
.LeftJoin<DiscussAggregateRoot>((top, discuss) => top.DiscussId == discuss.Id)
.LeftJoin<UserAggregateRoot>((top, discuss, user) => discuss.CreatorId == user.Id)
.LeftJoin<BbsUserExtraInfoEntity>((top, discuss, user, info) => user.Id == info.UserId)
.OrderByDescending(top => top.OrderNum)
.Select((top, discuss, user, info) => new DiscussGetListOutputDto
{
Id = discuss.Id,
IsAgree = SqlFunc.Subqueryable<AgreeEntity>().WhereIF(CurrentUser.Id != null,
x => x.CreatorId == CurrentUser.Id && x.DiscussId == discuss.Id).Any(),
User = new BbsUserGetListOutputDto
{
Id = user.Id,
Name = user.Name,
Sex = user.Sex,
State = user.State,
Address = user.Address,
Age = user.Age,
CreationTime = user.CreationTime,
Level = info.Level,
Introduction = user.Introduction,
Icon = user.Icon,
Nick = user.Nick,
UserName = user.UserName,
Remark = user.Remark,
UserLimit = info.UserLimit,
Money = info.Money,
Experience = info.Experience,
}
}, true)
.ToListAsync();
var levelCacheDic= await _bbsUserManager.GetLevelCacheMapAsync();
var lableDic=await _discussLableRepository.GetDiscussLableCacheMapAsync();
output?.ForEach(x =>
{
x.User.LevelName = levelCacheDic[x.User.Level].Name;
foreach (var lableId in x.DiscussLableIds)
{
if (lableDic.TryGetValue(lableId,out var item))
{
x.Lables.Add(item.Adapt<DiscussLableGetOutputDto>());
}
}
});
return output;
}
/// <summary>
/// 创建主题
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[Permission("bbs:discuss:add")]
[Authorize]
public override async Task<DiscussGetOutputDto> CreateAsync(DiscussCreateInputVo input)
{
var plate = await _plateEntityRepository.FindAsync(x => x.Id == input.PlateId);
if (plate is null)
{
throw new UserFriendlyException(PlateConst.No_Exist);
}
if (await _forumManager._discussRepository.IsAnyAsync(x => x.Title == input.Title))
{
throw new UserFriendlyException(DiscussConst.Repeat);
}
//如果开启了禁用创建主题
if (plate.IsDisableCreateDiscuss == true)
{
//只有超级管理员权限才能进行发布
if (!CurrentUser.GetPermissions().Contains(UserConst.AdminPermissionCode))
{
throw new UserFriendlyException("该板块已禁止创建主题,请在其他板块中发布");
}
}
var entity = await _forumManager.CreateDiscussAsync(await MapToEntityAsync(input));
return await MapToGetOutputDtoAsync(entity);
}
public override Task<DiscussGetOutputDto> UpdateAsync(Guid id, DiscussUpdateInputVo input)
{
return base.UpdateAsync(id, input);
}
}
}

View File

@@ -1,37 +0,0 @@
using SqlSugar;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Repositories;
using Yi.Framework.Bbs.Application.Contracts.Dtos.Plate;
using Yi.Framework.Bbs.Application.Contracts.IServices;
using Yi.Framework.Bbs.Domain.Entities.Forum;
using Yi.Framework.Ddd.Application;
using Yi.Framework.Rbac.Application.Contracts.Dtos.Config;
using Yi.Framework.SqlSugarCore.Abstractions;
namespace Yi.Framework.Bbs.Application.Services.Forum
{
/// <summary>
/// Plate服务实现
/// </summary>
public class PlateService : YiCrudAppService<PlateAggregateRoot, PlateGetOutputDto, PlateGetListOutputDto, Guid, PlateGetListInputVo, PlateCreateInputVo, PlateUpdateInputVo>,
IPlateService
{
private ISqlSugarRepository<PlateAggregateRoot, Guid> _repository;
public PlateService(ISqlSugarRepository<PlateAggregateRoot, Guid> repository) : base(repository)
{
_repository = repository;
}
public override async Task<PagedResultDto<PlateGetListOutputDto>> GetListAsync(PlateGetListInputVo input)
{
RefAsync<int> total = 0;
var entities = await _repository._DbQueryable.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name!))
.WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Name.Contains(input.Code!))
.WhereIF(input.StartTime is not null && input.EndTime is not null, x => x.CreationTime >= input.StartTime && x.CreationTime <= input.EndTime)
.OrderByDescending(x => x.OrderNum)
.ToPageListAsync(input.SkipCount, input.MaxResultCount, total);
return new PagedResultDto<PlateGetListOutputDto>(total, await MapToGetListOutputDtosAsync(entities));
}
}
}

View File

@@ -1,82 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Application.Services;
using Volo.Abp.EventBus.Local;
using Volo.Abp.Users;
using Yi.Framework.Bbs.Application.Contracts.Dtos.Integral;
using Yi.Framework.Bbs.Domain.Managers;
using Yi.Framework.Bbs.Domain.Shared.Etos;
using Yi.Framework.Rbac.Domain.Authorization;
namespace Yi.Framework.Bbs.Application.Services.Integral
{
public class IntegralService : ApplicationService
{
private IntegralManager _integralManager;
private ICurrentUser _currentUser;
private ILocalEventBus _localEventBus;
public IntegralService(IntegralManager integralManager, ICurrentUser currentUser, ILocalEventBus localEventBus)
{
_integralManager = integralManager;
_currentUser = currentUser;
_localEventBus = localEventBus;
}
/// <summary>
/// 签到
/// </summary>
/// <returns></returns>
[Authorize]
public async Task<object> PostSignInAsync()
{
var value = await _integralManager.SignInAsync(_currentUser.Id ?? Guid.Empty);
return new { value };
}
/// <summary>
/// 获取本月签到记录
/// Todo: 可放入领域层
/// </summary>
/// <returns></returns>
[Authorize]
[HttpGet("integral/sign-in/record")]
public async Task<SignInDto> GetSignInRecordAsync()
{
var output = new SignInDto();
DateTime lastMonth = DateTime.Now.AddMonths(-1);
DateTime lastDayOfMonth = new DateTime(lastMonth.Year, lastMonth.Month, 1).AddMonths(1).AddDays(-1);
DateTime startOfLastDay = new DateTime(lastDayOfMonth.Year, lastDayOfMonth.Month, lastDayOfMonth.Day, 0, 0, 0);
//获取当前用户本月的数据+上个月最后一天的数据
var entities = await _integralManager._signInRepository.GetListAsync(x => x.CreatorId == CurrentUser.Id
&& x.CreationTime >= startOfLastDay);
if (entities.Count() == 0)
{
//返回默认值
return output;
}
//拿到最末尾的数据
var lastEntity = entities.OrderBy(x => x.CreationTime).LastOrDefault();
//判断当前时间和最后时间是否为连续的
if (lastEntity.CreationTime.Day >= DateTime.Now.AddDays(-1).Day)
{
output.CurrentContinuousNumber = lastEntity.ContinuousNumber;
}
//去除上个月查询的数据
output.SignInItem = entities.Where(x => x.CreationTime.Month == DateTime.Now.Month).Select(x => new SignInItemDto { Id = x.Id, CreationTime = x.CreationTime }).OrderBy(x => x.CreationTime).ToList();
return output;
}
}
}

View File

@@ -1,66 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Repositories;
using Yi.Framework.Bbs.Application.Contracts.Dtos.Level;
using Yi.Framework.Bbs.Application.Contracts.IServices;
using Yi.Framework.Bbs.Domain.Entities.Integral;
using Yi.Framework.Bbs.Domain.Managers;
using Yi.Framework.Bbs.Domain.Shared.Consts;
using Yi.Framework.Ddd.Application;
using Yi.Framework.SqlSugarCore.Abstractions;
namespace Yi.Framework.Bbs.Application.Services.Integral
{
/// <summary>
/// 等级服务
/// </summary>
public class LevelService : YiCrudAppService<LevelAggregateRoot, LevelOutputDto, Guid, LevelGetListInputDto>, ILevelService
{
private ISqlSugarRepository<LevelAggregateRoot, Guid> _repository;
private LevelManager _levelManager;
public LevelService(ISqlSugarRepository<LevelAggregateRoot, Guid> repository, LevelManager levelManager) : base(repository)
{
_repository = repository;
_levelManager = levelManager;
}
/// <summary>
/// 查询等级配置
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public override async Task<PagedResultDto<LevelOutputDto>> GetListAsync(LevelGetListInputDto input)
{
RefAsync<int> total = 0;
var entities = await _repository._DbQueryable
.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name!))
.WhereIF(input.MinLevel is not null, x => x.CurrentLevel >= input.MinLevel)
.OrderBy(x => x.CurrentLevel)
.ToPageListAsync(input.SkipCount, input.MaxResultCount, total);
return new PagedResultDto<LevelOutputDto>(total, await MapToGetListOutputDtosAsync(entities));
}
/// <summary>
/// 升级等级
/// </summary>
/// <returns></returns>
[Authorize]
public async Task UpdateUpgradeAsync(int experience)
{
if (experience <= 0)
{
throw new UserFriendlyException(LevelConst.Level_Low_Zero);
}
await _levelManager.ChangeLevelByMoneyAsync(CurrentUser.Id!.Value, experience);
}
}
}

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