mirror of
				https://github.com/LamGC/ContentGrabbingJi.git
				synced 2025-11-04 02:26:57 +00:00 
			
		
		
		
	[Change] 调整搜索接口返回数据中Attribute的Enum存放位置;
[Change] PixivSearchLinkBuilder 调整SuppressWarnings注解; [Deprecated] PixivSearchLinkBuilder.SearchArea.jsonKey 将属性标记deprecated; [Add] PixivSearchAttribute 增加搜索结果属性枚举类, 用于代替`PixivSearchLinkBuilder.SearchArea.jsonKey`;
This commit is contained in:
		
							
								
								
									
										18
									
								
								src/main/java/net/lamgc/cgj/pixiv/PixivSearchAttribute.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								src/main/java/net/lamgc/cgj/pixiv/PixivSearchAttribute.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,18 @@
 | 
				
			|||||||
 | 
					package net.lamgc.cgj.pixiv;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public enum PixivSearchAttribute {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ARTWORKS("illustManga"),
 | 
				
			||||||
 | 
					    TOP("illustManga", "novel"),
 | 
				
			||||||
 | 
					    ILLUSTRATIONS("illust"),
 | 
				
			||||||
 | 
					    MANGA("manga"),
 | 
				
			||||||
 | 
					    NOVELS("novel")
 | 
				
			||||||
 | 
					    ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public final String[] attributeNames;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    PixivSearchAttribute(String... attributeNames) {
 | 
				
			||||||
 | 
					        this.attributeNames = attributeNames;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -15,7 +15,7 @@ import java.util.Objects;
 | 
				
			|||||||
 * @author LamGC
 | 
					 * @author LamGC
 | 
				
			||||||
 * @see PixivURL#PIXIV_SEARCH_CONTENT_URL
 | 
					 * @see PixivURL#PIXIV_SEARCH_CONTENT_URL
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
@SuppressWarnings("unused")
 | 
					@SuppressWarnings({"unused", "UnusedReturnValue"})
 | 
				
			||||||
public class PixivSearchLinkBuilder {
 | 
					public class PixivSearchLinkBuilder {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private final String content;
 | 
					    private final String content;
 | 
				
			||||||
@ -296,13 +296,18 @@ public class PixivSearchLinkBuilder {
 | 
				
			|||||||
         */
 | 
					         */
 | 
				
			||||||
        NOVELS("novel");
 | 
					        NOVELS("novel");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /**
 | 
				
			||||||
 | 
					         * 可用的Json属性名
 | 
				
			||||||
 | 
					         * @deprecated 该属性信息以移至 {@link PixivSearchAttribute}
 | 
				
			||||||
 | 
					         * @see PixivSearchAttribute
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        @Deprecated
 | 
				
			||||||
        public final String jsonKey;
 | 
					        public final String jsonKey;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        SearchArea(String jsonKey) {
 | 
					        SearchArea(String jsonKey) {
 | 
				
			||||||
            this.jsonKey = jsonKey;
 | 
					            this.jsonKey = jsonKey;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user