-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fcbc251
commit cd89bb1
Showing
5 changed files
with
115 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,40 @@ | ||
using GameFrameX.Entity; | ||
// GameFrameX 组织下的以及组织衍生的项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 | ||
// | ||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE 文件。 | ||
// | ||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! | ||
|
||
using GameFrameX.Entity; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace GameFrameX.Client.Api | ||
namespace GameFrameX.Client.Api; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
[Route("api/[controller]/[action]")] | ||
[ApiController] | ||
public class BaseController : Controller | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
public class BaseController<T> : BaseController where T : EntityBase, new() | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
[Route("api/[controller]/[action]")] | ||
[ApiController] | ||
public class BaseController : Controller | ||
{ | ||
|
||
} | ||
protected readonly BaseService<T> PBaseService; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
public class BaseController<T> : BaseController where T : EntityBase, new() | ||
/// <param name="service"></param> | ||
public BaseController(BaseService<T> service) | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
protected readonly BaseService<T> PBaseService; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="service"></param> | ||
public BaseController(BaseService<T> service) | ||
{ | ||
this.PBaseService = service; | ||
} | ||
this.PBaseService = service; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,49 @@ | ||
using System.Linq.Expressions; | ||
// GameFrameX 组织下的以及组织衍生的项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 | ||
// | ||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE 文件。 | ||
// | ||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! | ||
|
||
using System.Linq.Expressions; | ||
using GameFrameX.Client.Api.SqlSugar; | ||
using GameFrameX.Entity; | ||
|
||
namespace GameFrameX.Client.Api | ||
namespace GameFrameX.Client.Api; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public class BaseService | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
public class BaseService<T> : BaseService where T : EntityBase, new() | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
protected readonly Repository<T> Repository; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public class BaseService | ||
/// <param name="settings"></param> | ||
public BaseService(Repository<T> settings) | ||
{ | ||
this.Repository = settings; | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
public class BaseService<T> : BaseService where T : EntityBase, new() | ||
/// <param name="filter"></param> | ||
/// <returns></returns> | ||
public async Task<T> GetAsync(Expression<Func<T, bool>> filter) | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
protected readonly Repository<T> Repository; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="settings"></param> | ||
public BaseService(Repository<T> settings) | ||
{ | ||
this.Repository = settings; | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="filter"></param> | ||
/// <returns></returns> | ||
public async Task<T> GetAsync(Expression<Func<T, bool>> filter) | ||
{ | ||
return await Repository.AsQueryable().Where(m => m.IsDelete == false).FirstAsync(filter); | ||
} | ||
return await Repository.AsQueryable().Where(m => m.IsDelete == false).FirstAsync(filter); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,43 @@ | ||
namespace GameFrameX.Client.Api | ||
// GameFrameX 组织下的以及组织衍生的项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 | ||
// | ||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE 文件。 | ||
// | ||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! | ||
|
||
namespace GameFrameX.Client.Api; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public static class ConstValue | ||
{ | ||
/// <summary> | ||
/// | ||
/// 主渠道默认值 | ||
/// </summary> | ||
public static class ConstValue | ||
{ | ||
/// <summary> | ||
/// 主渠道默认值 | ||
/// </summary> | ||
public const string ChannelNameDefault = "default"; | ||
public const string ChannelNameDefault = "default"; | ||
|
||
/// <summary> | ||
/// 包名默认值 | ||
/// </summary> | ||
public const string PackageNameDefault = "default"; | ||
/// <summary> | ||
/// 包名默认值 | ||
/// </summary> | ||
public const string PackageNameDefault = "default"; | ||
|
||
/// <summary> | ||
/// 平台默认值 | ||
/// </summary> | ||
public const string PlatformDefault = "default"; | ||
/// <summary> | ||
/// 平台默认值 | ||
/// </summary> | ||
public const string PlatformDefault = "default"; | ||
|
||
/// <summary> | ||
/// 语言默认值 | ||
/// </summary> | ||
public const string LanguageDefault = "default"; | ||
/// <summary> | ||
/// 语言默认值 | ||
/// </summary> | ||
public const string LanguageDefault = "default"; | ||
|
||
/// <summary> | ||
/// 子渠道默认值 | ||
/// </summary> | ||
public const string SubChannelNameDefault = "default"; | ||
/// <summary> | ||
/// 子渠道默认值 | ||
/// </summary> | ||
public const string SubChannelNameDefault = "default"; | ||
|
||
/// <summary> | ||
/// 程序版本默认值 | ||
/// </summary> | ||
public const string AppVersionDefault = "default"; | ||
} | ||
/// <summary> | ||
/// 程序版本默认值 | ||
/// </summary> | ||
public const string AppVersionDefault = "default"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// GameFrameX 组织下的以及组织衍生的项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 | ||
// | ||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE 文件。 | ||
// | ||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! | ||
|
||
global using System.ComponentModel.DataAnnotations; | ||
global using SqlSugar; | ||
global using GameFrameX.Application.Client.Api.GameResourceVersion; | ||
global using GameFrameX.Client.Api.Result; | ||
global using GameFrameX.Entity.Client; | ||
global using GameFrameX.Foundation.Http.Normalization; | ||
global using Microsoft.AspNetCore.Mvc; | ||
global using Newtonsoft.Json; |