Skip to content

Commit

Permalink
update namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
luoyunchong committed May 19, 2024
1 parent e27a27a commit 835e6c5
Show file tree
Hide file tree
Showing 20 changed files with 25 additions and 44 deletions.
1 change: 1 addition & 0 deletions src/LinCms.Application/Blog/Channels/ChannelService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using IGeekFan.FreeKit.Extras;
using IGeekFan.FreeKit.Extras.Dto;
using IGeekFan.FreeKit.Extras.FreeSql;
using LinCms.Aop.Attributes;
using LinCms.Data;
using LinCms.Entities.Blog;
using LinCms.Exceptions;
Expand Down
2 changes: 1 addition & 1 deletion src/LinCms.Core/Aop/Attributes/CacheableAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace IGeekFan.FreeKit.Extras;
namespace LinCms.Aop.Attributes;

[AttributeUsage(AttributeTargets.Method)]
public class CacheableAttribute : Attribute
Expand Down
2 changes: 1 addition & 1 deletion src/LinCms.Core/Aop/Attributes/DisableAuditingAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace IGeekFan.FreeKit.Extras.FreeSql
namespace LinCms.Aop.Attributes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property)]
public class DisableAuditingAttribute : Attribute
Expand Down
2 changes: 1 addition & 1 deletion src/LinCms.Core/Aop/Attributes/IgnoreMemberAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace IGeekFan.FreeKit.Extras.FreeSql
namespace LinCms.Aop.Attributes
{
// source: https://github.com/jhewlett/ValueObject
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
Expand Down
11 changes: 3 additions & 8 deletions src/LinCms.Core/Aop/Attributes/LoggerAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
using System;

namespace IGeekFan.FreeKit.Extras.FreeSql
namespace LinCms.Aop.Attributes
{
[AttributeUsage(AttributeTargets.Method)]
public class LoggerAttribute : Attribute
public class LoggerAttribute(string template) : Attribute
{
public string Template { get; }

public LoggerAttribute(string template)
{
Template = template ?? throw new ArgumentNullException(nameof(template));
}
public string Template { get; } = template ?? throw new ArgumentNullException(nameof(template));
}
}
1 change: 1 addition & 0 deletions src/LinCms.Core/Aop/Filter/LogActionFilterAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Text.RegularExpressions;
using IGeekFan.FreeKit.Extras.FreeSql;
using IGeekFan.FreeKit.Extras.Security;
using LinCms.Aop.Attributes;
using LinCms.Entities;
using LinCms.Security;
using Microsoft.AspNetCore.Http;
Expand Down
18 changes: 4 additions & 14 deletions src/LinCms.Core/Domain/TokenManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,9 @@

namespace LinCms.Domain;

public class TokenManager : ITokenManager, ITransientDependency
public class TokenManager(IJwtService jsonWebTokenService, ILogger<TokenManager> logger, IUserRepository userRepository)
: ITokenManager, ITransientDependency
{
private readonly ILogger<TokenManager> _logger;
private readonly IUserRepository _userRepository;
private readonly IJwtService _jsonWebTokenService;

public TokenManager(IJwtService jsonWebTokenService, ILogger<TokenManager> logger, IUserRepository userRepository)
{
_jsonWebTokenService = jsonWebTokenService;
_logger = logger;
_userRepository = userRepository;
}

public async Task<UserAccessToken> CreateTokenAsync(LinUser user)
{
List<Claim> claims = new()
Expand All @@ -39,10 +29,10 @@ public async Task<UserAccessToken> CreateTokenAsync(LinUser user)
claims.Add(new Claim(LinCmsClaimTypes.GroupIds, r.Id.ToString()));
});

string token = _jsonWebTokenService.Encode(claims);
string token = jsonWebTokenService.Encode(claims);

user.AddRefreshToken();
await _userRepository.UpdateAsync(user);
await userRepository.UpdateAsync(user);

return new UserAccessToken(token, user.RefreshToken, 24 * 60 * 60, "Bearer", 24 * 60 * 60 * 30);
}
Expand Down
1 change: 0 additions & 1 deletion src/LinCms.Web/Controllers/Blog/ArticleController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
using System.Linq;
using System.Threading.Tasks;
using FreeRedis;
using IGeekFan.FreeKit.Extras;
using IGeekFan.FreeKit.Extras.Dto;


Expand Down
3 changes: 1 addition & 2 deletions src/LinCms.Web/Controllers/Blog/TagController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using IGeekFan.FreeKit.Extras;
using LinCms.Aop.Filter;
using LinCms.Aop.Filter;
using LinCms.Blog.Tags;
using LinCms.Data;
using LinCms.Entities.Blog;
Expand Down
2 changes: 1 addition & 1 deletion src/LinCms.Web/Controllers/Cms/AccountController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using AutoMapper;
using IGeekFan.FreeKit.Extras.FreeSql;
using IGeekFan.FreeKit.Extras.Security;
using JetBrains.Annotations;
using LinCms.Cms.Account;
using LinCms.Cms.Users;
using LinCms.Data;
Expand All @@ -18,6 +17,7 @@
using Microsoft.Extensions.Options;
using System.Collections.Generic;
using System.Threading.Tasks;
using LinCms.Aop.Attributes;

namespace LinCms.Controllers.Cms;

Expand Down
2 changes: 1 addition & 1 deletion src/LinCms.Web/Controllers/Cms/AdminController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Threading.Tasks;
using IGeekFan.FreeKit.Extras.Dto;
using IGeekFan.FreeKit.Extras.FreeSql;
using LinCms.Aop.Attributes;
using LinCms.Aop.Filter;
using LinCms.Cms.Admins;
using LinCms.Cms.Users;
Expand Down
2 changes: 1 addition & 1 deletion src/LinCms.Web/Controllers/Cms/LogController.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using IGeekFan.FreeKit.Extras.Dto;
using IGeekFan.FreeKit.Extras.FreeSql;
using LinCms.Aop.Attributes;
using LinCms.Aop.Filter;
using LinCms.Cms.Logs;
using LinCms.Data;
Expand Down
3 changes: 1 addition & 2 deletions src/LinCms.Web/Controllers/Cms/UserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
using System.Linq;
using System.Threading.Tasks;
using AutoMapper;
using IGeekFan.FreeKit.Extras;
using IGeekFan.FreeKit.Extras.FreeSql;
using IGeekFan.FreeKit.Extras.Security;
using LinCms.Aop.Attributes;
using LinCms.Cms.Groups;
using LinCms.Cms.Users;
using LinCms.Data;
Expand Down
3 changes: 1 addition & 2 deletions src/LinCms.Web/Controllers/v1/BookController.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using IGeekFan.FreeKit.Extras.Dto;
using IGeekFan.FreeKit.Extras.FreeSql;
using LinCms.Aop.Attributes;
using LinCms.Aop.Filter;
using LinCms.Data;
using LinCms.FreeSql;
using LinCms.v1.Books;
using Microsoft.AspNetCore.Mvc;

Expand Down
2 changes: 1 addition & 1 deletion src/LinCms.Web/Controllers/v1/TestController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using DotNetCore.CAP;
using FreeSql;
using IGeekFan.FreeKit.Extras.FreeSql;
using LinCms.Aop.Attributes;
using LinCms.Aop.Filter;
using LinCms.Data;
using LinCms.Data.Enums;
Expand Down
2 changes: 1 addition & 1 deletion src/LinCms.Web/Middleware/AopCacheAsyncIntercept.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Castle.DynamicProxy;
using IGeekFan.FreeKit.Extras;
using LinCms.Common;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
Expand All @@ -9,6 +8,7 @@
using System.Reflection;
using System.Threading.Tasks;
using FreeRedis;
using LinCms.Aop.Attributes;

namespace LinCms.Middleware;

Expand Down
4 changes: 2 additions & 2 deletions src/LinCms.Web/Middleware/AopCacheableActionFilter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using IGeekFan.FreeKit.Extras;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Configuration;
Expand All @@ -8,6 +7,7 @@
using System.Reflection;
using System.Threading.Tasks;
using FreeRedis;
using LinCms.Aop.Attributes;
using LinCms.Common;
using Newtonsoft.Json.Serialization;

Expand Down
4 changes: 2 additions & 2 deletions src/LinCms.Web/Middleware/CacheableMethodInfoExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using IGeekFan.FreeKit.Extras;
using System.Linq;
using System.Linq;
using System.Reflection;
using LinCms.Aop.Attributes;

namespace LinCms.Middleware;

Expand Down
3 changes: 1 addition & 2 deletions src/LinCms.Web/Middleware/RecaptchaVerifyActionFilter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Net.NetworkInformation;
using System.Net.NetworkInformation;
using System.Threading.Tasks;
using LinCms.Exceptions;
using LinCms.Models.Options;
Expand Down
1 change: 0 additions & 1 deletion src/LinCms.Web/Startup/Configuration/AutofacModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using LinCms.Data;
using LinCms.Data.Authorization;
using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.Configuration;

namespace LinCms.Startup.Configuration;

Expand Down

0 comments on commit 835e6c5

Please sign in to comment.