mirror of https://github.com/abpframework/abp.git
38 changed files with 186 additions and 188 deletions
@ -0,0 +1,31 @@ |
|||||
|
using System; |
||||
|
using Volo.Abp; |
||||
|
|
||||
|
namespace Volo.CmsKit.Blogs |
||||
|
{ |
||||
|
public class BlogPostSlugAlreadyExistException : BusinessException |
||||
|
{ |
||||
|
internal BlogPostSlugAlreadyExistException(string code = null, string message = null, string details = null, Exception innerException = null, Microsoft.Extensions.Logging.LogLevel logLevel = Microsoft.Extensions.Logging.LogLevel.Warning) : base(code, message, details, innerException, logLevel) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
internal BlogPostSlugAlreadyExistException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext context) : base(serializationInfo, context) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
public BlogPostSlugAlreadyExistException(Guid blogId, string slug) |
||||
|
{ |
||||
|
Slug = slug; |
||||
|
BlogId = blogId; |
||||
|
|
||||
|
Code = CmsKitErrorCodes.Blogs.SlugAlreadyExist; |
||||
|
|
||||
|
WithData(nameof(Slug), Slug); |
||||
|
WithData(nameof(BlogId), BlogId); |
||||
|
} |
||||
|
|
||||
|
public string Slug { get; } |
||||
|
|
||||
|
public Guid BlogId { get; } |
||||
|
} |
||||
|
} |
||||
@ -1,31 +0,0 @@ |
|||||
using System; |
|
||||
using Volo.Abp; |
|
||||
|
|
||||
namespace Volo.CmsKit.Blogs |
|
||||
{ |
|
||||
public class BlogPostUrlSlugAlreadyExistException : BusinessException |
|
||||
{ |
|
||||
internal BlogPostUrlSlugAlreadyExistException(string code = null, string message = null, string details = null, Exception innerException = null, Microsoft.Extensions.Logging.LogLevel logLevel = Microsoft.Extensions.Logging.LogLevel.Warning) : base(code, message, details, innerException, logLevel) |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
internal BlogPostUrlSlugAlreadyExistException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext context) : base(serializationInfo, context) |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
public BlogPostUrlSlugAlreadyExistException(Guid blogId, string urlSlug) |
|
||||
{ |
|
||||
UrlSlug = urlSlug; |
|
||||
BlogId = blogId; |
|
||||
|
|
||||
Code = CmsKitErrorCodes.Blogs.UrlSlugAlreadyExist; |
|
||||
|
|
||||
WithData(nameof(UrlSlug), UrlSlug); |
|
||||
WithData(nameof(BlogId), BlogId); |
|
||||
} |
|
||||
|
|
||||
public string UrlSlug { get; } |
|
||||
|
|
||||
public Guid BlogId { get; } |
|
||||
} |
|
||||
} |
|
||||
@ -1,12 +1,10 @@ |
|||||
using Slugify; |
using Slugify; |
||||
using System.Text.RegularExpressions; |
|
||||
using Unidecode.NET; |
|
||||
|
|
||||
namespace Volo.CmsKit.Blogs.Extensions |
namespace Volo.CmsKit.Blogs.Extensions |
||||
{ |
{ |
||||
public static class UrlSlugExtensions |
public static class SlugExtensions |
||||
{ |
{ |
||||
public static string NormalizeAsUrlSlug(this string value) |
public static string NormalizeSlug(this string value) |
||||
{ |
{ |
||||
var slugHelper = new SlugHelper(); |
var slugHelper = new SlugHelper(); |
||||
|
|
||||
Loading…
Reference in new issue