注释完善

This commit is contained in:
暮光:城中城
2021-11-24 23:28:49 +08:00
parent aae8a9994a
commit 4408525b45
144 changed files with 923 additions and 854 deletions

View File

@@ -2,11 +2,17 @@ package com.zyplayer.doc.core.annotation;
import java.lang.annotation.*;
@Target({ElementType.METHOD,ElementType.TYPE})
/**
* 用户登录校验注解
*
* @author 暮光:城中城
* @since 2019年5月29日
*/
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface AuthMan {
String[] value() default {};
String authUrl() default "common/authfailed";
boolean all() default false;
}

View File

@@ -1,5 +0,0 @@
package com.zyplayer.doc.core.bean.swagger;
public class Contact {
}

View File

@@ -1,42 +0,0 @@
package com.zyplayer.doc.core.bean.swagger;
public class Info {
private String description;
private String version;
private String title;
private Contact contact;
public void setDescription(String description) {
this.description = description;
}
public String getDescription() {
return description;
}
public void setVersion(String version) {
this.version = version;
}
public String getVersion() {
return version;
}
public void setTitle(String title) {
this.title = title;
}
public String getTitle() {
return title;
}
public void setContact(Contact contact) {
this.contact = contact;
}
public Contact getContact() {
return contact;
}
}

View File

@@ -1,5 +0,0 @@
package com.zyplayer.doc.core.bean.swagger;
public class Paths {
}

View File

@@ -1,62 +0,0 @@
package com.zyplayer.doc.core.bean.swagger;
import java.util.List;
public class SwaggerApiDocs {
private String swagger;
private Info info;
private String host;
private String basePath;
private List<String> tags;
private Paths paths;
public void setSwagger(String swagger) {
this.swagger = swagger;
}
public String getSwagger() {
return swagger;
}
public void setInfo(Info info) {
this.info = info;
}
public Info getInfo() {
return info;
}
public void setHost(String host) {
this.host = host;
}
public String getHost() {
return host;
}
public void setBasePath(String basePath) {
this.basePath = basePath;
}
public String getBasePath() {
return basePath;
}
public void setTags(List<String> tags) {
this.tags = tags;
}
public List<String> getTags() {
return tags;
}
public void setPaths(Paths paths) {
this.paths = paths;
}
public Paths getPaths() {
return paths;
}
}

View File

@@ -2,29 +2,32 @@ package com.zyplayer.doc.core.exception;
/**
* 前端提示异常
*
* @author 暮光:城中城
* @since 2018年12月8日
*/
public class ConfirmException extends RuntimeException {
private static final long serialVersionUID = -7084066605197111614L;
public ConfirmException() {
super();
}
public ConfirmException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
public ConfirmException(String message, Throwable cause) {
super(message, cause);
}
public ConfirmException(String message) {
super(message);
}
public ConfirmException(Throwable cause) {
super(cause);
}
}

View File

@@ -1,67 +1,18 @@
package com.zyplayer.doc.core.json;
/**
* http静态资源定义
*
* @author 暮光:城中城
* @since 2019年05月29日
*/
public class HttpConst {
/** 每页显示条数 **/
public static final int PAGE_NUMBER = 50;
/** 默认当前页 **/
public static final int CURRENT_PAGE = 1;
/** 图片验证码 **/
public static final String SESSION_VERIFY_CODE = "SESSION_VERIFY_CODE";
/** 邮箱验证码 **/
public static final String SESSION_EMAIL_CODE = "SESSION_EMAIL_CODE";
/** 请求失败的原因 **/
public static final String SESSION_FAIL_REASON = "SESSION_FAIL_REASON";
/** operator */
public static final String OPERATOR = "OPERATOR";
/** 分页-总条数 */
public static final String PAGE_TOTAL = "PAGE_TOTAL";
/** 分页-当前页数 */
public static final String PAGE_NOWPAGE = "PAGE_NOWPAGE";
/** 分页-总页数 */
public static final String PAGE_PAGECOUNT = "PAGE_PAGECOUNT";
/** 分页-每页多少条 */
public static final String PAGE_SIZE = "PAGE_SIZE";
/** 会话连接 */
/**
* 会话连接
*/
public static final String ACCESS_TOKEN = "accessToken";
/** 存在于ThreadLocal的http request */
public static final String HTTP_SERVLET_REQUEST = "HTTP_SERVLET_REQUEST";
/** 存在于ThreadLocal的HTTP_SESSION */
public static final String HTTP_SESSION = "HTTP_SESSION";
/** 存于operator中权限的缓存头 **/
public static final String AUTH_CACHE_HEAD = "AUTH_CACHE_HEAD_";
/** 存于operator中的用户信息 **/
public static final String CACHE_OPERATOR_USER_INFO = "USER_INFO";
/** 存于operator中的城市信息 **/
public static final String CACHE_OPERATOR_CITY_ID = "CITY_ID";
/** 存于operator中的token绑定的访问信息使得换一台电脑不能使用此token **/
public static final String CACHE_OPERATOR_ACCESS_TOKEN_VALIDATE = "ACCESS_TOKEN_VALIDATE";
/** 存于operator中的token信息 **/
public static final String CACHE_OPERATOR_ACCESS_TOKEN = "accessToken";
/** 存于operator中的微信sessionKey信息 **/
public static final String CACHE_OPERATOR_SESSION_KEY = "sessionKey";
// 新版本使用的错误码
/** 成功 **/
public static final int SUCCESS = 200;
/** 提示性状态 需要客户端配合展示 **/
public static final int CONFIRM_CODE = 300;
/** accessToken非法或过期需要重新登录 **/
/**
* accessToken非法或过期需要重新登录
**/
public static final int TOKEN_TIMEOUT = 400;
/** 业务接口缺少参数errMsg会返回错误信息 **/
public static final int MISSING_PARAMETER = 401;
/** API 未授权 **/
public static final int UNAUTHORIZED = 402;
/** 接口调用频率超限 **/
public static final int CALL_FREQUENCY_GAUGE = 403;
/** 微信未扫码登录异常 **/
public static final int WX_NOT_LOGIN = 404;
/** 请升级至新版使用此功能 **/
public static final int NEED_UPGRADE = 405;
/** 服务器端未知错误 **/
public static final int OTHER_FAIL = 500;
}

View File

@@ -1,46 +0,0 @@
package com.zyplayer.doc.core.util;
import java.io.PrintWriter;
import java.io.StringWriter;
/**
* 字符串操作类
*/
public final class StringUtil {
/**
* 获取错误信息
*
* @param e
* @return
* @author 暮光:城中城
*/
public static String getException(Throwable e) {
StringWriter sw = null;
PrintWriter pw = null;
try {
sw = new StringWriter();
pw = new PrintWriter(sw);
e.printStackTrace(pw);
pw.flush();
sw.flush();
return sw.toString();
} finally {
if (sw != null) {
try {
sw.close();
} catch (Exception e1) {
e1.printStackTrace();
}
}
if (pw != null) {
try {
pw.close();
} catch (Exception e1) {
e1.printStackTrace();
}
}
}
}
}

View File

@@ -1,20 +0,0 @@
package com.zyplayer.doc.core.util;
import javax.servlet.http.HttpServletRequest;
public class ThreadLocalUtil {
private static ThreadLocal<HttpServletRequest> request = new ThreadLocal<>();
public static void setHttpServletRequest(HttpServletRequest request) {
ThreadLocalUtil.request.set(request);
}
public static HttpServletRequest getHttpServletRequest() {
return ThreadLocalUtil.request.get();
}
public static void clean() {
ThreadLocalUtil.request.remove();
}
}

View File

@@ -2,6 +2,8 @@ package com.zyplayer.doc.core.util;
/**
* zyplayer-doc版本号
*
* @author 暮光:城中城
* @since 2021-06-06
*/
public class ZyplayerDocVersion {