This commit is contained in:
Putoo
2026-04-27 17:53:43 +08:00
parent c55a104573
commit a219fbec32
10 changed files with 168 additions and 4 deletions

View File

@@ -0,0 +1,3 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIRedisCache_002Ecs_002Fl_003AC_0021_003FUsers_003F29055_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F55e5569a0f314a0db6a665eafad446dd6800_003F9e_003F88bbb06d_003FIRedisCache_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ASqlSetup_002Ecs_002Fl_003AC_0021_003FUsers_003F29055_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F72993acb059c49dcbba437a858c0b0942000_003F46_003F2e14505d_003FSqlSetup_002Ecs/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>

View File

@@ -0,0 +1,39 @@
using SqlSugar;
using System;
namespace Application.Domain.Entity
{
[Tenant("Kg.SeaTime.Resource")]
public class game_area
{
/// <summary>
/// areaId
/// </summary>
[SugarColumn(IsPrimaryKey = true)]
public int areaId { get; set; }
/// <summary>
/// name
/// </summary>
[SugarColumn(Length = 255, IsNullable = true)]
public string? name { get; set; }
/// <summary>
/// 状态
/// </summary>
[SugarColumn(IsNullable = true)]
public int? status { get; set; }
/// <summary>
/// 开放时间
/// </summary>
[SugarColumn(IsNullable = true)]
public DateTime? opTime { get; set; }
/// <summary>
/// 添加时间
/// </summary>
[SugarColumn(IsNullable = true)]
public DateTime? addTime { get; set; }
}
}

View File

@@ -0,0 +1,39 @@
using SqlSugar;
using System;
namespace Application.Domain.Entity
{
[Tenant("Kg.SeaTime.Resource")]
public class game_notice
{
/// <summary>
/// noticeId
/// </summary>
[SugarColumn(IsPrimaryKey = true, Length = 50)]
public string noticeId { get; set; }
/// <summary>
/// title
/// </summary>
[SugarColumn(Length = 50, IsNullable = true)]
public string? title { get; set; }
/// <summary>
/// sign
/// </summary>
[SugarColumn(IsNullable = true)]
public string? sign { get; set; }
/// <summary>
/// addTime
/// </summary>
[SugarColumn(IsNullable = true)]
public DateTime? addTime { get; set; }
/// <summary>
/// endTime
/// </summary>
[SugarColumn(IsNullable = true)]
public DateTime? endTime { get; set; }
}
}

View File

@@ -0,0 +1,7 @@
namespace Application.Domain;
public interface INoticeService
{
Task<List<game_notice>> GetNoticeDataByTake(int take);
Task<List<game_notice>> GetNoticeData(int page, int limit, RefAsync<int> total);
}

View File

@@ -0,0 +1,25 @@
namespace Application.Domain;
public class NoticeService:INoticeService,ITransient
{
private readonly ISqlSugarClient _dbClient;
private readonly IRedisCache _redisClient;
public NoticeService(ISqlSugarClient dbClient, IRedisCache redisClient)
{
_dbClient = dbClient;
_redisClient = redisClient;
}
public async Task<List<game_notice>> GetNoticeDataByTake(int take)
{
var db = _dbClient.AsTenant().GetConnectionWithAttr<game_notice>();
return await db.Queryable<game_notice>().Take(take).OrderByDescending(it=>it.addTime).ToListAsync();
}
public async Task<List<game_notice>> GetNoticeData(int page, int limit, RefAsync<int> total)
{
var db = _dbClient.AsTenant().GetConnectionWithAttr<game_notice>();
return await db.Queryable<game_notice>().ToPageListAsync(page, limit, total);
}
}

View File

@@ -25,6 +25,7 @@ namespace Application.Web.Controllers.Login
[HttpPost]
public async Task<IPoAction> Login([FromBody] LoginParms parms)
{
HttpContext.Request.QueryString
return PoAction.Ok(parms.code);
}
/// <summary>

View File

@@ -0,0 +1,31 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace Application.Web.Controllers.Pub
{
/// <summary>
/// 公共接口
/// </summary>
[Route("[controller]/[action]")]
[ApiController]
public class PubController : ControllerBase
{
private readonly IAreaService _areaService;
public PubController(IAreaService areaService)
{
_areaService = areaService;
}
/// <summary>
/// 获取首页信息
/// </summary>
/// <returns></returns>
[HttpGet]
public async Task<IPoAction> GetMain()
{
var areaData = await _areaService.GetAreaData();
return PoAction.Ok(new{area=areaData});
}
}
}

View File

@@ -2,4 +2,10 @@ export class PageExtend {
public static Redirect(route: string) {
navigateTo(route, { replace: true })
}
public static QueryString(params: string): string {
const route = useRoute()
const value = route.query[params]
return value ? String(value) : ''
}
}

View File

@@ -120,6 +120,10 @@ const Initialize = async (): Promise<void> => {
// await navigateTo('/auth/login', { replace: true })
onMounted(async () => {
const id = PageExtend.QueryString("id");
MessageExtend.Notify("success", id);
await Initialize();
//alert(1);

View File

@@ -0,0 +1,9 @@
export class PubService {
/**
* 获取首页信息
* GET /Pub/GetMain
*/
static async GetMain() {
return await ApiService.Request("get", "/Pub/GetMain");
}
}