-
Notifications
You must be signed in to change notification settings - Fork 29
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
42160ec
commit 2f7fcbc
Showing
12 changed files
with
941 additions
and
887 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
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,29 +1,29 @@ | ||
package com.lckp.jproxy; | ||
|
||
import org.mybatis.spring.annotation.MapperScan; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.web.servlet.ServletComponentScan; | ||
import org.springframework.cache.annotation.EnableCaching; | ||
import org.springframework.context.annotation.EnableAspectJAutoProxy; | ||
|
||
/** | ||
* | ||
* <p> | ||
* 主类 | ||
* </p> | ||
* | ||
* @author LuckyPuppy514 | ||
* @date 2023-03-04 | ||
*/ | ||
@SpringBootApplication | ||
@MapperScan("com.lckp.jproxy.mapper") | ||
@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true) | ||
@ServletComponentScan | ||
@EnableCaching | ||
public class Application { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(Application.class, args); | ||
} | ||
} | ||
package com.lckp.jproxy; | ||
|
||
import org.mybatis.spring.annotation.MapperScan; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.web.servlet.ServletComponentScan; | ||
import org.springframework.cache.annotation.EnableCaching; | ||
import org.springframework.context.annotation.EnableAspectJAutoProxy; | ||
|
||
/** | ||
* | ||
* <p> | ||
* 主类 | ||
* </p> | ||
* | ||
* @author LuckyPuppy514 | ||
* @date 2023-03-04 | ||
*/ | ||
@SpringBootApplication | ||
@MapperScan("com.lckp.jproxy.mapper") | ||
@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true) | ||
@ServletComponentScan | ||
@EnableCaching | ||
public class Application { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(Application.class, args); | ||
} | ||
} |
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,30 @@ | ||
package com.lckp.jproxy.model; | ||
|
||
import java.io.Serializable; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
/** | ||
* <p> | ||
* 格式化结果 | ||
* </p> | ||
* | ||
* @author LuckyPuppy514 | ||
* @date 2023-04-07 | ||
*/ | ||
@Getter | ||
@Setter | ||
public class FormatResult implements Serializable { | ||
private static final long serialVersionUID = 1L; | ||
|
||
/* | ||
* 格式化结果 | ||
*/ | ||
private String formatText; | ||
|
||
/* | ||
* 剩余信息 | ||
*/ | ||
private String restText; | ||
} |
197 changes: 99 additions & 98 deletions
197
src/main/java/com/lckp/jproxy/service/ISonarrTitleService.java
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,98 +1,99 @@ | ||
package com.lckp.jproxy.service; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import com.baomidou.mybatisplus.core.metadata.IPage; | ||
import com.baomidou.mybatisplus.extension.service.IService; | ||
import com.lckp.jproxy.entity.SonarrRule; | ||
import com.lckp.jproxy.entity.SonarrTitle; | ||
import com.lckp.jproxy.model.request.SonarrTitleQueryRequest; | ||
|
||
/** | ||
* <p> | ||
* SonarrTitle 服务类 | ||
* </p> | ||
* | ||
* @author LuckyPuppy514 | ||
* @since 2023-03-19 | ||
*/ | ||
public interface ISonarrTitleService extends IService<SonarrTitle> { | ||
/** | ||
* | ||
* 同步 | ||
* | ||
* boolean | ||
*/ | ||
public boolean sync(); | ||
|
||
/** | ||
* | ||
* 查询需要同步 TMDB 标题的 tvdbId | ||
* | ||
* @return List<Integer> | ||
*/ | ||
public List<Integer> queryNeedSyncTmdbTitle(); | ||
|
||
/** | ||
* | ||
* 根据标题查询 | ||
* | ||
* @param title | ||
* @return SonarrTitle | ||
*/ | ||
public SonarrTitle queryByTitle(String title); | ||
|
||
/** | ||
* | ||
* 查询所有标题 | ||
* | ||
* @return List<SonarrTitle> | ||
*/ | ||
public List<SonarrTitle> queryAll(); | ||
|
||
/** | ||
* | ||
* 格式化标题 | ||
* | ||
* @param text | ||
* @param format | ||
* @param cleanTitleRegex | ||
* @param sonarrRuleList | ||
* @param sonarrTitleList | ||
* @return String | ||
*/ | ||
public String formatTitle(String text, String format, String cleanTitleRegex, | ||
List<SonarrRule> sonarrRuleList, List<SonarrTitle> sonarrTitleList); | ||
|
||
/** | ||
* | ||
* 格式化 | ||
* | ||
* @param text | ||
* @param format | ||
* @param tokenRuleMap | ||
* @return String | ||
*/ | ||
public String format(String text, String format, Map<String, List<SonarrRule>> tokenRuleMap); | ||
|
||
/** | ||
* | ||
* 格式化并缓存 | ||
* | ||
* @param text | ||
* @param format | ||
* @param tokenRuleMap | ||
* @return String | ||
*/ | ||
public String formatWithCache(String text, String format, Map<String, List<SonarrRule>> tokenRuleMap); | ||
|
||
/** | ||
* | ||
* 分页查询 | ||
* | ||
* @param request | ||
* @return IPage<SonarrTitle> | ||
*/ | ||
public IPage<SonarrTitle> query(SonarrTitleQueryRequest request); | ||
} | ||
package com.lckp.jproxy.service; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import com.baomidou.mybatisplus.core.metadata.IPage; | ||
import com.baomidou.mybatisplus.extension.service.IService; | ||
import com.lckp.jproxy.entity.SonarrRule; | ||
import com.lckp.jproxy.entity.SonarrTitle; | ||
import com.lckp.jproxy.model.FormatResult; | ||
import com.lckp.jproxy.model.request.SonarrTitleQueryRequest; | ||
|
||
/** | ||
* <p> | ||
* SonarrTitle 服务类 | ||
* </p> | ||
* | ||
* @author LuckyPuppy514 | ||
* @since 2023-03-19 | ||
*/ | ||
public interface ISonarrTitleService extends IService<SonarrTitle> { | ||
/** | ||
* | ||
* 同步 | ||
* | ||
* boolean | ||
*/ | ||
public boolean sync(); | ||
|
||
/** | ||
* | ||
* 查询需要同步 TMDB 标题的 tvdbId | ||
* | ||
* @return List<Integer> | ||
*/ | ||
public List<Integer> queryNeedSyncTmdbTitle(); | ||
|
||
/** | ||
* | ||
* 根据标题查询 | ||
* | ||
* @param title | ||
* @return SonarrTitle | ||
*/ | ||
public SonarrTitle queryByTitle(String title); | ||
|
||
/** | ||
* | ||
* 查询所有标题 | ||
* | ||
* @return List<SonarrTitle> | ||
*/ | ||
public List<SonarrTitle> queryAll(); | ||
|
||
/** | ||
* | ||
* 格式化标题 | ||
* | ||
* @param text | ||
* @param format | ||
* @param cleanTitleRegex | ||
* @param sonarrRuleList | ||
* @param sonarrTitleList | ||
* @return FormatResult | ||
*/ | ||
public FormatResult formatTitle(String text, String format, String cleanTitleRegex, | ||
List<SonarrRule> sonarrRuleList, List<SonarrTitle> sonarrTitleList); | ||
|
||
/** | ||
* | ||
* 格式化 | ||
* | ||
* @param text | ||
* @param format | ||
* @param tokenRuleMap | ||
* @return String | ||
*/ | ||
public String format(String text, String format, Map<String, List<SonarrRule>> tokenRuleMap); | ||
|
||
/** | ||
* | ||
* 格式化并缓存 | ||
* | ||
* @param text | ||
* @param format | ||
* @param tokenRuleMap | ||
* @return String | ||
*/ | ||
public String formatWithCache(String text, String format, Map<String, List<SonarrRule>> tokenRuleMap); | ||
|
||
/** | ||
* | ||
* 分页查询 | ||
* | ||
* @param request | ||
* @return IPage<SonarrTitle> | ||
*/ | ||
public IPage<SonarrTitle> query(SonarrTitleQueryRequest request); | ||
} |
Oops, something went wrong.