Compare commits

...

42 Commits

Author SHA1 Message Date
pp9e2k3rf 0b687c1c62 Merge pull request 'gtq' (#4) from branch_GTQ into main
1 year ago
gtq a1781695e5 Merge remote-tracking branch 'origin/branch_GTQ' into branch_GTQ
1 year ago
gtq 7730f9a0c0 test
1 year ago
p436ejfyi ecb6e51cf4 Merge pull request '金汉' (#3) from branch_JH into main
1 year ago
p9luapgbk 161aed789a com.hyc.wechat
1 year ago
zsy fb51c0a857 test
1 year ago
zsy 999963117a Merge remote-tracking branch 'origin/main'
1 year ago
zsy b32da7e4f7 test
1 year ago
lq 18ae764bff Merge branch 'main' of https://bdgit.educoder.net/p9luapgbk/chat-room
1 year ago
lq 655428be09 Merge branch 'main' of https://bdgit.educoder.net/p9luapgbk/chat-room
1 year ago
lq d817fbf281 Merge branch 'main' of https://bdgit.educoder.net/p9luapgbk/chat-room
1 year ago
zsy 0d3816ce1e my code
1 year ago
jinhan 4ac36ecb64 注释
1 year ago
jinhan e3cec831cd 注释
1 year ago
jinhan 7db0bcbf0f 注释
1 year ago
gtq 81323a7498 test
1 year ago
jinhan 88dd7e628f 注释
1 year ago
jinhan 951b18b8f6 注释
1 year ago
gtq a48b8934c4 test
1 year ago
gtq 59e00369fd test
1 year ago
jinhan ff2a83cf81 注释
1 year ago
jinhan 4e56f3dba8 注释
1 year ago
gtq 004067a4fb test
1 year ago
jinhan 9af348c80b 注释
1 year ago
jinhan 45ba692694 注释
1 year ago
jinhan 1db9b0c55a 注释
1 year ago
jinhan c76b1f6657 注释
1 year ago
jinhan fad7e91359 注释
1 year ago
gtq f7c3e33dba test
1 year ago
jinhan 2b8f848081 注释
1 year ago
gtq c526f9a191 test
1 year ago
jinhan 433b4031de 注释
1 year ago
jinhan dfe6319516 注释
1 year ago
jinhan 670143ca45 注释
1 year ago
gtq fd8df8c2bc test
1 year ago
gtq e17a8e60ed test
1 year ago
jinhan 716f80ebff zhu
1 year ago
jinhan c80127fb0c zhu
1 year ago
Gtq bd6d225315 test
1 year ago
Gtq a61bf692dc test
1 year ago
Gtq 4edb5b806c test
1 year ago
zsy 689e871db1 test
1 year ago

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

@ -1,5 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4"> <module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="web" name="Web">
<configuration>
<descriptors>
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/wechat-master/web/WEB-INF/web.xml" />
</descriptors>
<webroots>
<root url="file://$MODULE_DIR$/wechat-master/web" relative="/" />
</webroots>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true"> <component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output /> <exclude-output />
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">

@ -1,31 +1,16 @@
/* // test
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.controller.annotation;
import java.lang.annotation.*; package com.hyc.wechat.controller.annotation; // 定义注解所在的包名
/** import java.lang.annotation.*; // 导入Java标准注解库
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @description ActionProviderurl // 定义一个名为ControllerConfig的注解
* @date 2019-05-02 11:28 @Retention(value = RetentionPolicy.RUNTIME) // 指定注解的生命周期RUNTIME表示注解将被保留到运行时可以通过反射读取
*/ @Target(value = ElementType.TYPE) // 指定注解可以应用的目标类型TYPE表示注解可以用于类、接口或枚举声明
@Documented public @interface ControllerConfig { // 使用@interface关键字定义注解
@Retention(value = RetentionPolicy.RUNTIME)
@Target(value = ElementType.TYPE) // 定义一个名为path的属性方法默认值为空字符串
public @interface ControllerConfig { // 该属性用于配置控制器类的路径
String path() default ""; String path() default "";
} }

@ -1,31 +1,11 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.controller.constant; package com.hyc.wechat.controller.constant;
// 定义一个名为ControllerMessage的枚举类用于存储控制器相关的消息常量
/**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @description
* @date 2019-05-03 13:11
*/
public enum ControllerMessage { public enum ControllerMessage {
/** /**
* *
*/ */
//枚举常量,表示用户当前处于游客身份
YOU_ARE_VISITOR("您现在处于游客身份,该服务并未对游客开放,如需使用请先注册一个账号"), YOU_ARE_VISITOR("您现在处于游客身份,该服务并未对游客开放,如需使用请先注册一个账号"),
/* /*
@ -36,21 +16,24 @@ public enum ControllerMessage {
/** /**
* *
*/ */
// 枚举常量,用于分隔不同类型的消息常量,系统错误码部分
SYSTEM_EXECEPTION("服务器发生了严重异常,无法提供服务"), SYSTEM_EXECEPTION("服务器发生了严重异常,无法提供服务"),
/** /**
* *
*/ */
//// 枚举常量,表示请求参数错误
REQUEST_INVALID("您的请求参数不足或错误,系统无法处理您的请求"); REQUEST_INVALID("您的请求参数不足或错误,系统无法处理您的请求");
// 枚举成员变量,用于存储消息文本
public String message; public String message;
// 枚举的构造方法,用于在创建枚举实例时初始化成员变量
ControllerMessage(String message) { ControllerMessage(String message) {
this.message = message; this.message = message;
} }
// 公共方法,用于获取枚举实例中存储的消息文本
public String getMessage() { public String getMessage() {
return message; return message;
} }
// 私有方法,用于设置枚举实例中的消息文本
private void setMessage(String message) { private void setMessage(String message) {
this.message = message; this.message = message;
} }

@ -1,30 +1,5 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.controller.constant; package com.hyc.wechat.controller.constant;
/**
* requestmethod
*
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program XHotel
* @description
* @date 2019-04-18 12:45
*/
public enum RequestMethod { public enum RequestMethod {
/** /**

@ -1,32 +1,8 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.controller.constant; package com.hyc.wechat.controller.constant;
// 定义一个名为WebPage的枚举类用于表示不同的网页路径
/**
*
*
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program XHotel
* @description
* @date 2019-04-18 12:48
*/
public enum WebPage { public enum WebPage {
/** /**
* *
*/ */
@ -69,6 +45,8 @@ public enum WebPage {
PICTRUES_JSP; PICTRUES_JSP;
@Override @Override
// 重写toString方法以提供枚举常量的字符串表示形式
// 将枚举名称转换为小写,并用点号替换下划线,以符合网页文件的命名习惯
public String toString() { public String toString() {
return "/"+super.toString().toLowerCase().replaceAll("_", "."); return "/"+super.toString().toLowerCase().replaceAll("_", ".");
} }

@ -1,87 +1,73 @@
/* package com.hyc.wechat.controller.impl.filter; // 定义过滤器所在的包名
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.controller.impl.filter; import com.hyc.wechat.controller.constant.ControllerMessage; // 导入控制器消息常量类
import com.hyc.wechat.controller.constant.WebPage; // 导入网页常量类
import org.apache.log4j.Logger; // 导入log4j日志记录器
import com.hyc.wechat.controller.constant.ControllerMessage; import javax.servlet.*; // 导入Servlet API
import com.hyc.wechat.controller.constant.WebPage; import javax.servlet.annotation.WebFilter; // 导入WebFilter注解
import org.apache.log4j.Logger; import javax.servlet.annotation.WebInitParam; // 导入WebInitParam注解
import javax.servlet.http.HttpServletRequest; // 导入HttpServletRequest类
import javax.servlet.*; import javax.servlet.http.HttpServletResponse; // 导入HttpServletResponse类
import javax.servlet.annotation.WebFilter; import java.io.IOException; // 导入IOException类
import javax.servlet.annotation.WebInitParam;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat
* @description
* @date 2019-05-02 22:56
*/
// 使用@WebFilter注解定义一个名为"EncodingFilter"的过滤器
// 过滤器将作用于所有的URL模式"/*"
// 并且具有一个初始化参数"ENCODING",其值为"UTF-8"
@WebFilter( @WebFilter(
filterName = "EncodingFilter", filterName = "EncodingFilter",
urlPatterns = {"/*"}, servletNames = {"/*"}, urlPatterns = {"/*"},
initParams = { initParams = {
@WebInitParam(name = "ENCODING", value = "UTF-8") @WebInitParam(name = "ENCODING", value = "UTF-8")
} }
) )
public class EncodingFilter implements Filter { public class EncodingFilter implements Filter { // 实现Filter接口
private String ENCODING = null; private String ENCODING = null; // 用于存储字符编码的成员变量
@Override @Override
public void init(FilterConfig config) { public void init(FilterConfig config) { // 过滤器初始化方法
// 从FilterConfig获取初始化参数"ENCODING"
this.ENCODING = config.getInitParameter("ENCODING"); this.ENCODING = config.getInitParameter("ENCODING");
} }
@Override @Override
public void destroy() { public void destroy() { // 过滤器销毁方法
// 在此可以释放资源,但本例中无需实现
} }
@Override @Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) { public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) {
// 类型转换以便使用HttpServletRequest和HttpServletResponse的方法
HttpServletRequest req = (HttpServletRequest) servletRequest; HttpServletRequest req = (HttpServletRequest) servletRequest;
HttpServletResponse resp = (HttpServletResponse) servletResponse; HttpServletResponse resp = (HttpServletResponse) servletResponse;
try { try {
// 设置请求和响应的字符编码
req.setCharacterEncoding(ENCODING); req.setCharacterEncoding(ENCODING);
resp.setContentType("text/html;charset=utf-8"); resp.setContentType("text/html;charset=utf-8");
resp.setCharacterEncoding(ENCODING); resp.setCharacterEncoding(ENCODING);
// 设置CORS相关响应头允许跨域请求
resp.addHeader("Access-Control-Allow-Origin", "*"); resp.addHeader("Access-Control-Allow-Origin", "*");
resp.addHeader("Access-Control-Allow-Headers", resp.addHeader("Access-Control-Allow-Headers",
"origin, content-type, accept, x-requested-with, sid, mycustom, smuser"); "origin, content-type, accept, x-requested-with, sid, mycustom, smuser");
resp.addHeader("Access-Control-Allow-Methods", "*"); resp.addHeader("Access-Control-Allow-Methods", "*");
resp.addHeader("Access-Control-Max-Age", "100"); resp.addHeader("Access-Control-Max-Age", "100");
resp.addHeader("Access-Control-Allow-Credentials", "false"); resp.addHeader("Access-Control-Allow-Credentials", "false");
// 继续执行过滤链中的下一个过滤器或Servlet
filterChain.doFilter(servletRequest, servletResponse); filterChain.doFilter(servletRequest, servletResponse);
} catch (IOException | ServletException e) { } catch (IOException | ServletException e) {
e.printStackTrace(); e.printStackTrace(); // 打印异常堆栈信息
try { try {
// 设置请求属性,传递系统异常信息
req.setAttribute("message", ControllerMessage.SYSTEM_EXECEPTION.message); req.setAttribute("message", ControllerMessage.SYSTEM_EXECEPTION.message);
// 转发请求到错误页面
req.getRequestDispatcher(WebPage.ERROR_JSP.toString()).forward(req, resp); req.getRequestDispatcher(WebPage.ERROR_JSP.toString()).forward(req, resp);
} catch (ServletException | IOException ex) { } catch (ServletException | IOException ex) {
ex.printStackTrace(); ex.printStackTrace(); // 打印转发过程中可能出现的异常堆栈信息
} }
} }
// 获取日志记录器并记录请求信息
Logger logger = Logger.getLogger(EncodingFilter.class); Logger logger = Logger.getLogger(EncodingFilter.class);
logger.info("[请求url] : " + req.getRequestURI() + " [请求参数] " + req.getQueryString()); logger.info("[请求url] : " + req.getRequestURI() + " [请求参数] " + req.getQueryString());
} }
} }

@ -1,100 +1,80 @@
/* // 导入必要的库
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.controller.impl.filter; package com.hyc.wechat.controller.impl.filter;
import com.hyc.wechat.controller.constant.ControllerMessage; import com.hyc.wechat.controller.constant.ControllerMessage; // 导入控制器消息常量类
import com.hyc.wechat.controller.constant.RequestMethod; import com.hyc.wechat.controller.constant.RequestMethod; // 导入请求方法常量类
import com.hyc.wechat.controller.constant.WebPage; import com.hyc.wechat.controller.constant.WebPage; // 导入网页常量类
import com.hyc.wechat.model.dto.ServiceResult; import com.hyc.wechat.model.dto.ServiceResult; // 导入服务结果数据传输对象
import com.hyc.wechat.model.po.User; import com.hyc.wechat.model.po.User; // 导入用户持久化对象
import com.hyc.wechat.provider.UserProvider; import com.hyc.wechat.provider.UserProvider; // 导入用户提供者类
import com.hyc.wechat.service.constants.Status; import com.hyc.wechat.service.constants.Status; // 导入状态常量类
import com.hyc.wechat.service.impl.UserServiceImpl; import com.hyc.wechat.service.impl.UserServiceImpl; // 导入用户服务实现类
import javax.servlet.*; import javax.servlet.*; // 导入Servlet API
import javax.servlet.annotation.WebFilter; import javax.servlet.annotation.WebFilter; // 导入WebFilter注解
import javax.servlet.annotation.WebInitParam; import javax.servlet.annotation.WebInitParam; // 导入WebInitParam注解
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest; // 导入HttpServletRequest类
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse; // 导入HttpServletResponse类
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession; // 导入HttpSession类
import java.io.IOException; import java.io.IOException; // 导入IOException类
import static com.hyc.wechat.util.ControllerUtils.returnJsonObject; import static com.hyc.wechat.util.ControllerUtils.returnJsonObject; // 导入返回JSON对象的工具方法
/** // 使用@WebFilter注解定义一个名为"LoginFilter"的过滤器
* @author <a href="mailto:kobe524348@gmail.com"></a> // 过滤器将作用于所有的URL模式"/*"
* @program wechat
* @description
* @date 2019-05-09 15:41
*/
@WebFilter( @WebFilter(
filterName = "LoginFilter", filterName = "LoginFilter",
urlPatterns = {"/*"}, servletNames = {"/*"}, urlPatterns = {"/*"},
initParams = { initParams = {
@WebInitParam(name = "ENCODING", value = "UTF-8") @WebInitParam(name = "ENCODING", value = "UTF-8")
}) })
public class LoginFilter implements Filter { public class LoginFilter implements Filter { // 实现Filter接口
private final UserProvider userProvider = new UserProvider(); private final UserProvider userProvider = new UserProvider(); // 创建用户提供者实例
@Override @Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
HttpServletRequest req = (HttpServletRequest) servletRequest; HttpServletRequest req = (HttpServletRequest) servletRequest; // 类型转换
HttpServletResponse resp = (HttpServletResponse) servletResponse; HttpServletResponse resp = (HttpServletResponse) servletResponse; // 类型转换
String method = req.getParameter("method"); String method = req.getParameter("method"); // 获取请求方法参数
String uri = req.getRequestURI(); String uri = req.getRequestURI(); // 获取请求URI
String contextPath = req.getContextPath(); String contextPath = req.getContextPath(); // 获取上下文路径
String path = uri.substring(contextPath.length()); String path = uri.substring(contextPath.length()); // 获取请求路径
HttpSession sess = req.getSession(false); HttpSession sess = req.getSession(false); // 获取当前会话如果不存在则返回null
//尝试自动登陆 // 尝试自动登录
userProvider.autoLogin(req); userProvider.autoLogin(req);
sess=req.getSession(); sess = req.getSession(); // 获取或创建会话
//放行登陆注册
// 放行登录和注册相关请求
if (sess == null || sess.getAttribute("login") == null) { if (sess == null || sess.getAttribute("login") == null) {
if (WebPage.LOGIN_JSP.toString().equalsIgnoreCase(path) || if (WebPage.LOGIN_JSP.toString().equalsIgnoreCase(path) || // 登录页面
(WebPage.REGISTER_JSP.toString()).equalsIgnoreCase(path) || WebPage.REGISTER_JSP.toString().equalsIgnoreCase(path) || // 注册页面
(RequestMethod.LOGIN_DO.toString()).equalsIgnoreCase(method) || RequestMethod.LOGIN_DO.toString().equalsIgnoreCase(method) || // 登录操作
(RequestMethod.REGISTER_DO.toString()).equalsIgnoreCase(method) || RequestMethod.REGISTER_DO.toString().equalsIgnoreCase(method) || // 注册操作
path.endsWith("logo.png") || path.endsWith(".js") || path.endsWith("agreement.html")) { path.endsWith("logo.png") || path.endsWith(".js") || path.endsWith("agreement.html")) { // 资源文件
filterChain.doFilter(req, resp); filterChain.doFilter(req, resp); // 继续执行过滤链
return; return;
} else { } else {
//检查session是否有'login'属性,没有则重定向到登陆界面 // 检查会话是否有'login'属性,没有则重定向到登录界面
if (sess == null || sess.getAttribute("login") == null) { if (sess == null || sess.getAttribute("login") == null) {
req.getRequestDispatcher(WebPage.LOGIN_JSP.toString()).forward(req, resp); req.getRequestDispatcher(WebPage.LOGIN_JSP.toString()).forward(req, resp); // 转发到登录页面
return; return;
} }
} }
} else { } else {
//已登陆用户检查登陆身份 // 已登录用户检查登录身份
if (path.startsWith("/wechat/moment") || path.startsWith("/wechat/friend")) { if (path.startsWith("/wechat/moment") || path.startsWith("/wechat/friend")) {
//检查登陆身份 // 检查登录身份
User user = (User) sess.getAttribute("login"); User user = (User) sess.getAttribute("login"); // 获取登录用户信息
if (user != null && UserServiceImpl.VISITOR_EMAIL.equals(user.getEmail())) { if (user != null && UserServiceImpl.VISITOR_EMAIL.equals(user.getEmail())) {
// 游客不可使用 // 游客不可使用
returnJsonObject(resp, new ServiceResult(Status.ERROR, ControllerMessage.YOU_ARE_VISITOR.message, null)); returnJsonObject(resp, new ServiceResult(Status.ERROR, ControllerMessage.YOU_ARE_VISITOR.message, null)); // 返回错误信息
return; return;
} }
} }
} }
filterChain.doFilter(req, resp); filterChain.doFilter(req, resp); // 继续执行过滤链
} }
} }

@ -1,18 +1,3 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.controller.impl.listener; package com.hyc.wechat.controller.impl.listener;
@ -25,18 +10,20 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a> * ServletWebWeb
* @program wechat
* @description servlet
* @date 2019-05-01 0844
*/ */
@WebListener @WebListener
public class ServletContextListener implements javax.servlet.ServletContextListener { public class ServletContextListener implements javax.servlet.ServletContextListener {
/**
* 使ConcurrentHashMap线
*/
private static final ConcurrentHashMap<String, Provider> providerMap = new ConcurrentHashMap<>(); private static final ConcurrentHashMap<String, Provider> providerMap = new ConcurrentHashMap<>();
/**
* Servlet
* @param sce Servlet
*/
@Override @Override
public void contextInitialized(ServletContextEvent sce) { public void contextInitialized(ServletContextEvent sce) {

@ -1,90 +1,65 @@
/* // 导入必要的库
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.controller.impl.servlet; package com.hyc.wechat.controller.impl.servlet;
import com.hyc.wechat.controller.annotation.ControllerConfig; import com.hyc.wechat.controller.annotation.ControllerConfig; // 导入自定义的ControllerConfig注解
import com.hyc.wechat.controller.constant.ControllerMessage; import com.hyc.wechat.controller.constant.ControllerMessage; // 导入控制器消息常量类
import com.hyc.wechat.provider.Provider; import com.hyc.wechat.provider.Provider; // 导入Provider接口
import com.hyc.wechat.util.ControllerUtils; import com.hyc.wechat.util.ControllerUtils; // 导入控制器工具类
import org.apache.log4j.Logger; import org.apache.log4j.Logger; // 导入log4j日志记录器
import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.MultipartConfig; // 导入MultipartConfig注解
import javax.servlet.annotation.WebServlet; import javax.servlet.annotation.WebServlet; // 导入WebServlet注解
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet; // 导入HttpServlet类
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest; // 导入HttpServletRequest类
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse; // 导入HttpServletResponse类
import java.io.IOException; import java.io.IOException; // 导入IOException类
import java.util.Map; import java.util.Map; // 导入Map接口
import java.util.Set; import java.util.Set; // 导入Set接口
import static com.hyc.wechat.provider.Provider.toErrorPage; import static com.hyc.wechat.provider.Provider.toErrorPage; // 导入Provider类的静态方法toErrorPage
/** // 使用@MultipartConfig注解配置文件上传的临时存储位置
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat
* @description controller
* @date 2019-05-02 03:28
*/
@MultipartConfig(location = "/home/pan/tomcat/webapps/wechat/upload") @MultipartConfig(location = "/home/pan/tomcat/webapps/wechat/upload")
//@MultipartConfig(location = "C:\\Users\\Misterchaos\\Documents\\Java Develop Workplaces\\IDEA workspace\\wechat\\out\\artifacts\\wechat_war_exploded\\upload") //@MultipartConfig(location = "C:\\Users\\Misterchaos\\Documents\\Java Develop Workplaces\\IDEA workspace\\wechat\\out\\artifacts\\wechat_war_exploded\\upload")
@WebServlet("/wechat/*") @WebServlet("/wechat/*") // 使用@WebServlet注解映射@WebServlet到/wechat/*路径
public class MyServlet extends HttpServlet { public class MyServlet extends HttpServlet {
@Override @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
this.doPost(req, resp); this.doPost(req, resp); // 将GET请求转发到doPost方法处理
} }
/** /**
* urlProvider * urlProvider
* *
* @param req * @param req
* @param resp * @param resp
* @name doPost * @name doPost
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/2
*/ */
@Override @Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException { protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
Map<String, Provider>providerMap = (Map<String, Provider>) getServletContext().getAttribute("providerMap"); Map<String, Provider> providerMap = (Map<String, Provider>) getServletContext().getAttribute("providerMap"); // 从ServletContext获取Provider映射
String url = req.getRequestURI(); String url = req.getRequestURI(); // 获取请求的URI
Set<String> keys = providerMap.keySet(); Set<String> keys = providerMap.keySet(); // 获取Provider映射的键集合
Logger logger = Logger.getLogger(MyServlet.class); Logger logger = Logger.getLogger(MyServlet.class); // 获取日志记录器
logger.info("[请求url:]"+url+"[匹配provider]:"+url.substring(14)); logger.info("[请求url:] " + url + " [匹配provider]: " + url.substring(14)); // 记录请求的URL和尝试匹配的Provider
boolean isMatch=false; boolean isMatch = false; // 标记是否找到匹配的Provider
for (String key : keys) { for (String key : keys) { // 遍历Provider映射的键集合
// 解析注解中的path信息匹配ActionProvider // 解析注解中的path信息匹配ActionProvider
String path =providerMap.get(key).getPath(); String path = providerMap.get(key).getPath(); // 获取Provider的路径
if (url.substring(14).equalsIgnoreCase(path)) { if (url.substring(14).equalsIgnoreCase(path)) { // 检查请求的路径是否与Provider的路径匹配
providerMap.get(key).doAction(req, resp); providerMap.get(key).doAction(req, resp); // 执行匹配的Provider的doAction方法
logger.info("provider 分发完毕"); logger.info("provider 分发完毕"); // 记录Provider分发完成
isMatch=true; isMatch = true; // 设置匹配标志为true
} }
} }
if(!isMatch){ if (!isMatch) { // 如果没有找到匹配的Provider
toErrorPage(ControllerMessage.REQUEST_INVALID.message,req,resp); toErrorPage(ControllerMessage.REQUEST_INVALID.message, req, resp); // 转发到错误页面
logger.info("该请求没有匹配provider :"+url.substring(14)); logger.info("该请求没有匹配provider: " + url.substring(14)); // 记录没有匹配的Provider
return; return; // 结束方法执行
} }
// logger.info("响应结果 "+resp.getOutputStream()); // logger.info("响应结果 "+resp.getOutputStream()); // 这行代码被注释掉了,可能是为了调试目的
} }
} }

@ -1,28 +1,11 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao; package com.hyc.wechat.dao;
import com.hyc.wechat.dao.annotation.*; import com.hyc.wechat.dao.annotation.*;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat * @program wechat
* @description Dao * @description Dao
* @date 2019-05-01 17:11
*/ */
public interface BaseDao { public interface BaseDao {
@ -41,8 +24,6 @@ public interface BaseDao {
* @param obj * @param obj
* @name insert * @name insert
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/1
*/ */
@Insert() @Insert()
int insert(Object obj); int insert(Object obj);
@ -56,8 +37,6 @@ public interface BaseDao {
* @name update * @name update
* @notice null<br> * @notice null<br>
* null * null
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/1
*/ */
@Update() @Update()
int update(Object obj); int update(Object obj);
@ -68,8 +47,6 @@ public interface BaseDao {
* @param obj * @param obj
* @name delete * @name delete
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/1
*/ */
@Delete() @Delete()
int delete(Object obj); int delete(Object obj);

@ -1,18 +1,3 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao; package com.hyc.wechat.dao;
@ -24,9 +9,7 @@ import com.hyc.wechat.model.po.Chat;
import java.util.List; import java.util.List;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @description CRUD * @description CRUD
* @date 2019-05-03 02:18
*/ */
public interface ChatDao extends BaseDao { public interface ChatDao extends BaseDao {
@ -40,8 +23,6 @@ public interface ChatDao extends BaseDao {
* @return * @return
* @name getChatById * @name getChatById
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/2
*/ */
@Result(entity = Chat.class, returns = ResultType.OBJECT) @Result(entity = Chat.class, returns = ResultType.OBJECT)
@Query(value = "select " + ALL_FIELD + " from " + TABLE + " where id = ? ") @Query(value = "select " + ALL_FIELD + " from " + TABLE + " where id = ? ")
@ -54,8 +35,6 @@ public interface ChatDao extends BaseDao {
* @return * @return
* @name listByUserId * @name listByUserId
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/3
*/ */
@Result(entity = Chat.class, returns = ResultType.LIST) @Result(entity = Chat.class, returns = ResultType.LIST)
@Query(value = "select c.id,c.number,c.owner_id,c.name,c.type,c.member,c.photo,c.status,c.gmt_create,c.gmt_modified " + @Query(value = "select c.id,c.number,c.owner_id,c.name,c.type,c.member,c.photo,c.status,c.gmt_create,c.gmt_modified " +
@ -72,8 +51,6 @@ public interface ChatDao extends BaseDao {
* @return * @return
* @name toFriendChat * @name toFriendChat
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/5
*/ */
@Result(entity = Chat.class, returns = ResultType.OBJECT) @Result(entity = Chat.class, returns = ResultType.OBJECT)
@Query(value = "select c.id,c.number,c.owner_id,u.name as name,c.member,u.photo as photo,c.type,c.status,c.gmt_create,c.gmt_modified " + @Query(value = "select c.id,c.number,c.owner_id,u.name as name,c.member,u.photo as photo,c.type,c.status,c.gmt_create,c.gmt_modified " +
@ -88,8 +65,6 @@ public interface ChatDao extends BaseDao {
* @return * @return
* @name getByChatNumber * @name getByChatNumber
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/6
*/ */
@Result(entity = Chat.class,returns = ResultType.OBJECT) @Result(entity = Chat.class,returns = ResultType.OBJECT)
@Query(value = "select "+ALL_FIELD+" from "+TABLE+" where number = ? ") @Query(value = "select "+ALL_FIELD+" from "+TABLE+" where number = ? ")

@ -1,18 +1,3 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao; package com.hyc.wechat.dao;
@ -21,10 +6,8 @@ import com.hyc.wechat.exception.DaoException;
import java.sql.Connection; import java.sql.Connection;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat * @program wechat
* @description Dao * @description Dao
* @date 2019-05-01 16:33
*/ */
public interface DataSource { public interface DataSource {
/** /**
@ -34,8 +17,6 @@ public interface DataSource {
* @throws DaoException * @throws DaoException
* @name getConnection * @name getConnection
* @notice * @notice
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/1
*/ */
Connection getConnection() throws DaoException; Connection getConnection() throws DaoException;
@ -45,8 +26,6 @@ public interface DataSource {
* *
* @param conn * @param conn
* @name freeConnection * @name freeConnection
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/1
*/ */
void freeConnection(Connection conn); void freeConnection(Connection conn);
@ -56,8 +35,6 @@ public interface DataSource {
* @param conn * @param conn
* @return java.sql.Connection * @return java.sql.Connection
* @name createConnection * @name createConnection
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/1
*/ */
void destroyConnection(Connection conn); void destroyConnection(Connection conn);
@ -67,8 +44,6 @@ public interface DataSource {
* *
* @return int * @return int
* @name getCurrentCount * @name getCurrentCount
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/1
*/ */
int getCurrentCount(); int getCurrentCount();
@ -77,8 +52,6 @@ public interface DataSource {
* *
* @return int * @return int
* @name getfreeCount * @name getfreeCount
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/1
*/ */
int getfreeCount(); int getfreeCount();
} }

@ -1,18 +1,3 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao; package com.hyc.wechat.dao;
@ -26,10 +11,8 @@ import java.math.BigInteger;
import java.util.List; import java.util.List;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat * @program wechat
* @description CRUD * @description CRUD
* @date 2019-05-02 01:59
*/ */
public interface FriendDao extends BaseDao { public interface FriendDao extends BaseDao {
@ -44,8 +27,6 @@ public interface FriendDao extends BaseDao {
* @return * @return
* @name getFriendByUIDAndFriendId * @name getFriendByUIDAndFriendId
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/6
*/ */
@Result(entity = Friend.class, returns = ResultType.OBJECT) @Result(entity = Friend.class, returns = ResultType.OBJECT)
@Query(value = "select " + ALL_FIELD + " from " + TABLE + " where user_id = ? and friend_id = ? ") @Query(value = "select " + ALL_FIELD + " from " + TABLE + " where user_id = ? and friend_id = ? ")
@ -59,8 +40,6 @@ public interface FriendDao extends BaseDao {
* @return * @return
* @name listByUserId * @name listByUserId
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/6
*/ */
@Result(entity = Friend.class, returns = ResultType.LIST) @Result(entity = Friend.class, returns = ResultType.LIST)
@Query(value = "select f.id,f.user_id,f.friend_id,f.chat_id,f.group_id,f.alias,f.description,u.photo as photo,f.status,f.gmt_create,f.gmt_modified " + @Query(value = "select f.id,f.user_id,f.friend_id,f.chat_id,f.group_id,f.alias,f.description,u.photo as photo,f.status,f.gmt_create,f.gmt_modified " +
@ -74,8 +53,6 @@ public interface FriendDao extends BaseDao {
* @param id id * @param id id
* @name getFriendById * @name getFriendById
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/7
*/ */
@Result(entity = Friend.class, returns = ResultType.OBJECT) @Result(entity = Friend.class, returns = ResultType.OBJECT)
@Query(value = "select " + ALL_FIELD + " from " + TABLE + " where id = ? ") @Query(value = "select " + ALL_FIELD + " from " + TABLE + " where id = ? ")

@ -1,18 +1,3 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao; package com.hyc.wechat.dao;
@ -25,9 +10,7 @@ import java.math.BigInteger;
import java.util.List; import java.util.List;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @description user_chatCRUD * @description user_chatCRUD
* @date 2019-05-03 13:05
*/ */
public interface MemberDao extends BaseDao { public interface MemberDao extends BaseDao {
String TABLE = "member"; String TABLE = "member";
@ -40,8 +23,6 @@ public interface MemberDao extends BaseDao {
* @return * @return
* @name getMemberById * @name getMemberById
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/2
*/ */
@Result(entity = Member.class, returns = ResultType.OBJECT) @Result(entity = Member.class, returns = ResultType.OBJECT)
@Query(value = "select " + ALL_FIELD + " from " + TABLE + " where id = ? ") @Query(value = "select " + ALL_FIELD + " from " + TABLE + " where id = ? ")
@ -55,8 +36,6 @@ public interface MemberDao extends BaseDao {
* @return * @return
* @name getMemberByUIdAndChatId * @name getMemberByUIdAndChatId
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/2
*/ */
@Result(entity = Member.class, returns = ResultType.OBJECT) @Result(entity = Member.class, returns = ResultType.OBJECT)
@Query(value = "select " + ALL_FIELD + " from " + TABLE + " where user_id = ? and chat_id = ? ") @Query(value = "select " + ALL_FIELD + " from " + TABLE + " where user_id = ? and chat_id = ? ")
@ -69,8 +48,6 @@ public interface MemberDao extends BaseDao {
* @param chatId id * @param chatId id
* @return * @return
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/5
*/ */
@Result(entity = Member.class, returns = ResultType.LIST) @Result(entity = Member.class, returns = ResultType.LIST)
@Query(value = "select " + ALL_FIELD + " from " + TABLE + " where chat_id = ? ") @Query(value = "select " + ALL_FIELD + " from " + TABLE + " where chat_id = ? ")

@ -1,18 +1,3 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao; package com.hyc.wechat.dao;
@ -25,9 +10,7 @@ import java.math.BigInteger;
import java.util.List; import java.util.List;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @description messageCRUD * @description messageCRUD
* @date 2019-05-03 13:06
*/ */
public interface MessageDao extends BaseDao { public interface MessageDao extends BaseDao {
@ -43,8 +26,6 @@ public interface MessageDao extends BaseDao {
* @param chatId id * @param chatId id
* @return * @return
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/2
*/ */
@Result(entity = Message.class, returns = ResultType.OBJECT) @Result(entity = Message.class, returns = ResultType.OBJECT)
@Query(value = "select " + ALL_FIELD + " from " + TABLE + " where sender_id = ? and chat_id = ? and time = ? ") @Query(value = "select " + ALL_FIELD + " from " + TABLE + " where sender_id = ? and chat_id = ? and time = ? ")
@ -60,8 +41,6 @@ public interface MessageDao extends BaseDao {
* @param offset * @param offset
* @name listMessageByUserIdAndChatId * @name listMessageByUserIdAndChatId
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/7
*/ */
@Result(entity = Message.class, returns = ResultType.LIST) @Result(entity = Message.class, returns = ResultType.LIST)
@Query(value = "select m.id, m.sender_id, m.chat_id, m.content , m.type , m.time ,m.status , " + @Query(value = "select m.id, m.sender_id, m.chat_id, m.content , m.type , m.time ,m.status , " +
@ -79,8 +58,6 @@ public interface MessageDao extends BaseDao {
* @param offset * @param offset
* @name listMessageByUserIdAndChatId * @name listMessageByUserIdAndChatId
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/7
*/ */
@Result(entity = Message.class, returns = ResultType.LIST) @Result(entity = Message.class, returns = ResultType.LIST)
@Query(value = "select m.id, m.sender_id, m.chat_id, m.content , m.type , m.time ,m.status , " + @Query(value = "select m.id, m.sender_id, m.chat_id, m.content , m.type , m.time ,m.status , " +
@ -96,8 +73,6 @@ public interface MessageDao extends BaseDao {
* @param chatId id * @param chatId id
* @param fileName * @param fileName
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/7
*/ */
@Result(entity = Message.class, returns = ResultType.LIST) @Result(entity = Message.class, returns = ResultType.LIST)
@Query(value = "select m.id, m.sender_id, m.chat_id, m.content , m.type , m.time ,m.status , " + @Query(value = "select m.id, m.sender_id, m.chat_id, m.content , m.type , m.time ,m.status , " +
@ -114,8 +89,6 @@ public interface MessageDao extends BaseDao {
* @param limit * @param limit
* @param offset * @param offset
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/7
*/ */
@Result(entity = Message.class, returns = ResultType.LIST) @Result(entity = Message.class, returns = ResultType.LIST)
@Query(value = "select m.id, m.sender_id, m.chat_id, m.content , m.type , m.time ,m.status , " + @Query(value = "select m.id, m.sender_id, m.chat_id, m.content , m.type , m.time ,m.status , " +
@ -131,8 +104,6 @@ public interface MessageDao extends BaseDao {
* @param limit * @param limit
* @param offset * @param offset
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/7
*/ */
@Result(entity = Message.class, returns = ResultType.LIST) @Result(entity = Message.class, returns = ResultType.LIST)
@Query(value = "select m.id, m.sender_id, m.chat_id, m.content , m.type , m.time ,m.status , " + @Query(value = "select m.id, m.sender_id, m.chat_id, m.content , m.type , m.time ,m.status , " +

@ -25,9 +25,7 @@ import com.hyc.wechat.model.po.Moment;
import java.util.List; import java.util.List;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @description CRUD * @description CRUD
* @date 2019-05-07 11:55
*/ */
public interface MomentDao extends BaseDao { public interface MomentDao extends BaseDao {
String TABLE = "moment"; String TABLE = "moment";
@ -39,8 +37,6 @@ public interface MomentDao extends BaseDao {
* @param id id * @param id id
* @name geMomentById * @name geMomentById
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/2
*/ */
@Result(entity = Moment.class, returns = ResultType.OBJECT) @Result(entity = Moment.class, returns = ResultType.OBJECT)
@Query(value = "select " + ALL_FIELD + " from " + TABLE + " where id = ? ") @Query(value = "select " + ALL_FIELD + " from " + TABLE + " where id = ? ")
@ -52,8 +48,6 @@ public interface MomentDao extends BaseDao {
* @param ownerId id * @param ownerId id
* @param stauts * @param stauts
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/8
*/ */
@Result(entity = Moment.class, returns = ResultType.OBJECT) @Result(entity = Moment.class, returns = ResultType.OBJECT)
@Query(value = "select " + ALL_FIELD + " from " + TABLE + " where owner_id = ? and status = ? ") @Query(value = "select " + ALL_FIELD + " from " + TABLE + " where owner_id = ? and status = ? ")
@ -68,8 +62,6 @@ public interface MomentDao extends BaseDao {
* @param offset * @param offset
* @name listMyMomentByOwnerIdDesc * @name listMyMomentByOwnerIdDesc
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/7
*/ */
@Result(entity = Moment.class, returns = ResultType.LIST) @Result(entity = Moment.class, returns = ResultType.LIST)
@Query("select " + ALL_FIELD + " from " + TABLE + " where owner_id = ? order by time desc limit ? offset ? ") @Query("select " + ALL_FIELD + " from " + TABLE + " where owner_id = ? order by time desc limit ? offset ? ")
@ -83,8 +75,6 @@ public interface MomentDao extends BaseDao {
* @param offset * @param offset
* @name listMyMomentByOwnerId * @name listMyMomentByOwnerId
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/7
*/ */
@Result(entity = Moment.class, returns = ResultType.LIST) @Result(entity = Moment.class, returns = ResultType.LIST)
@Query("select " + ALL_FIELD + " from " + TABLE + " where owner_id = ? order by time limit ? offset ? ") @Query("select " + ALL_FIELD + " from " + TABLE + " where owner_id = ? order by time limit ? offset ? ")
@ -99,8 +89,6 @@ public interface MomentDao extends BaseDao {
* @param offset * @param offset
* @name loadPhoto * @name loadPhoto
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/10
*/ */
@Result(entity = Moment.class, returns = ResultType.LIST) @Result(entity = Moment.class, returns = ResultType.LIST)
@Query("select photo from " + TABLE + " where owner_id = ? order by time desc limit ? offset ? ") @Query("select photo from " + TABLE + " where owner_id = ? order by time desc limit ? offset ? ")

@ -1,18 +1,3 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao; package com.hyc.wechat.dao;
@ -24,9 +9,7 @@ import com.hyc.wechat.model.po.News;
import java.util.List; import java.util.List;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @description CRUD * @description CRUD
* @date 2019-05-07 18:47
*/ */
public interface NewsDao extends BaseDao { public interface NewsDao extends BaseDao {
String TABLE = "news"; String TABLE = "news";
@ -40,8 +23,6 @@ public interface NewsDao extends BaseDao {
* @param offset * @param offset
* @name listNewsByUserId * @name listNewsByUserId
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/7
*/ */
@Result(entity = News.class, returns = ResultType.LIST) @Result(entity = News.class, returns = ResultType.LIST)
@Query("select " + ALL_FIELD + " from " + TABLE + " where user_id = ? order by gmt_create desc limit ? offset ? ") @Query("select " + ALL_FIELD + " from " + TABLE + " where user_id = ? order by gmt_create desc limit ? offset ? ")
@ -55,8 +36,6 @@ public interface NewsDao extends BaseDao {
* @param userId id * @param userId id
* @name getNewsByMomentId * @name getNewsByMomentId
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/7
*/ */
@Result(entity = News.class, returns = ResultType.OBJECT) @Result(entity = News.class, returns = ResultType.OBJECT)
@Query(value = "select " + ALL_FIELD + " from " + TABLE + " where moment_id = ? and user_id = ? ") @Query(value = "select " + ALL_FIELD + " from " + TABLE + " where moment_id = ? and user_id = ? ")

@ -1,18 +1,3 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao; package com.hyc.wechat.dao;
@ -20,9 +5,7 @@ import com.hyc.wechat.dao.annotation.Delete;
import com.hyc.wechat.dao.annotation.Update; import com.hyc.wechat.dao.annotation.Update;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @description CRUD * @description CRUD
* @date 2019-05-06 21:41
*/ */
public interface RecordDao extends BaseDao { public interface RecordDao extends BaseDao {
String TABLE = "record"; String TABLE = "record";
@ -37,8 +20,6 @@ public interface RecordDao extends BaseDao {
* @param chatId id * @param chatId id
* @name updateStatusInChat * @name updateStatusInChat
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/7
*/ */
@Update("update " + TABLE + " as r inner join message as m set r.status = ? where r.user_id = ? and r.message_id = m.id and m.chat_id = ?") @Update("update " + TABLE + " as r inner join message as m set r.status = ? where r.user_id = ? and r.message_id = m.id and m.chat_id = ?")
void updateStatusInChat(Object status, Object userId ,Object chatId); void updateStatusInChat(Object status, Object userId ,Object chatId);
@ -51,8 +32,6 @@ public interface RecordDao extends BaseDao {
* @param chatId id * @param chatId id
* @name deleteAllRecordInChat * @name deleteAllRecordInChat
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/10
*/ */
@Update("delete r from " + TABLE + " r inner join message m on r.message_id = m.id where r.user_id = ? and m.chat_id = ? " ) @Update("delete r from " + TABLE + " r inner join message m on r.message_id = m.id where r.user_id = ? and m.chat_id = ? " )
void deleteAllRecordInChat(Object userId , Object chatId); void deleteAllRecordInChat(Object userId , Object chatId);

@ -1,18 +1,3 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao; package com.hyc.wechat.dao;
@ -25,9 +10,7 @@ import com.hyc.wechat.model.po.Remark;
import java.util.List; import java.util.List;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @description * @description
* @date 2019-05-14 01:12
*/ */
public interface RemarkDao extends BaseDao{ public interface RemarkDao extends BaseDao{
String TABLE = "remark"; String TABLE = "remark";
@ -41,8 +24,6 @@ public interface RemarkDao extends BaseDao{
* @param offset * @param offset
* @name listRemarkDesc * @name listRemarkDesc
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/14
*/ */
@Result(entity = Remark.class, returns = ResultType.LIST) @Result(entity = Remark.class, returns = ResultType.LIST)
@Query("select " + ALL_FIELD + " from " + TABLE + " where moment_id = ? order by time limit ? offset ? ") @Query("select " + ALL_FIELD + " from " + TABLE + " where moment_id = ? order by time limit ? offset ? ")
@ -54,8 +35,6 @@ public interface RemarkDao extends BaseDao{
* @param id id * @param id id
* @name geRemarkById * @name geRemarkById
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/14
*/ */
@Result(entity = Remark.class, returns = ResultType.OBJECT) @Result(entity = Remark.class, returns = ResultType.OBJECT)
@Query(value = "select " + ALL_FIELD + " from " + TABLE + " where id = ? ") @Query(value = "select " + ALL_FIELD + " from " + TABLE + " where id = ? ")

@ -1,25 +1,8 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao; package com.hyc.wechat.dao;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @description * @description
* @date 2019-05-14 01:12
*/ */
public interface ReplyDao extends BaseDao { public interface ReplyDao extends BaseDao {
} }

@ -1,18 +1,3 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao; package com.hyc.wechat.dao;
@ -20,10 +5,8 @@ package com.hyc.wechat.dao;
import java.sql.ResultSet; import java.sql.ResultSet;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program XHotel * @program XHotel
* @description * @description
* @date 2019-04-09 15:06
*/ */
public interface ResultMapper { public interface ResultMapper {
/** /**
@ -32,8 +15,6 @@ public interface ResultMapper {
* @param rs * @param rs
* @return java.lang.Object * @return java.lang.Object
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/10
*/ */
Object doMap(ResultSet rs); Object doMap(ResultSet rs);
} }

@ -1,26 +1,9 @@
/* //t
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao; package com.hyc.wechat.dao;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program XHotel * @program XHotel
* @description sql * @description sql
* @date 2019-04-11 17:55
*/ */
public interface SQLMapper { public interface SQLMapper {
@ -32,8 +15,6 @@ public interface SQLMapper {
* @return sql * @return sql
* @name doMap * @name doMap
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/12
*/ */
String doMap(Object... params); String doMap(Object... params);

@ -1,19 +1,4 @@
/* //导入必要库
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao; package com.hyc.wechat.dao;
import com.hyc.wechat.dao.annotation.Insert; import com.hyc.wechat.dao.annotation.Insert;
@ -21,10 +6,8 @@ import com.hyc.wechat.dao.annotation.Insert;
import java.util.LinkedList; import java.util.LinkedList;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat * @program wechat
* @description SQL * @description SQL
* @date 2019-05-01 17:34
*/ */
public interface SQLRunner { public interface SQLRunner {
@ -48,8 +31,6 @@ public interface SQLRunner {
* @return java.lang.Object * @return java.lang.Object
* @name executeUpdate * @name executeUpdate
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/9
*/ */
int executeUpdate(String sql, Object[] params); int executeUpdate(String sql, Object[] params);
@ -63,8 +44,6 @@ public interface SQLRunner {
* @return int sql * @return int sql
* @name executeUpdate * @name executeUpdate
* @notice SqlMapper * @notice SqlMapper
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/9
* @see SQLMapper * @see SQLMapper
*/ */
int executeUpdate(Object obj, SQLMapper sqlMapper); int executeUpdate(Object obj, SQLMapper sqlMapper);
@ -76,8 +55,6 @@ public interface SQLRunner {
* @return int * @return int
* @name insert * @name insert
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/9
*/ */
@Insert() @Insert()
int insert(Object obj, String table); int insert(Object obj, String table);
@ -90,8 +67,6 @@ public interface SQLRunner {
* @name update * @name update
* @notice null<br> * @notice null<br>
* null * null
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/10
*/ */
int update(Object obj, String table); int update(Object obj, String table);
@ -102,8 +77,6 @@ public interface SQLRunner {
* @return int * @return int
* @name delete * @name delete
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
int delete(Object id, String table); int delete(Object id, String table);
@ -125,8 +98,6 @@ public interface SQLRunner {
* @return java.lang.Object * @return java.lang.Object
* @name executeQuery * @name executeQuery
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/9
*/ */
Object executeQuery(String sql, Object[] params, ResultMapper mapper); Object executeQuery(String sql, Object[] params, ResultMapper mapper);
@ -145,8 +116,6 @@ public interface SQLRunner {
* @return java.util.LinkedList * @return java.util.LinkedList
* @name queryList * @name queryList
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/10
*/ */
LinkedList queryList(String sql, Object[] params, Class clazz); LinkedList queryList(String sql, Object[] params, Class clazz);
@ -160,8 +129,6 @@ public interface SQLRunner {
* @return Object * @return Object
* @name queryList * @name queryList
* @notice null * @notice null
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/10
*/ */
Object queryObject(String sql, Object[] params, Class clazz); Object queryObject(String sql, Object[] params, Class clazz);
@ -173,8 +140,6 @@ public interface SQLRunner {
* @return * @return
* @name queryValue * @name queryValue
* @notice null * @notice null
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/11
*/ */
Object queryValue(String sql, Object[] params); Object queryValue(String sql, Object[] params);
@ -201,8 +166,6 @@ public interface SQLRunner {
* @return java.util.LinkedList * @return java.util.LinkedList
* @name queryOrderBy * @name queryOrderBy
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
LinkedList queryOrderBy(String[] selectFields, String orderBy, boolean isDesc, String tableName); LinkedList queryOrderBy(String[] selectFields, String orderBy, boolean isDesc, String tableName);
@ -234,8 +197,6 @@ public interface SQLRunner {
* @return java.util.LinkedList * @return java.util.LinkedList
* @name queryWhere * @name queryWhere
* @notice not * @notice not
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
LinkedList queryWhere(String[] selectFields, Object obj, String conj, String condition); LinkedList queryWhere(String[] selectFields, Object obj, String conj, String condition);
@ -251,8 +212,6 @@ public interface SQLRunner {
* @return java.util.LinkedList * @return java.util.LinkedList
* @name queryWhereAndEquals * @name queryWhereAndEquals
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
LinkedList queryWhereAndEquals(String[] selectFields, Object obj); LinkedList queryWhereAndEquals(String[] selectFields, Object obj);
@ -269,8 +228,6 @@ public interface SQLRunner {
* @return java.util.LinkedList * @return java.util.LinkedList
* @name queryWhereLikeAnd * @name queryWhereLikeAnd
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
LinkedList queryWhereLikeAnd(String[] selectFields, Object obj); LinkedList queryWhereLikeAnd(String[] selectFields, Object obj);
@ -286,8 +243,6 @@ public interface SQLRunner {
* @return java.util.LinkedList * @return java.util.LinkedList
* @name queryWhereLikeAnd * @name queryWhereLikeAnd
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
LinkedList queryWhereLikeOr(String[] selectFields, Object obj); LinkedList queryWhereLikeOr(String[] selectFields, Object obj);
@ -307,8 +262,6 @@ public interface SQLRunner {
* @return java.util.LinkedList * @return java.util.LinkedList
* @name queryPages * @name queryPages
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
LinkedList queryPages(String[] selectFields, String tableName, String limit, String offset); LinkedList queryPages(String[] selectFields, String tableName, String limit, String offset);
@ -326,8 +279,6 @@ public interface SQLRunner {
* @param fieldValues * @param fieldValues
* @name fieldMapper * @name fieldMapper
* @notice null * @notice null
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/9
*/ */
void fieldMapper(Object obj, LinkedList fieldNames, LinkedList fieldValues); void fieldMapper(Object obj, LinkedList fieldNames, LinkedList fieldValues);
@ -339,8 +290,6 @@ public interface SQLRunner {
* @return java.lang.String * @return java.lang.String
* @name selectMapper * @name selectMapper
* @notice * @notice
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
String selectMapper(String tableName, Object[] selectFields); String selectMapper(String tableName, Object[] selectFields);
@ -352,8 +301,6 @@ public interface SQLRunner {
* @return java.lang.String where,where id = ? and user_name = ? * @return java.lang.String where,where id = ? and user_name = ?
* @name whereMapper * @name whereMapper
* @notice where * @notice where
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
String whereMapper(Object[] whereFields, String conj, String condition); String whereMapper(Object[] whereFields, String conj, String condition);
@ -365,8 +312,6 @@ public interface SQLRunner {
* @return java.lang.String where,where id like ? and user_name like ? * @return java.lang.String where,where id like ? and user_name like ?
* @name likeMapper * @name likeMapper
* @notice where * @notice where
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
String likeMapper(Object[] likeFields, String conj); String likeMapper(Object[] likeFields, String conj);
@ -378,8 +323,6 @@ public interface SQLRunner {
* @return java.lang.String * @return java.lang.String
* @name orderByMapper * @name orderByMapper
* @notice where * @notice where
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
String orderByMapper(String orderBy, boolean isDesc); String orderByMapper(String orderBy, boolean isDesc);
@ -391,8 +334,6 @@ public interface SQLRunner {
* @return java.lang.String * @return java.lang.String
* @name pageMapper * @name pageMapper
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
String pageMapper(String limit, String offset); String pageMapper(String limit, String offset);
@ -405,8 +346,6 @@ public interface SQLRunner {
* @return java.lang.String * @return java.lang.String
* @name pageMapper * @name pageMapper
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
String pageOffsetMapper(String offset); String pageOffsetMapper(String offset);

@ -1,19 +1,4 @@
/* //导入必要库
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao; package com.hyc.wechat.dao;
import com.hyc.wechat.dao.annotation.Query; import com.hyc.wechat.dao.annotation.Query;
@ -24,10 +9,8 @@ import com.hyc.wechat.model.po.User;
import java.util.List; import java.util.List;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat * @program wechat
* @description UserCRUD * @description UserCRUD
* @date 2019-05-01 23:39
*/ */
public interface UserDao extends BaseDao { public interface UserDao extends BaseDao {
String TABLE = "user"; String TABLE = "user";
@ -42,8 +25,6 @@ public interface UserDao extends BaseDao {
* @return * @return
* @name getUserById * @name getUserById
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/2
*/ */
@Result(entity = User.class, returns = ResultType.OBJECT) @Result(entity = User.class, returns = ResultType.OBJECT)
@Query(value = "select " + ALL_FIELD + " from " + TABLE + " where id = ? ") @Query(value = "select " + ALL_FIELD + " from " + TABLE + " where id = ? ")
@ -57,8 +38,6 @@ public interface UserDao extends BaseDao {
* @return * @return
* @name getUserByEmail * @name getUserByEmail
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/2
*/ */
@Result(entity = User.class, returns = ResultType.OBJECT) @Result(entity = User.class, returns = ResultType.OBJECT)
@Query(value = "select " + ALL_FIELD + " from " + TABLE + " where email = ? ") @Query(value = "select " + ALL_FIELD + " from " + TABLE + " where email = ? ")
@ -72,8 +51,6 @@ public interface UserDao extends BaseDao {
* @return * @return
* @name getUserByWechatId * @name getUserByWechatId
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/2
*/ */
@Result(entity = User.class, returns = ResultType.OBJECT) @Result(entity = User.class, returns = ResultType.OBJECT)
@Query(value = "select " + ALL_FIELD + " from " + TABLE + " where wechat_id = ? ") @Query(value = "select " + ALL_FIELD + " from " + TABLE + " where wechat_id = ? ")
@ -84,8 +61,6 @@ public interface UserDao extends BaseDao {
* @return * @return
* @name listByName * @name listByName
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/5
*/ */
@Result(entity = User.class, returns = ResultType.LIST) @Result(entity = User.class, returns = ResultType.LIST)
@Query(value = "select " + ALL_FIELD + " from " + TABLE + " where name = ?") @Query(value = "select " + ALL_FIELD + " from " + TABLE + " where name = ?")
@ -99,8 +74,6 @@ public interface UserDao extends BaseDao {
* @return * @return
* @name listLike * @name listLike
* @notice * @notice
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/6
*/ */
@Result(entity = User.class, returns = ResultType.LIST) @Result(entity = User.class, returns = ResultType.LIST)
@Query(value = "select " + ALL_FIELD + " from " + TABLE + " where name like ? ") @Query(value = "select " + ALL_FIELD + " from " + TABLE + " where name like ? ")

@ -1,32 +1,25 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao.annotation; package com.hyc.wechat.dao.annotation;
import java.lang.annotation.*; import java.lang.annotation.*;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat * @program wechat
* @description * @description
* @date 2019-05-01 13:32
*/ */
@Documented @Documented
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD) @Target(ElementType.METHOD)
public @interface Delete { public @interface Delete {
/**
* value
* SQL
*
* @return SQL
*/
String value()default ""; String value()default "";
} }

@ -1,32 +1,19 @@
/* //导入必要库
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao.annotation; package com.hyc.wechat.dao.annotation;
import java.lang.annotation.*; import java.lang.annotation.*;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @description SQL * @description SQL
* @program wechat * @program wechat
* @date 2019-05-01 13:32
*/ */
@Documented @Documented
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD) @Target(ElementType.FIELD)
public @interface Field { public @interface Field {
/* name
*
* @return
*/
String name (); String name ();
} }

@ -1,32 +1,22 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao.annotation; package com.hyc.wechat.dao.annotation;
import java.lang.annotation.*; import java.lang.annotation.*;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat * @program wechat
* @description * @description
* @date 2019-05-01 13:32
*/ */
@Documented @Documented
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD) @Target(ElementType.METHOD)
public @interface Insert { public @interface Insert {
/**
* value
* SQL
*
* @return SQL
*/
String value()default ""; String value()default "";
} }

@ -1,28 +1,11 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao.annotation; package com.hyc.wechat.dao.annotation;
import java.lang.annotation.*; import java.lang.annotation.*;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @description SQL * @description SQL
* @program wechat * @program wechat
* @date 2019-05-01 13:32
*/ */
@Documented @Documented
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)

@ -1,28 +1,11 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao.annotation; package com.hyc.wechat.dao.annotation;
import java.lang.annotation.*; import java.lang.annotation.*;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat * @program wechat
* @description * @description
* @date 2019-05-01 13:32
*/ */
@Documented @Documented
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)

@ -1,18 +1,3 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao.annotation; package com.hyc.wechat.dao.annotation;
@ -21,10 +6,8 @@ import com.hyc.wechat.model.po.abs.BaseEntity;
import java.lang.annotation.*; import java.lang.annotation.*;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @description SQL * @description SQL
* @program wechat * @program wechat
* @date 2019-05-01 13:32
*/ */
@Documented @Documented
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)

@ -1,26 +1,9 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao.annotation; package com.hyc.wechat.dao.annotation;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat * @program wechat
* @description SQL * @description SQL
* @date 2019-05-01 21:21
*/ */
public enum ResultType{ public enum ResultType{
/** /**

@ -1,29 +1,12 @@
/* //导入必要库
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao.annotation; package com.hyc.wechat.dao.annotation;
import java.lang.annotation.*; import java.lang.annotation.*;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat * @program wechat
* @description * @description
* @date 2019-05-01 00:19
*/ */
@Documented @Documented
@Retention(value = RetentionPolicy.RUNTIME) @Retention(value = RetentionPolicy.RUNTIME)

@ -1,28 +1,11 @@
/* //导入必要库
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao.annotation; package com.hyc.wechat.dao.annotation;
import java.lang.annotation.*; import java.lang.annotation.*;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @description * @description
* @program wechat * @program wechat
* @date 2019-05-01 13:32
*/ */
@Documented @Documented
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)

@ -1,19 +1,3 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao.impl; package com.hyc.wechat.dao.impl;
import com.hyc.wechat.dao.DataSource; import com.hyc.wechat.dao.DataSource;
@ -30,10 +14,8 @@ import java.util.Queue;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat * @program wechat
* @description Dao * @description Dao
* @date 2019-05-01 16:40
*/ */
public class DataSourceImpl implements DataSource { public class DataSourceImpl implements DataSource {
/* /*
@ -151,8 +133,6 @@ public class DataSourceImpl implements DataSource {
* @throws DaoException * @throws DaoException
* @name getConnection * @name getConnection
* @notice * @notice
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/1
*/ */
@Override @Override
public Connection getConnection() throws DaoException { public Connection getConnection() throws DaoException {
@ -189,8 +169,6 @@ public class DataSourceImpl implements DataSource {
* *
* @param conn * @param conn
* @name freeConnection * @name freeConnection
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/1
*/ */
@Override @Override
public void freeConnection(Connection conn) { public void freeConnection(Connection conn) {
@ -202,8 +180,6 @@ public class DataSourceImpl implements DataSource {
* *
* @return java.sql.Connection * @return java.sql.Connection
* @name createConnection * @name createConnection
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/1
*/ */
@Override @Override
public void destroyConnection(Connection conn) { public void destroyConnection(Connection conn) {
@ -221,8 +197,6 @@ public class DataSourceImpl implements DataSource {
* *
* @return int * @return int
* @name getCurrentCount * @name getCurrentCount
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/1
*/ */
@Override @Override
public int getCurrentCount() { public int getCurrentCount() {
@ -234,8 +208,6 @@ public class DataSourceImpl implements DataSource {
* *
* @return int * @return int
* @name getfreeCount * @name getfreeCount
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/1
*/ */
@Override @Override
public int getfreeCount() { public int getfreeCount() {
@ -254,8 +226,6 @@ public class DataSourceImpl implements DataSource {
* *
* @return java.sql.Connection * @return java.sql.Connection
* @name createConnection * @name createConnection
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/1
*/ */
private Connection createConnection() throws DaoException { private Connection createConnection() throws DaoException {
currentCount++; currentCount++;

@ -1,18 +1,3 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.dao.impl; package com.hyc.wechat.dao.impl;
@ -34,10 +19,8 @@ import static com.hyc.wechat.util.ReflectUtils.getMethods;
import static com.hyc.wechat.util.StringUtils.field2SqlField; import static com.hyc.wechat.util.StringUtils.field2SqlField;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat * @program wechat
* @description sql * @description sql
* @date 2019-05-01 17:34
*/ */
public class SQLRunnerImpl implements SQLRunner { public class SQLRunnerImpl implements SQLRunner {
@ -56,8 +39,6 @@ public class SQLRunnerImpl implements SQLRunner {
* @return java.lang.Object * @return java.lang.Object
* @name executeUpdate * @name executeUpdate
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/9
*/ */
@Override @Override
public int executeUpdate(String sql, Object[] params) { public int executeUpdate(String sql, Object[] params) {
@ -92,8 +73,6 @@ public class SQLRunnerImpl implements SQLRunner {
* @return int sql * @return int sql
* @name executeUpdate * @name executeUpdate
* @notice SqlMapper * @notice SqlMapper
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/9
* @see SQLMapper * @see SQLMapper
*/ */
@Override @Override
@ -149,8 +128,6 @@ public class SQLRunnerImpl implements SQLRunner {
* @return int * @return int
* @name insert * @name insert
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/9
*/ */
@Override @Override
public int insert(Object obj, String table) { public int insert(Object obj, String table) {
@ -185,8 +162,6 @@ public class SQLRunnerImpl implements SQLRunner {
* @name update * @name update
* @notice null<br> * @notice null<br>
* null * null
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/10
*/ */
@Override @Override
public int update(Object obj, String table) { public int update(Object obj, String table) {
@ -230,8 +205,6 @@ public class SQLRunnerImpl implements SQLRunner {
* @return int * @return int
* @name delete * @name delete
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
@Override @Override
public int delete(Object obj, String table) { public int delete(Object obj, String table) {
@ -265,8 +238,6 @@ public class SQLRunnerImpl implements SQLRunner {
* @return java.lang.Object * @return java.lang.Object
* @name executeQuery * @name executeQuery
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/9
*/ */
@Override @Override
public Object executeQuery(String sql, Object[] params, ResultMapper mapper) { public Object executeQuery(String sql, Object[] params, ResultMapper mapper) {
@ -320,9 +291,7 @@ public class SQLRunnerImpl implements SQLRunner {
* @param clazz * @param clazz
* @return java.util.LinkedList * @return java.util.LinkedList
* @name queryList * @name queryList
* @notice none * @notice non
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/10
*/ */
@Override @Override
public LinkedList queryList(String sql, Object[] params, Class clazz) { public LinkedList queryList(String sql, Object[] params, Class clazz) {
@ -333,10 +302,8 @@ public class SQLRunnerImpl implements SQLRunner {
* ResultMapperList<br> * ResultMapperList<br>
* 使 * 使
* *
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @name ListMapper * @name ListMapper
* @notice * @notice
* @date 2019/4/10
* @see com.hyc.www.dao.inter.ResultMapper * @see com.hyc.www.dao.inter.ResultMapper
*/ */
LinkedList list = new LinkedList<>(); LinkedList list = new LinkedList<>();
@ -399,8 +366,6 @@ public class SQLRunnerImpl implements SQLRunner {
* @return Object * @return Object
* @name queryList * @name queryList
* @notice null * @notice null
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/10
*/ */
@Override @Override
public Object queryObject(String sql, Object[] params, Class clazz) { public Object queryObject(String sql, Object[] params, Class clazz) {
@ -416,8 +381,6 @@ public class SQLRunnerImpl implements SQLRunner {
* @return * @return
* @name queryValue * @name queryValue
* @notice null * @notice null
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/11
*/ */
@Override @Override
public Object queryValue(String sql, Object[] params) { public Object queryValue(String sql, Object[] params) {
@ -461,8 +424,6 @@ public class SQLRunnerImpl implements SQLRunner {
* @return java.util.LinkedList * @return java.util.LinkedList
* @name queryOrderBy * @name queryOrderBy
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
@Override @Override
public LinkedList queryOrderBy(String[] selectFields, String orderBy, boolean isDesc, String tableName) { public LinkedList queryOrderBy(String[] selectFields, String orderBy, boolean isDesc, String tableName) {
@ -504,8 +465,6 @@ public class SQLRunnerImpl implements SQLRunner {
* @return java.util.LinkedList * @return java.util.LinkedList
* @name queryWhere * @name queryWhere
* @notice not * @notice not
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
@Override @Override
public LinkedList queryWhere(String[] selectFields, Object obj, String conj, String condition) { public LinkedList queryWhere(String[] selectFields, Object obj, String conj, String condition) {
@ -548,8 +507,6 @@ public class SQLRunnerImpl implements SQLRunner {
* @return java.util.LinkedList * @return java.util.LinkedList
* @name queryWhereAndEquals * @name queryWhereAndEquals
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
@Override @Override
public LinkedList queryWhereAndEquals(String[] selectFields, Object obj) { public LinkedList queryWhereAndEquals(String[] selectFields, Object obj) {
@ -569,8 +526,6 @@ public class SQLRunnerImpl implements SQLRunner {
* @return java.util.LinkedList * @return java.util.LinkedList
* @name queryWhereLikeAnd * @name queryWhereLikeAnd
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
@Override @Override
public LinkedList queryWhereLikeAnd(String[] selectFields, Object obj) { public LinkedList queryWhereLikeAnd(String[] selectFields, Object obj) {
@ -589,8 +544,6 @@ public class SQLRunnerImpl implements SQLRunner {
* @return java.util.LinkedList * @return java.util.LinkedList
* @name queryWhereLikeAnd * @name queryWhereLikeAnd
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
@Override @Override
public LinkedList queryWhereLikeOr(String[] selectFields, Object obj) { public LinkedList queryWhereLikeOr(String[] selectFields, Object obj) {
@ -613,8 +566,6 @@ public class SQLRunnerImpl implements SQLRunner {
* @return java.util.LinkedList * @return java.util.LinkedList
* @name queryPages * @name queryPages
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
@Override @Override
public LinkedList queryPages(String[] selectFields, String tableName, String limit, String offset) { public LinkedList queryPages(String[] selectFields, String tableName, String limit, String offset) {
@ -637,8 +588,6 @@ public class SQLRunnerImpl implements SQLRunner {
* @param fieldValues * @param fieldValues
* @name fieldMapper * @name fieldMapper
* @notice null * @notice null
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/9
*/ */
@Override @Override
public void fieldMapper(Object obj, LinkedList fieldNames, LinkedList fieldValues) { public void fieldMapper(Object obj, LinkedList fieldNames, LinkedList fieldValues) {
@ -688,8 +637,6 @@ public class SQLRunnerImpl implements SQLRunner {
* @return java.lang.String * @return java.lang.String
* @name selectMapper * @name selectMapper
* @notice * @notice
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
@Override @Override
public String selectMapper(String tableName, Object[] selectFields) { public String selectMapper(String tableName, Object[] selectFields) {
@ -710,8 +657,6 @@ public class SQLRunnerImpl implements SQLRunner {
* @return java.lang.String where,where id = ? and user_name = ? * @return java.lang.String where,where id = ? and user_name = ?
* @name whereMapper * @name whereMapper
* @notice where * @notice where
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
@Override @Override
public String whereMapper(Object[] whereFields, String conj, String condition) { public String whereMapper(Object[] whereFields, String conj, String condition) {
@ -737,8 +682,6 @@ public class SQLRunnerImpl implements SQLRunner {
* @return java.lang.String where,where id like ? and user_name like ? * @return java.lang.String where,where id like ? and user_name like ?
* @name likeMapper * @name likeMapper
* @notice where * @notice where
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
@Override @Override
public String likeMapper(Object[] likeFields, String conj) { public String likeMapper(Object[] likeFields, String conj) {
@ -763,8 +706,6 @@ public class SQLRunnerImpl implements SQLRunner {
* @return java.lang.String * @return java.lang.String
* @name orderByMapper * @name orderByMapper
* @notice where * @notice where
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
@Override @Override
public String orderByMapper(String orderBy, boolean isDesc) { public String orderByMapper(String orderBy, boolean isDesc) {
@ -792,8 +733,6 @@ public class SQLRunnerImpl implements SQLRunner {
* @return java.lang.String * @return java.lang.String
* @name pageMapper * @name pageMapper
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
@Override @Override
public String pageMapper(String limit, String offset) { public String pageMapper(String limit, String offset) {
@ -809,8 +748,6 @@ public class SQLRunnerImpl implements SQLRunner {
* @return java.lang.String * @return java.lang.String
* @name pageMapper * @name pageMapper
* @notice none * @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/4/13
*/ */
@Override @Override
public String pageOffsetMapper(String offset) { public String pageOffsetMapper(String offset) {

@ -1,44 +1,51 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.exception; package com.hyc.wechat.exception;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat * @program wechat
* @description Dao * @description Dao
* @date 2019-05-01 16:36
*/ */
public class DaoException extends RuntimeException{ public class DaoException extends RuntimeException{
/**
*
* DaoException
*/
public DaoException() { public DaoException() {
super(); super();
} }
/**
*
* DaoException
* @param message
*/
public DaoException(String message) { public DaoException(String message) {
super(message); super(message);
} }
/**
*
* DaoException
* @param message
* @param cause
*/
public DaoException(String message, Throwable cause) { public DaoException(String message, Throwable cause) {
super(message, cause); super(message, cause);
} }
/**
*
* DaoException
* @param cause
*/
public DaoException(Throwable cause) { public DaoException(Throwable cause) {
super(cause); super(cause);
} }
/**
*
* DaoException
* @param message
* @param cause
* @param enableSuppression
* @param writableStackTrace
*/
protected DaoException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { protected DaoException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace); super(message, cause, enableSuppression, writableStackTrace);
} }

@ -1,44 +1,52 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.exception; package com.hyc.wechat.exception;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat * @program wechat
* @description service * @description service
* @date 2019-05-01 17:41
*/ */
public class ServiceException extends RuntimeException{ public class ServiceException extends RuntimeException{
/**
*
* ServiceException
*/
public ServiceException() { public ServiceException() {
super(); super();
} }
/**
*
* ServiceException
* @param message
*/
public ServiceException(String message) { public ServiceException(String message) {
super(message); super(message);
} }
/**
*
* ServiceException
* @param message
* @param cause
*/
public ServiceException(String message, Throwable cause) { public ServiceException(String message, Throwable cause) {
super(message, cause); super(message, cause);
} }
/**
*
* ServiceException
* @param cause
*/
public ServiceException(Throwable cause) { public ServiceException(Throwable cause) {
super(cause); super(cause);
} }
/**
*
* ServiceException
*
* @param message
* @param cause
* @param enableSuppression
* @param writableStackTrace
*/
protected ServiceException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { protected ServiceException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace); super(message, cause, enableSuppression, writableStackTrace);
} }

@ -1,18 +1,3 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.factory; package com.hyc.wechat.factory;
@ -25,16 +10,18 @@ import java.lang.reflect.Method;
import java.lang.reflect.Proxy; import java.lang.reflect.Proxy;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat * @program wechat
* @description Daosql * @description Daosql
* @date 2019-05-01 11:01
*/ */
public class DaoProxyFactory implements InvocationHandler { public class DaoProxyFactory implements InvocationHandler {
private static SQLRunner executor = new SQLRunnerImpl(); private static SQLRunner executor = new SQLRunnerImpl();
private static DaoProxyFactory instance= new DaoProxyFactory(); private static DaoProxyFactory instance= new DaoProxyFactory();
/**
* 使Java Proxy API
* @param interfaces DAOClass
* @return
*/
public Object getProxyInstance(Class interfaces) { public Object getProxyInstance(Class interfaces) {
return Proxy.newProxyInstance(interfaces.getClassLoader(), new Class[]{interfaces}, this); return Proxy.newProxyInstance(interfaces.getClassLoader(), new Class[]{interfaces}, this);
} }
@ -42,11 +29,21 @@ public class DaoProxyFactory implements InvocationHandler {
private DaoProxyFactory() { private DaoProxyFactory() {
} }
/**
* DaoProxyFactory
* @return DaoProxyFactory
*/
public static DaoProxyFactory getInstance(){ public static DaoProxyFactory getInstance(){
return instance; return instance;
} }
/**
* InvocationHandlerinvoke
* @param proxy
* @param method
* @param args
* @return
* @throws Throwable
*/
@Override @Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if (method.getAnnotation(Insert.class) != null) { if (method.getAnnotation(Insert.class) != null) {
@ -77,17 +74,22 @@ public class DaoProxyFactory implements InvocationHandler {
} }
} }
if (method.getAnnotation(Query.class) != null) { if (method.getAnnotation(Query.class) != null) {
// 获取@Result注解指定的返回类型
ResultType type = method.getAnnotation(Result.class).returns(); ResultType type = method.getAnnotation(Result.class).returns();
switch (type) { switch (type) {
case OBJECT: case OBJECT:
// 执行查询并返回单个对象
return executor.queryObject(method.getAnnotation(Query.class).value(), args, method.getAnnotation(Result.class).entity()); return executor.queryObject(method.getAnnotation(Query.class).value(), args, method.getAnnotation(Result.class).entity());
case LIST: case LIST:
// 执行查询并返回对象列表
return executor.queryList(method.getAnnotation(Query.class).value(), args, method.getAnnotation(Result.class).entity()); return executor.queryList(method.getAnnotation(Query.class).value(), args, method.getAnnotation(Result.class).entity());
case VALUE: case VALUE:
// 执行查询并返回单个值
return executor.queryValue(method.getAnnotation(Query.class).value(), args); return executor.queryValue(method.getAnnotation(Query.class).value(), args);
default: default:
} }
} }
// 如果方法没有注解,则直接调用原始方法
return method.invoke(proxy, args); return method.invoke(proxy, args);
} }

@ -1,19 +1,4 @@
/* //导入必要库
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.factory; package com.hyc.wechat.factory;
import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationHandler;
@ -21,31 +6,47 @@ import java.lang.reflect.Method;
import java.lang.reflect.Proxy; import java.lang.reflect.Proxy;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat * @program wechat
* @description Daosql * @description Daosql
* @date 2019-05-01 11:01
*/ */
public class ServiceProxyFactory implements InvocationHandler { public class ServiceProxyFactory implements InvocationHandler {
private Object target; private Object target;
/**
* 使Java Proxy API
* @param target
* @return
*/
public Object getProxyInstance(Object target) { public Object getProxyInstance(Object target) {
this.target =target; this.target =target;
// 创建代理对象,该代理对象实现了目标对象的所有接口
return Proxy.newProxyInstance(target.getClass().getClassLoader(), target.getClass().getInterfaces(), this); return Proxy.newProxyInstance(target.getClass().getClassLoader(), target.getClass().getInterfaces(), this);
} }
/**
* InvocationHandlerinvoke
* @param proxy
* @param method
* @param args
* @return
* @throws Throwable
*/
@Override @Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
return method.invoke(target, args); return method.invoke(target, args);
} }
/**
*
* @return
*/
public Object getTarget() { public Object getTarget() {
return target; return target;
} }
/**
*
* @param target
*/
public void setTarget(Object target) { public void setTarget(Object target) {
this.target = target; this.target = target;
} }

@ -1,19 +1,3 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.factory.proxy; package com.hyc.wechat.factory.proxy;
import com.hyc.wechat.dao.DataSource; import com.hyc.wechat.dao.DataSource;
@ -26,51 +10,92 @@ import java.lang.reflect.Proxy;
import java.sql.Connection; import java.sql.Connection;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat * @program wechat
* @description * @description
* @date 2019-05-01 17:52 *
*/ */
public class ConnectionProxy implements InvocationHandler { public class ConnectionProxy implements InvocationHandler {
// 被代理的Connection对象
private Connection target; private Connection target;
// 数据源对象,用于管理数据库连接
private DataSource dataSource; private DataSource dataSource;
public Connection getProxyInstance(Connection target){ /**
this.target= target; *
return (Connection) Proxy.newProxyInstance(Connection.class.getClassLoader(),new Class[]{Connection.class},this); * @param dataSource
} */
public ConnectionProxy(DataSource dataSource) { public ConnectionProxy(DataSource dataSource) {
this.dataSource = dataSource; this.dataSource = dataSource;
} }
/**
*
* @param target Connection
* @return Connection
*/
public Connection getProxyInstance(Connection target) {
this.target = target; // 设置被代理的目标对象
// 使用Proxy类创建一个Connection代理实例并将当前对象作为调用处理器
return (Connection) Proxy.newProxyInstance(
Connection.class.getClassLoader(), // 类加载器
new Class[]{Connection.class}, // 代理实现的接口数组
this); // 调用处理器
}
/**
* InvocationHandlerinvoke
* @param proxy
* @param method
* @param args
* @return
*/
@Override @Override
public Object invoke(Object proxy, Method method, Object[] args) { public Object invoke(Object proxy, Method method, Object[] args) {
// 如果调用的是close方法则将连接放回数据源而不是真正关闭连接
if ("close".equals(method.getName())) { if ("close".equals(method.getName())) {
//调用代理对象的close方法时将目标对象放回数据库连接池 dataSource.freeConnection(target); // 将连接放回数据源
dataSource.freeConnection(target); return null; // close方法没有返回值
return null;
} }
try { try {
// 对于其他方法调用,直接转发给被代理的目标对象
return method.invoke(target, args); return method.invoke(target, args);
} catch (IllegalAccessException | InvocationTargetException e) { } catch (IllegalAccessException | InvocationTargetException e) {
// 如果方法调用过程中发生异常则抛出DaoException
throw new DaoException("无法调用目标对象的方法", e); throw new DaoException("无法调用目标对象的方法", e);
} }
} }
// 以下是getter和setter方法用于访问和修改target和dataSource属性
/**
* Connection
* @return Connection
*/
public Connection getTarget() { public Connection getTarget() {
return target; return target;
} }
/**
* Connection
* @param target Connection
*/
public void setTarget(Connection target) { public void setTarget(Connection target) {
this.target = target; this.target = target;
} }
/**
*
* @return
*/
public DataSource getDataSource() { public DataSource getDataSource() {
return dataSource; return dataSource;
} }
/**
*
* @param dataSource
*/
public void setDataSource(DataSource dataSource) { public void setDataSource(DataSource dataSource) {
this.dataSource = dataSource; this.dataSource = dataSource;
} }

@ -1,19 +1,4 @@
/* //导入必要库
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.model.builder; package com.hyc.wechat.model.builder;
import com.hyc.wechat.model.vo.MessageVO; import com.hyc.wechat.model.vo.MessageVO;
@ -22,49 +7,91 @@ import java.math.BigInteger;
import java.sql.Timestamp; import java.sql.Timestamp;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @description MessageVO * @description MessageVO
* @date 2019-05-07 14:58
*/ */
public class MessageVOBuilder { public class MessageVOBuilder {
private MessageVO messageVo; private MessageVO messageVo;
/**
* MessageVO
*/
public MessageVOBuilder() { public MessageVOBuilder() {
this.messageVo = new MessageVO(); this.messageVo = new MessageVO();
} }
/**
* MessageVO
* @return MessageVO
*/
public MessageVO build(){ public MessageVO build(){
return this.messageVo; return this.messageVo;
} }
/**
*
* @param senderName
* @return MessageVOBuilder便
*/
public MessageVOBuilder setSenderName(String senderName) { public MessageVOBuilder setSenderName(String senderName) {
this.messageVo.setSenderName(senderName); this.messageVo.setSenderName(senderName);
return this; return this;
} }
/**
* ID
* @param senderId ID
* @return MessageVOBuilder便
*/
public MessageVOBuilder setSenderId(BigInteger senderId){ public MessageVOBuilder setSenderId(BigInteger senderId){
this.messageVo.setSenderId(senderId); this.messageVo.setSenderId(senderId);
return this; return this;
} }
/**
* URL
* @param senderPhoto URL
* @return MessageVOBuilder便
*/
public MessageVOBuilder setSenderPhoto(String senderPhoto){ public MessageVOBuilder setSenderPhoto(String senderPhoto){
this.messageVo.setSenderPhoto(senderPhoto); this.messageVo.setSenderPhoto(senderPhoto);
return this; return this;
} }
/**
* ID
* @param chatId ID
* @return MessageVOBuilder便
*/
public MessageVOBuilder setChatId(BigInteger chatId){ public MessageVOBuilder setChatId(BigInteger chatId){
this.messageVo.setChatId(chatId); this.messageVo.setChatId(chatId);
return this; return this;
} }
/**
*
* @param content
* @return MessageVOBuilder便
*/
public MessageVOBuilder setContent(String content){ public MessageVOBuilder setContent(String content){
this.messageVo.setContent(content); this.messageVo.setContent(content);
return this; return this;
} }
/**
*
* @param time
* @return MessageVOBuilder便
*/
public MessageVOBuilder setTime(Timestamp time){ public MessageVOBuilder setTime(Timestamp time){
this.messageVo.setTime(time); this.messageVo.setTime(time);
return this; return this;
} }
/**
*
* @param type
* @return MessageVOBuilder便
*/
public MessageVOBuilder setType(String type){ public MessageVOBuilder setType(String type){
this.messageVo.setType(type); this.messageVo.setType(type);
return this; return this;
} }
/**
* ID
* @param id ID
* @return MessageVOBuilder便
*/
public MessageVOBuilder setId(BigInteger id){ public MessageVOBuilder setId(BigInteger id){
this.messageVo.setId(id); this.messageVo.setId(id);
return this; return this;

@ -1,18 +1,3 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.model.builder; package com.hyc.wechat.model.builder;
@ -22,100 +7,186 @@ import java.math.BigInteger;
import java.sql.Timestamp; import java.sql.Timestamp;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a> * @description MomentVO
* @description
* @date 2019-05-07 20:32
*/ */
public class MomentVOBuilder { public class MomentVOBuilder {
// MomentVO对象用于存储构建过程中的数据
private MomentVO momentVO; private MomentVO momentVO;
/**
* MomentVO
*/
public MomentVOBuilder() { public MomentVOBuilder() {
this.momentVO = new MomentVO(); this.momentVO = new MomentVO();
} }
/**
* MomentVO
* @return MomentVO
*/
public MomentVO build() { public MomentVO build() {
return this.momentVO; return this.momentVO;
} }
// 以下方法用于设置MomentVO对象的属性并返回当前Builder对象以便链式调用
/**
*
* @param time
* @return Builder
*/
public MomentVOBuilder setTime(Timestamp time){ public MomentVOBuilder setTime(Timestamp time){
this.momentVO.setTime(time); this.momentVO.setTime(time);
return this; return this;
} }
/**
* URL
* @param userPhoto URL
* @return Builder
*/
public MomentVOBuilder setUserPhoto(String userPhoto){ public MomentVOBuilder setUserPhoto(String userPhoto){
this.momentVO.setUserPhoto(userPhoto); this.momentVO.setUserPhoto(userPhoto);
return this; return this;
} }
/**
* URL
* @param photo URL
* @return Builder
*/
public MomentVOBuilder setPhoto(String photo){ public MomentVOBuilder setPhoto(String photo){
this.momentVO.setPhoto(photo); this.momentVO.setPhoto(photo);
return this; return this;
} }
/**
*
* @param userName
* @return Builder
*/
public MomentVOBuilder setUserName(String userName){ public MomentVOBuilder setUserName(String userName){
this.momentVO.setUserName(userName); this.momentVO.setUserName(userName);
return this; return this;
} }
/**
* ID
* @param id ID
* @return Builder
*/
public MomentVOBuilder setId(BigInteger id) { public MomentVOBuilder setId(BigInteger id) {
this.momentVO.setId(id); this.momentVO.setId(id);
return this; return this;
} }
/**
* ID
* @param userId ID
* @return Builder
*/
public MomentVOBuilder setUserId(BigInteger userId) { public MomentVOBuilder setUserId(BigInteger userId) {
this.momentVO.setOwnerId(userId); this.momentVO.setOwnerId(userId);
return this; return this;
} }
/**
*
* @param content
* @return Builder
*/
public MomentVOBuilder setContent(String content) { public MomentVOBuilder setContent(String content) {
this.momentVO.setContent(content); this.momentVO.setContent(content);
return this; return this;
} }
/**
*
* @param share
* @return Builder
*/
public MomentVOBuilder setShare(Long share) { public MomentVOBuilder setShare(Long share) {
this.momentVO.setShare(share); this.momentVO.setShare(share);
return this; return this;
} }
/**
*
* @param love
* @return Builder
*/
public MomentVOBuilder setLove(Long love) { public MomentVOBuilder setLove(Long love) {
this.momentVO.setLove(love); this.momentVO.setLove(love);
return this; return this;
} }
/**
*
* @param remark
* @return Builder
*/
public MomentVOBuilder setRemark(Long remark) { public MomentVOBuilder setRemark(Long remark) {
this.momentVO.setRemark(remark); this.momentVO.setRemark(remark);
return this; return this;
} }
/**
*
* @param view
* @return Builder
*/
public MomentVOBuilder setView(Long view) { public MomentVOBuilder setView(Long view) {
this.momentVO.setView(view); this.momentVO.setView(view);
return this; return this;
} }
/**
*
* @param collect
* @return Builder
*/
public MomentVOBuilder setCollect(Long collect) { public MomentVOBuilder setCollect(Long collect) {
this.momentVO.setCollect(collect); this.momentVO.setCollect(collect);
return this; return this;
} }
/**
*
* @param loved
* @return Builder
*/
public MomentVOBuilder setLoved(Boolean loved) { public MomentVOBuilder setLoved(Boolean loved) {
this.momentVO.setLoved(loved); this.momentVO.setLoved(loved);
return this; return this;
} }
/**
*
* @param shared
* @return Builder
*/
public MomentVOBuilder setShared(Boolean shared) { public MomentVOBuilder setShared(Boolean shared) {
this.momentVO.setShared(shared); this.momentVO.setShared(shared);
return this; return this;
} }
/**
*
* @param viewed
* @return Builder
*/
public MomentVOBuilder setViewed(Boolean viewed) { public MomentVOBuilder setViewed(Boolean viewed) {
this.momentVO.setViewed(viewed); this.momentVO.setViewed(viewed);
return this; return this;
} }
/**
*
* @param collected
* @return Builder
*/
public MomentVOBuilder setCollected(Boolean collected) { public MomentVOBuilder setCollected(Boolean collected) {
this.momentVO.setCollected(collected); this.momentVO.setCollected(collected);
return this; return this;
} }
} }

@ -1,73 +1,99 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.model.dto; package com.hyc.wechat.model.dto;
import com.hyc.wechat.service.constants.Status; import com.hyc.wechat.service.constants.Status;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat * @program wechat
* @description service * @description serviceDTO
* @date 2019-05-02 03:01
*/ */
public class ServiceResult { public class ServiceResult {
/** /**
* *
*/ */
private Status status; private Status status;
/** /**
* *
*/ */
private String message; private String message;
/** /**
* *
*/ */
private Object data; private Object data;
/**
* ServiceResult
*/
public ServiceResult() { public ServiceResult() {
} }
/**
* ServiceResult
*
* @param status
* @param message
* @param data
*/
public ServiceResult(Status status, String message, Object data) { public ServiceResult(Status status, String message, Object data) {
this.status = status; this.status = status;
this.message = message; this.message = message;
this.data = data; this.data = data;
} }
/**
*
*
* @return
*/
public Status getStatus() { public Status getStatus() {
return status; return status;
} }
/**
*
*
* @param status
*/
public void setStatus(Status status) { public void setStatus(Status status) {
this.status = status; this.status = status;
} }
/**
*
*
* @return
*/
public String getMessage() { public String getMessage() {
return message; return message;
} }
/**
*
*
* @param message
*/
public void setMessage(String message) { public void setMessage(String message) {
this.message = message; this.message = message;
} }
/**
*
*
* @return
*/
public Object getData() { public Object getData() {
return data; return data;
} }
/**
*
*
* @param data
*/
public void setData(Object data) { public void setData(Object data) {
this.data = data; this.data = data;
} }
} }

@ -1,19 +1,4 @@
/* //导入必要库
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.model.po; package com.hyc.wechat.model.po;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
@ -23,65 +8,135 @@ import com.hyc.wechat.model.po.abs.BaseEntity;
import java.math.BigInteger; import java.math.BigInteger;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a> * @description chat
* @description chat
* @date 2019-05-03 01:38
*/ */
@Table(name = "chat") @Table(name = "chat") // 指定该实体类对应的数据库表名为chat
public class Chat extends BaseEntity { public class Chat extends BaseEntity {
// 聊天室的编号
private String number; private String number;
@JSONField(name = "owner_id")
// 聊天室所有者的ID
@JSONField(name = "owner_id") // 指定在JSON序列化时的字段名为owner_id
private BigInteger ownerId; private BigInteger ownerId;
// 聊天室的类型(如群聊、私聊等)
private String type; private String type;
// 聊天室的名称
private String name; private String name;
// 聊天室的成员数量
private Integer member; private Integer member;
// 聊天室的封面照片URL
private String photo; private String photo;
/**
*
*
* @return
*/
public String getType() { public String getType() {
return type; return type;
} }
/**
*
*
* @param type
*/
public void setType(String type) { public void setType(String type) {
this.type = type; this.type = type;
} }
/**
*
*
* @return
*/
public String getNumber() { public String getNumber() {
return number; return number;
} }
/**
*
*
* @param number
*/
public void setNumber(String number) { public void setNumber(String number) {
this.number = number; this.number = number;
} }
/**
* URL
*
* @return URL
*/
public String getPhoto() { public String getPhoto() {
return photo; return photo;
} }
/**
* URL
*
* @param photo URL
*/
public void setPhoto(String photo) { public void setPhoto(String photo) {
this.photo = photo; this.photo = photo;
} }
/**
* ID
*
* @return ID
*/
public BigInteger getOwnerId() { public BigInteger getOwnerId() {
return ownerId; return ownerId;
} }
/**
* ID
*
* @param ownerId ID
*/
public void setOwnerId(BigInteger ownerId) { public void setOwnerId(BigInteger ownerId) {
this.ownerId = ownerId; this.ownerId = ownerId;
} }
/**
*
*
* @return
*/
public String getName() { public String getName() {
return name; return name;
} }
/**
*
*
* @param name
*/
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
/**
*
*
* @return
*/
public Integer getMember() { public Integer getMember() {
return member; return member;
} }
/**
*
*
* @param member
*/
public void setMember(Integer member) { public void setMember(Integer member) {
this.member = member; this.member = member;
} }
} }

@ -1,19 +1,4 @@
/* //导入必要库
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.model.po; package com.hyc.wechat.model.po;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
@ -23,77 +8,158 @@ import com.hyc.wechat.model.po.abs.BaseEntity;
import java.math.BigInteger; import java.math.BigInteger;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat * @program wechat
* @description * @description friend
* @date 2019-05-02 01:56
*/ */
@Table(name = "friend") @Table(name = "friend") // 指定该实体类对应的数据库表名为friend
public class Friend extends BaseEntity { public class Friend extends BaseEntity {
@JSONField(name = "user_id") // 用户ID表示朋友的用户标识
@JSONField(name = "user_id") // 指定在JSON序列化时的字段名为user_id
private BigInteger userId; private BigInteger userId;
@JSONField(name = "friend_id")
// 朋友ID表示朋友的用户标识
@JSONField(name = "friend_id") // 指定在JSON序列化时的字段名为friend_id
private BigInteger friendId; private BigInteger friendId;
@JSONField(name = "chat_id")
// 聊天室ID表示与朋友关联的聊天室标识
@JSONField(name = "chat_id") // 指定在JSON序列化时的字段名为chat_id
private BigInteger chatId; private BigInteger chatId;
// 朋友的头像照片URL
private String photo; private String photo;
@JSONField(name = "group_id")
// 分组ID表示朋友所属的分组标识
@JSONField(name = "group_id") // 指定在JSON序列化时的字段名为group_id
private BigInteger groupId; private BigInteger groupId;
// 朋友的别名,用于在好友列表中显示的名称
private String alias; private String alias;
// 朋友的描述信息
private String description; private String description;
/**
* ID
*
* @return ID
*/
public BigInteger getChatId() { public BigInteger getChatId() {
return chatId; return chatId;
} }
/**
* ID
*
* @param chatId ID
*/
public void setChatId(BigInteger chatId) { public void setChatId(BigInteger chatId) {
this.chatId = chatId; this.chatId = chatId;
} }
/**
* URL
*
* @return URL
*/
public String getPhoto() { public String getPhoto() {
return photo; return photo;
} }
/**
* URL
*
* @param photo URL
*/
public void setPhoto(String photo) { public void setPhoto(String photo) {
this.photo = photo; this.photo = photo;
} }
/**
* ID
*
* @return ID
*/
public BigInteger getUserId() { public BigInteger getUserId() {
return userId; return userId;
} }
/**
* ID
*
* @param userId ID
*/
public void setUserId(BigInteger userId) { public void setUserId(BigInteger userId) {
this.userId = userId; this.userId = userId;
} }
/**
* ID
*
* @return ID
*/
public BigInteger getFriendId() { public BigInteger getFriendId() {
return friendId; return friendId;
} }
/**
* ID
*
* @param friendId ID
*/
public void setFriendId(BigInteger friendId) { public void setFriendId(BigInteger friendId) {
this.friendId = friendId; this.friendId = friendId;
} }
/**
* ID
*
* @return ID
*/
public BigInteger getGroupId() { public BigInteger getGroupId() {
return groupId; return groupId;
} }
/**
* ID
*
* @param groupId ID
*/
public void setGroupId(BigInteger groupId) { public void setGroupId(BigInteger groupId) {
this.groupId = groupId; this.groupId = groupId;
} }
/**
*
*
* @return
*/
public String getAlias() { public String getAlias() {
return alias; return alias;
} }
/**
*
*
* @param alias
*/
public void setAlias(String alias) { public void setAlias(String alias) {
this.alias = alias; this.alias = alias;
} }
/**
*
*
* @return
*/
public String getDescription() { public String getDescription() {
return description; return description;
} }
/**
*
*
* @param description
*/
public void setDescription(String description) { public void setDescription(String description) {
this.description = description; this.description = description;
} }

@ -1,19 +1,4 @@
/* //导入必要库
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.model.po; package com.hyc.wechat.model.po;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
@ -23,66 +8,135 @@ import com.hyc.wechat.model.po.abs.BaseEntity;
import java.math.BigInteger; import java.math.BigInteger;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a> * @description member
* @description
* @date 2019-05-03 12:58
*/ */
@Table(name = "member") @Table(name = "member") // 指定该实体类对应的数据库表名为member
public class Member extends BaseEntity { public class Member extends BaseEntity {
@JSONField(name = "user_id") // 用户ID表示成员的用户标识
@JSONField(name = "user_id") // 指定在JSON序列化时的字段名为user_id
private BigInteger userId; private BigInteger userId;
@JSONField(name = "chat_id")
// 聊天室ID表示成员所属的群聊标识
@JSONField(name = "chat_id") // 指定在JSON序列化时的字段名为chat_id
private BigInteger chatId; private BigInteger chatId;
@JSONField(name = "group_alias")
// 群聊别名,表示成员在群聊中的别名
@JSONField(name = "group_alias") // 指定在JSON序列化时的字段名为group_alias
private String groupAlias; private String groupAlias;
// 申请状态,表示成员的申请状态(如:待审批、已通过等)
private String apply; private String apply;
// 背景图片,表示成员在群聊中的背景图片
private String background; private String background;
// 等级,表示成员在群聊中的等级或权限级别
private Integer level; private Integer level;
/**
*
*
* @return
*/
public String getApply() { public String getApply() {
return apply; return apply;
} }
/**
*
*
* @param apply
*/
public void setApply(String apply) { public void setApply(String apply) {
this.apply = apply; this.apply = apply;
} }
/**
*
*
* @return
*/
public Integer getLevel() { public Integer getLevel() {
return level; return level;
} }
/**
*
*
* @param level
*/
public void setLevel(Integer level) { public void setLevel(Integer level) {
this.level = level; this.level = level;
} }
/**
* ID
*
* @return ID
*/
public BigInteger getUserId() { public BigInteger getUserId() {
return userId; return userId;
} }
/**
* ID
*
* @param userId ID
*/
public void setUserId(BigInteger userId) { public void setUserId(BigInteger userId) {
this.userId = userId; this.userId = userId;
} }
/**
* ID
*
* @return ID
*/
public BigInteger getChatId() { public BigInteger getChatId() {
return chatId; return chatId;
} }
/**
* ID
*
* @param chatId ID
*/
public void setChatId(BigInteger chatId) { public void setChatId(BigInteger chatId) {
this.chatId = chatId; this.chatId = chatId;
} }
/**
*
*
* @return
*/
public String getGroupAlias() { public String getGroupAlias() {
return groupAlias; return groupAlias;
} }
/**
*
*
* @param groupAlias
*/
public void setGroupAlias(String groupAlias) { public void setGroupAlias(String groupAlias) {
this.groupAlias = groupAlias; this.groupAlias = groupAlias;
} }
/**
*
*
* @return
*/
public String getBackground() { public String getBackground() {
return background; return background;
} }
/**
*
*
* @param background
*/
public void setBackground(String background) { public void setBackground(String background) {
this.background = background; this.background = background;
} }

@ -1,18 +1,4 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.model.po; package com.hyc.wechat.model.po;

@ -1,18 +1,3 @@
/*
* Copyright (c) 2019.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hyc.wechat.model.po.abs; package com.hyc.wechat.model.po.abs;
@ -23,62 +8,111 @@ import java.math.BigInteger;
import java.util.Date; import java.util.Date;
/** /**
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @program wechat * @program wechat
* @description * @description
* @date 2019-05-01 23:19
*/ */
public abstract class BaseEntity { public abstract class BaseEntity {
/**
*
*/
@Field(name = "id") @Field(name = "id")
private BigInteger id; private BigInteger id;
/**
*
*/
@Field(name = "status") @Field(name = "status")
private Integer status; private Integer status;
/**
*
*/
@Field(name = "gmt_create") @Field(name = "gmt_create")
private Date gmtCreate; private Date gmtCreate;
/**
*
*/
@Field(name = "gmt_modified") @Field(name = "gmt_modified")
private Date gmtModified; private Date gmtModified;
/**
*
*
* @return
*/
public BigInteger getId() { public BigInteger getId() {
return id; return id;
} }
/**
*
*
* @param id
*/
public void setId(BigInteger id) { public void setId(BigInteger id) {
this.id = id; this.id = id;
} }
/**
*
*
* @return
*/
public Integer getStatus() { public Integer getStatus() {
return status; return status;
} }
/**
*
*
* @param status
*/
public void setStatus(Integer status) { public void setStatus(Integer status) {
this.status = status; this.status = status;
} }
/**
*
*
* @return
*/
public Date getGmtCreate() { public Date getGmtCreate() {
return gmtCreate; return gmtCreate;
} }
/**
*
*
* @param gmtCreate
*/
public void setGmtCreate(Date gmtCreate) { public void setGmtCreate(Date gmtCreate) {
this.gmtCreate = gmtCreate; this.gmtCreate = gmtCreate;
} }
/**
*
*
* @return
*/
public Date getGmtModified() { public Date getGmtModified() {
return gmtModified; return gmtModified;
} }
/**
*
*
* @param gmtModified
*/
public void setGmtModified(Date gmtModified) { public void setGmtModified(Date gmtModified) {
this.gmtModified = gmtModified; this.gmtModified = gmtModified;
} }
/** /**
* potoString使json * toString使JSON
* *
* @return * @return JSON
* @name toString
* @notice none
* @author <a href="mailto:kobe524348@gmail.com"></a>
* @date 2019/5/7
*/ */
@Override @Override
public String toString() { public String toString() {

@ -29,55 +29,55 @@
<validator> <validator>
<validator-class> <validator-class>
org.apache.taglibs.standard.tlv.JstlCoreTLV org.apache.taglibs.standard.tlv.JstlCoreTLV
</validator-class> </validator-class><!-- JDBC??????? -->
<description> <description>
Provides core validation features for JSTL tags. Provides core validation features for JSTL tags.
</description> </description><!-- ??JSTL????????? -->
</validator> </validator>
<tag> <tag>
<name>catch</name> <name>catch</name><!-- ??????????? -->
<tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class>
<body-content>JSP</body-content> <body-content>JSP</body-content>
<description> <description>
Catches any Throwable that occurs in its body and optionally Catches any Throwable that occurs in its body and optionally
exposes it. exposes it.
</description> </description><!-- ???????????? Throwable?????????? -->
<attribute> <attribute>
<name>var</name> <name>var</name> <!-- ????????????? -->
<required>false</required> <required>false</required> <!-- ???????? -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- ??????????? -->
</attribute> </attribute>
</tag> </tag>
<tag> <tag>
<name>choose</name> <name>choose</name><!-- ??????????? -->
<tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class>
<body-content>JSP</body-content> <body-content>JSP</body-content>
<description> <description>
Simple conditional tag that establishes a context for Simple conditional tag that establishes a context for
mutually exclusive conditional operations, marked by mutually exclusive conditional operations, marked by
&lt;when&gt; and &lt;otherwise&gt; &lt;when&gt; and &lt;otherwise&gt;<!-- ?????????????????????? &lt;when&gt; ? &lt;otherwise&gt; ?? -->
</description> </description>
</tag> </tag>
<tag> <tag>
<name>if</name> <name>if</name> <!-- ??????????? -->
<tag-class>org.apache.taglibs.standard.tag.rt.core.IfTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.rt.core.IfTag</tag-class>
<body-content>JSP</body-content> <body-content>JSP</body-content>
<description> <description>
Simple conditional tag, which evalutes its body if the Simple conditional tag, which evalutes its body if the
supplied condition is true and optionally exposes a Boolean supplied condition is true and optionally exposes a Boolean
scripting variable representing the evaluation of this condition scripting variable representing the evaluation of this condition
</description> </description><!-- ??????????????????????????????????????????????? -->
<attribute> <attribute>
<name>test</name> <name>test</name><!-- ????????? -->
<required>true</required> <required>true</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
<type>boolean</type> <type>boolean</type><!-- ??????? -->
</attribute> </attribute>
<attribute> <attribute>
<name>var</name> <name>var</name><!-- ???????????? -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
@ -89,7 +89,7 @@
</tag> </tag>
<tag> <tag>
<name>import</name> <name>import</name> <!-- ????????????? -->
<tag-class>org.apache.taglibs.standard.tag.rt.core.ImportTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.rt.core.ImportTag</tag-class>
<tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class> <tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class>
<body-content>JSP</body-content> <body-content>JSP</body-content>
@ -98,39 +98,39 @@
to either the maxPage, a String in 'var', or a Reader in 'varReader'. to either the maxPage, a String in 'var', or a Reader in 'varReader'.
</description> </description>
<attribute> <attribute>
<name>url</name> <name>url</name><!-- ???????URL -->
<required>true</required> <required>true</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>var</name> <name>var</name><!-- ???????????????? -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue><!-- ??????????? -->
</attribute> </attribute>
<attribute> <attribute>
<name>scope</name> <name>scope</name> <!-- ????????????? -->
<required>false</required> <required>false</required> <!-- ???????? -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- ??????????? -->
</attribute> </attribute>
<attribute> <attribute>
<name>varReader</name> <name>varReader</name><!-- ??????????????Reader?? -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>context</name> <name>context</name><!-- ???????????URL???? -->
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>charEncoding</name> <name>charEncoding</name><!-- ??????????? -->
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
</tag> </tag>
<tag> <tag>
<name>forEach</name> <name>forEach</name> <!-- ???????????? -->
<tag-class>org.apache.taglibs.standard.tag.rt.core.ForEachTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.rt.core.ForEachTag</tag-class>
<tei-class>org.apache.taglibs.standard.tei.ForEachTEI</tei-class> <tei-class>org.apache.taglibs.standard.tei.ForEachTEI</tei-class>
<body-content>JSP</body-content> <body-content>JSP</body-content>
@ -138,21 +138,21 @@
The basic iteration tag, accepting many different The basic iteration tag, accepting many different
collection types and supporting subsetting and other collection types and supporting subsetting and other
functionality functionality
</description> </description><!-- ????????????????????????????? -->
<attribute> <attribute>
<name>items</name> <name>items</name><!-- ??????????? -->
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type> <type>java.lang.Object</type><!-- ????????Java?? -->
</attribute> </attribute>
<attribute> <attribute>
<name>begin</name> <name>begin</name> <!-- ?????????????0???? -->
<required>false</required> <required>false</required> <!-- ???????? -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue> <!-- ?????????? -->
<type>int</type> <type>int</type> <!-- ???????? -->
</attribute> </attribute>
<attribute> <attribute>
<name>end</name> <name>end</name><!-- ?????????????????? -->
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
<type>int</type> <type>int</type>
@ -164,7 +164,7 @@
<type>int</type> <type>int</type>
</attribute> </attribute>
<attribute> <attribute>
<name>var</name> <name>var</name><!-- ????????????????? -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
@ -176,7 +176,7 @@
</tag> </tag>
<tag> <tag>
<name>forTokens</name> <name>forTokens</name> <!-- ??????????????? -->
<tag-class>org.apache.taglibs.standard.tag.rt.core.ForTokensTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.rt.core.ForTokensTag</tag-class>
<body-content>JSP</body-content> <body-content>JSP</body-content>
<description> <description>
@ -213,12 +213,12 @@
<type>int</type> <type>int</type>
</attribute> </attribute>
<attribute> <attribute>
<name>var</name> <name>var</name> <!-- ???????????token????? -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>varStatus</name> <name>varStatus</name> <!-- ???????????token????? -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>

@ -19,7 +19,7 @@
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
<taglib> <taglib>
<tlib-version>1.0</tlib-version> <tlib-version>1.0</tlib-version><!--o-->
<jsp-version>1.2</jsp-version> <jsp-version>1.2</jsp-version>
<short-name>c</short-name> <short-name>c</short-name>
<uri>http://java.sun.com/jstl/core</uri> <uri>http://java.sun.com/jstl/core</uri>
@ -33,32 +33,32 @@
<init-param> <init-param>
<param-name>expressionAttributes</param-name> <param-name>expressionAttributes</param-name>
<param-value> <param-value>
out:value out:value<!-- ?????? -->
out:default out:default<!-- ???????? -->
out:escapeXml out:escapeXml <!-- ?????XML?? -->
if:test if:test <!-- if??????? -->
import:url import:url <!-- import???URL -->
import:context import:context <!-- import?????? -->
import:charEncoding import:charEncoding <!-- import??????? -->
forEach:items forEach:items <!-- forEach????? -->
forEach:begin forEach:begin <!-- forEach??????? -->
forEach:end forEach:end <!-- forEach??????? -->
forEach:step forEach:step <!-- forEach????? -->
forTokens:items forTokens:items <!-- forTokens????? -->
forTokens:begin forTokens:begin <!-- forTokens??????? -->
forTokens:end forTokens:end <!-- forTokens??????? -->
forTokens:step forTokens:step <!-- forTokens????? -->
param:encode param:encode <!-- param????? -->
param:name param:name <!-- param????? -->
param:value param:value <!-- param???? -->
redirect:context redirect:context<!-- redirect?????? -->
redirect:url redirect:url<!-- redirect???URL -->
set:property set:property <!-- set????? -->
set:target set:target <!-- set??????? -->
set:value set:value <!-- set???? -->
url:context url:context <!-- url?????? -->
url:value url:value <!-- url???? -->
when:test when:test <!-- when??????? -->
</param-value> </param-value>
<description> <description>
Whitespace-separated list of colon-separated token pairs Whitespace-separated list of colon-separated token pairs
@ -78,9 +78,9 @@
exposes it. exposes it.
</description> </description>
<attribute> <attribute>
<name>var</name> <name>var</name> <!-- ????????? -->
<required>false</required> <required>false</required> <!-- ???????? -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- ??????????? -->
</attribute> </attribute>
</tag> </tag>
@ -103,24 +103,24 @@
Like &lt;%= ... &gt;, but for expressions. Like &lt;%= ... &gt;, but for expressions.
</description> </description>
<attribute> <attribute>
<name>value</name> <name>value</name> <!-- ??????? -->
<required>true</required> <required>true</required> <!-- ??????? -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- ??????????? -->
</attribute> </attribute>
<attribute> <attribute>
<name>default</name> <name>default</name> <!-- ??? -->
<required>false</required> <required>false</required> <!-- ???????? -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- ??????????? -->
</attribute> </attribute>
<attribute> <attribute>
<name>escapeXml</name> <name>escapeXml</name> <!-- ??????XML???? -->
<required>false</required> <required>false</required> <!-- ???????? -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- ??????????? -->
</attribute> </attribute>
</tag> </tag>
<tag> <tag>
<name>if</name> <name>if</name><!-- ?????? -->
<tag-class>org.apache.taglibs.standard.tag.el.core.IfTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.el.core.IfTag</tag-class>
<body-content>JSP</body-content> <body-content>JSP</body-content>
<description> <description>
@ -129,9 +129,9 @@
scripting variable representing the evaluation of this condition scripting variable representing the evaluation of this condition
</description> </description>
<attribute> <attribute>
<name>test</name> <name>test</name> <!-- ?????? -->
<required>true</required> <required>true</required> <!-- ??????? -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- ??????????? -->
</attribute> </attribute>
<attribute> <attribute>
<name>var</name> <name>var</name>
@ -139,14 +139,14 @@
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>scope</name> <name>scope</name> <!-- ????????????? -->
<required>false</required> <required>false</required> <!-- ???????? -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- ??????????? -->
</attribute> </attribute>
</tag> </tag>
<tag> <tag>
<name>import</name> <name>import</name> <!-- ????????????? -->
<tag-class>org.apache.taglibs.standard.tag.el.core.ImportTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.el.core.ImportTag</tag-class>
<tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class> <tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class>
<body-content>JSP</body-content> <body-content>JSP</body-content>
@ -155,39 +155,39 @@
to either the maxPage, a String in 'var', or a Reader in 'varReader'. to either the maxPage, a String in 'var', or a Reader in 'varReader'.
</description> </description>
<attribute> <attribute>
<name>url</name> <name>url</name> <!-- ????URL -->
<required>true</required> <required>true</required> <!-- ??????? -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- ??????????? -->
</attribute> </attribute>
<attribute> <attribute>
<name>var</name> <name>var</name> <!-- ???????????????? -->
<required>false</required> <required>false</required> <!-- ???????? -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- ??????????? -->
</attribute> </attribute>
<attribute> <attribute>
<name>scope</name> <name>scope</name> <!-- ??????????? -->
<required>false</required> <required>false</required> <!-- ???????? -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- ??????????? -->
</attribute> </attribute>
<attribute> <attribute>
<name>varReader</name> <name>varReader</name> <!-- ???????Reader??????? -->
<required>false</required> <required>false</required> <!-- ???????? -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- ??????????? -->
</attribute> </attribute>
<attribute> <attribute>
<name>context</name> <name>context</name> <!-- ?????????URL???? -->
<required>false</required> <required>false</required> <!-- ???????? -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- ??????????? -->
</attribute> </attribute>
<attribute> <attribute>
<name>charEncoding</name> <name>charEncoding</name> <!-- ??????????? -->
<required>false</required> <required>false</required> <!-- ???????? -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- ??????????? -->
</attribute> </attribute>
</tag> </tag>
<tag> <tag>
<name>forEach</name> <name>forEach</name> <!-- ???? -->
<tag-class>org.apache.taglibs.standard.tag.el.core.ForEachTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.el.core.ForEachTag</tag-class>
<tei-class>org.apache.taglibs.standard.tei.ForEachTEI</tei-class> <tei-class>org.apache.taglibs.standard.tei.ForEachTEI</tei-class>
<body-content>JSP</body-content> <body-content>JSP</body-content>
@ -197,61 +197,61 @@
functionality functionality
</description> </description>
<attribute> <attribute>
<name>items</name> <name>items</name><!-- ?????? -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>begin</name> <name>begin</name><!-- ??????? -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>end</name> <name>end</name><!-- ??????? -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>step</name> <name>step</name><!-- ????? -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>var</name> <name>var</name><!-- ?????????? -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>varStatus</name> <name>varStatus</name> <!-- ???????????????? -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
</tag> </tag>
<tag> <tag>
<name>forTokens</name> <name>forTokens</name> <!-- ???????token???? -->
<tag-class>org.apache.taglibs.standard.tag.el.core.ForTokensTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.el.core.ForTokensTag</tag-class>
<body-content>JSP</body-content> <body-content>JSP</body-content>
<description> <description>
Iterates over tokens, separated by the supplied delimeters Iterates over tokens, separated by the supplied delimeters
</description> </description>
<attribute> <attribute>
<name>items</name> <name>items</name> <!-- ??????? -->
<required>true</required> <required>true</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>delims</name> <name>delims</name> <!-- ??? -->
<required>true</required> <required>true</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>begin</name> <name>begin</name> <!-- ??????? -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>end</name> <name>end</name> <!-- ??????? -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
@ -303,55 +303,55 @@
</tag> </tag>
<tag> <tag>
<name>redirect</name> <name>redirect</name><!-- ????? -->
<tag-class>org.apache.taglibs.standard.tag.el.core.RedirectTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.el.core.RedirectTag</tag-class>
<body-content>JSP</body-content> <body-content>JSP</body-content>
<description> <description>
Redirects to a new URL. Redirects to a new URL.
</description> </description>
<attribute> <attribute>
<name>var</name> <name>var</name><!-- ????????????????? -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>scope</name> <name>scope</name> <!-- ??????????? -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>url</name> <name>url</name> <!-- ?????????URL -->
<required>true</required> <required>true</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>context</name> <name>context</name><!-- ?????????URL???? -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
</tag> </tag>
<tag> <tag>
<name>remove</name> <name>remove</name><!-- ?????????????????? -->
<tag-class>org.apache.taglibs.standard.tag.common.core.RemoveTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.common.core.RemoveTag</tag-class>
<body-content>empty</body-content> <body-content>empty</body-content>
<description> <description>
Removes a scoped variable (from a particular scope, if specified). Removes a scoped variable (from a particular scope, if specified).
</description> </description>
<attribute> <attribute>
<name>var</name> <name>var</name><!-- ??????????? -->
<required>true</required> <required>true</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>scope</name> <name>scope</name> <!-- ????????????? -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
</tag> </tag>
<tag> <tag>
<name>set</name> <name>set</name> <!-- ????????????scope????? -->
<tag-class>org.apache.taglibs.standard.tag.el.core.SetTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.el.core.SetTag</tag-class>
<body-content>JSP</body-content> <body-content>JSP</body-content>
<description> <description>
@ -385,7 +385,7 @@
</tag> </tag>
<tag> <tag>
<name>url</name> <name>url</name><!-- ??URL??? -->
<tag-class>org.apache.taglibs.standard.tag.el.core.UrlTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.el.core.UrlTag</tag-class>
<body-content>JSP</body-content> <body-content>JSP</body-content>
<description> <description>
@ -393,17 +393,17 @@
(via the c:param tag). (via the c:param tag).
</description> </description>
<attribute> <attribute>
<name>var</name> <name>var</name> <!-- ??????????URL????? -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>scope</name> <name>scope</name> <!-- ?????URL?????? -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>value</name> <name>value</name> <!-- ???????URL -->
<required>true</required> <required>true</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
@ -415,7 +415,7 @@
</tag> </tag>
<tag> <tag>
<name>when</name> <name>when</name><!-- ????????????? -->
<tag-class>org.apache.taglibs.standard.tag.el.core.WhenTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.el.core.WhenTag</tag-class>
<body-content>JSP</body-content> <body-content>JSP</body-content>
<description> <description>
@ -423,9 +423,9 @@
condition evalutes to 'true' condition evalutes to 'true'
</description> </description>
<attribute> <attribute>
<name>test</name> <name>test</name> <!-- ????????? -->
<required>true</required> <required>true</required> <!-- ??????? -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- ??????????? -->
</attribute> </attribute>
</tag> </tag>

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!-- <!--
~ Copyright (c) 2019. 黄钰朝 ~ Copyright (c) 2019. 黄钰朝
~ ~
@ -21,11 +22,23 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
version="2.0"> version="2.0">
<description>JSTL 1.1 core library</description> <description>JSTL 1.1 core library</description><!-- 说明这是JSTL 1.1版本的核心库 -->
<display-name>JSTL core</display-name> <display-name>JSTL core</display-name><!-- 在显示中用作JSTL核心的名称 -->
<tlib-version>1.1</tlib-version> <tlib-version>1.1</tlib-version><!-- 标签库版本 -->
<short-name>c</short-name> <short-name>c</short-name><!-- 标签库的简短名称 -->
<uri>http://java.sun.com/jsp/jstl/core</uri> <uri>http://java.sun.com/jsp/jstl/core</uri><!-- 标签库的URI用于JSP中引用 -->
<validator> <validator>
<description> <description>
@ -33,7 +46,7 @@
</description> </description>
<validator-class> <validator-class>
org.apache.taglibs.standard.tlv.JstlCoreTLV org.apache.taglibs.standard.tlv.JstlCoreTLV
</validator-class> </validator-class><!-- 验证器类名称 -->
</validator> </validator>
<tag> <tag>
@ -41,30 +54,42 @@
Catches any Throwable that occurs in its body and optionally Catches any Throwable that occurs in its body and optionally
exposes it. exposes it.
</description> </description>
<name>catch</name> <name>catch</name><!-- 标签名称 -->
<tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class>
<body-content>JSP</body-content> <body-content>JSP</body-content> <!-- 标签主体内容类型 -->
<attribute> <attribute>
<description> <description>
Name of the exported scoped variable for the Name of the exported scoped variable for the
exception thrown from a nested action. The type of the exception thrown from a nested action. The type of the
scoped variable is the type of the exception thrown. scoped variable is the type of the exception thrown.
</description> </description>
<name>var</name> <name>var</name><!-- 属性名称 -->
<required>false</required> <required>false</required><!-- 是否为必需属性 -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue><!-- 是否允许运行时表达式 -->
</attribute> </attribute>
</tag> </tag>
<tag> <tag>
<description> <description>
Simple conditional tag that establishes a context for Simple conditional tag that establishes a context for
mutually exclusive conditional operations, marked by mutually exclusive conditional operations, marked by
&lt;when&gt; and &lt;otherwise&gt; &lt;when&gt; and &lt;otherwise&gt;
</description> </description>
<name>choose</name> <name>choose</name><!-- 标签名称 -->
<tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class><!-- 标签类名 -->
<body-content>JSP</body-content> <body-content>JSP</body-content><!-- 标签主体内容类型 -->
</tag> </tag>
<tag> <tag>
@ -73,18 +98,31 @@ scoped variable is the type of the exception thrown.
supplied condition is true and optionally exposes a Boolean supplied condition is true and optionally exposes a Boolean
scripting variable representing the evaluation of this condition scripting variable representing the evaluation of this condition
</description> </description>
<name>if</name> <name>if</name><!-- 标签名称 -->
<tag-class>org.apache.taglibs.standard.tag.rt.core.IfTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.rt.core.IfTag</tag-class><!-- 标签类名 -->
<body-content>JSP</body-content> <body-content>JSP</body-content><!-- 标签主体内容类型 -->
<attribute> <attribute>
<description> <description>
The test condition that determines whether or The test condition that determines whether or
not the body content should be processed. not the body content should be processed.
</description> </description>
<name>test</name> <name>test</name><!-- 属性名称 -->
<required>true</required> <required>true</required><!-- 必需属性 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue><!-- 允许运行时表达式 -->
<type>boolean</type> <type>boolean</type> <!-- 属性类型 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
@ -92,17 +130,17 @@ Name of the exported scoped variable for the
resulting value of the test condition. The type resulting value of the test condition. The type
of the scoped variable is Boolean. of the scoped variable is Boolean.
</description> </description>
<name>var</name> <name>var</name><!-- 属性名称 -->
<required>false</required> <required>false</required><!-- 是否为必需属性 -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue><!-- 是否允许运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Scope for var. Scope for var.
</description> </description>
<name>scope</name> <name>scope</name><!-- 属性名称 -->
<required>false</required> <required>false</required><!-- 是否为必需属性 -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- 是否允许运行时表达式 -->
</attribute> </attribute>
</tag> </tag>
@ -111,9 +149,9 @@ Scope for var.
Retrieves an absolute or relative URL and exposes its contents Retrieves an absolute or relative URL and exposes its contents
to either the maxPage, a String in 'var', or a Reader in 'varReader'. to either the maxPage, a String in 'var', or a Reader in 'varReader'.
</description> </description>
<name>import</name> <name>import</name><!-- 标签名称 -->
<tag-class>org.apache.taglibs.standard.tag.rt.core.ImportTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.rt.core.ImportTag</tag-class>
<tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class> <tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class><!-- TEI类 -->
<body-content>JSP</body-content> <body-content>JSP</body-content>
<attribute> <attribute>
<description> <description>
@ -121,7 +159,7 @@ The URL of the resource to import.
</description> </description>
<name>url</name> <name>url</name>
<required>true</required> <required>true</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue><!-- 允许运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
@ -172,6 +210,19 @@ resource.
</attribute> </attribute>
</tag> </tag>
<tag> <tag>
<description> <description>
The basic iteration tag, accepting many different The basic iteration tag, accepting many different
@ -258,35 +309,61 @@ visibility.
<description> <description>
Iterates over tokens, separated by the supplied delimeters Iterates over tokens, separated by the supplied delimeters
</description> </description>
<name>forTokens</name> <name>forTokens</name><!-- 标签名称 -->
<tag-class>org.apache.taglibs.standard.tag.rt.core.ForTokensTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.rt.core.ForTokensTag</tag-class>
<body-content>JSP</body-content> <body-content>JSP</body-content><!-- 标签的主体内容类型 -->
<attribute> <attribute>
<description> <description>
String of tokens to iterate over. String of tokens to iterate over.
</description> </description>
<name>items</name> <name>items</name><!-- 要迭代的令牌字符串 -->
<required>true</required> <required>true</required><!-- 此属性是必须的 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue><!-- 允许使用运行时表达式 -->
<type>java.lang.String</type> <type>java.lang.String</type> <!-- 属性类型 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
The set of delimiters (the characters that The set of delimiters (the characters that
separate the tokens in the string). separate the tokens in the string).
</description> </description>
<name>delims</name> <name>delims</name><!-- 分隔符字符串 -->
<required>true</required> <required>true</required><!-- 此属性是必须的 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue><!-- 允许使用运行时表达式 -->
<type>java.lang.String</type> <type>java.lang.String</type><!-- 属性类型 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Iteration begins at the token located at the Iteration begins at the token located at the
specified index. First token has index 0. specified index. First token has index 0.
</description> </description>
<name>begin</name> <name>begin</name><!-- 起始索引 -->
<required>false</required> <required>false</required><!-- 此属性不是必须的 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
<type>int</type> <type>int</type>
</attribute> </attribute>
@ -295,8 +372,21 @@ specified index. First token has index 0.
Iteration ends at the token located at the Iteration ends at the token located at the
specified index (inclusive). specified index (inclusive).
</description> </description>
<name>end</name> <name>end</name><!-- 结束索引 -->
<required>false</required>
<required>false</required><!-- 此属性不是必须的 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
<type>int</type> <type>int</type>
</attribute> </attribute>
@ -305,10 +395,10 @@ specified index (inclusive).
Iteration will only process every step tokens Iteration will only process every step tokens
of the string, starting with the first one. of the string, starting with the first one.
</description> </description>
<name>step</name> <name>step</name> <!-- 步长 -->
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
<type>int</type> <type>int</type><!-- 属性类型 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
@ -316,9 +406,9 @@ Name of the exported scoped variable for the
current item of the iteration. This scoped current item of the iteration. This scoped
variable has nested visibility. variable has nested visibility.
</description> </description>
<name>var</name> <name>var</name><!-- 当前项的作用域变量名称 -->
<required>false</required> <required>false</required> <!-- 此属性不是必须的 -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue><!-- 不允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
@ -329,9 +419,9 @@ javax.servlet.jsp.jstl.core.LoopTag
Status. This scoped variable has nested Status. This scoped variable has nested
visibility. visibility.
</description> </description>
<name>varStatus</name> <name>varStatus</name><!-- 迭代状态的作用域变量名称 -->
<required>false</required> <required>false</required><!-- 此属性不是必须的 -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue><!-- 不允许使用运行时表达式 -->
</attribute> </attribute>
</tag> </tag>
@ -340,7 +430,7 @@ visibility.
Like &lt;%= ... &gt;, but for expressions. Like &lt;%= ... &gt;, but for expressions.
</description> </description>
<name>out</name> <name>out</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.OutTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.rt.core.OutTag</tag-class><!-- 标签实现类 -->
<body-content>JSP</body-content> <body-content>JSP</body-content>
<attribute> <attribute>
<description> <description>
@ -387,14 +477,14 @@ true.
<description> <description>
Adds a parameter to a containing 'import' tag's URL. Adds a parameter to a containing 'import' tag's URL.
</description> </description>
<name>param</name> <name>param</name> <!-- 标签名称 -->
<tag-class>org.apache.taglibs.standard.tag.rt.core.ParamTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.rt.core.ParamTag</tag-class>
<body-content>JSP</body-content> <body-content>JSP</body-content><!-- 标签主体内容类型 -->
<attribute> <attribute>
<description> <description>
Name of the query string parameter. Name of the query string parameter.
</description> </description>
<name>name</name> <name>name</name><!-- 查询参数名称 -->
<required>true</required> <required>true</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
@ -402,7 +492,7 @@ Name of the query string parameter.
<description> <description>
Value of the parameter. Value of the parameter.
</description> </description>
<name>value</name> <name>value</name><!-- 查询参数的值 -->
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
@ -419,7 +509,7 @@ Value of the parameter.
<description> <description>
The URL of the resource to redirect to. The URL of the resource to redirect to.
</description> </description>
<name>url</name> <name>url</name><!-- 重定向的目标URL -->
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
@ -428,7 +518,7 @@ The URL of the resource to redirect to.
Name of the context when redirecting to a relative URL Name of the context when redirecting to a relative URL
resource that belongs to a foreign context. resource that belongs to a foreign context.
</description> </description>
<name>context</name> <name>context</name><!-- 上下文名称 -->
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
@ -440,21 +530,21 @@ resource that belongs to a foreign context.
</description> </description>
<name>remove</name> <name>remove</name>
<tag-class>org.apache.taglibs.standard.tag.common.core.RemoveTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.common.core.RemoveTag</tag-class>
<body-content>empty</body-content> <body-content>empty</body-content><!-- 标签主体内容类型为空 -->
<attribute> <attribute>
<description> <description>
Name of the scoped variable to be removed. Name of the scoped variable to be removed.
</description> </description>
<name>var</name> <name>var</name><!-- 要移除的作用域变量名 -->
<required>true</required> <required>true</required><!-- 此属性是必须的 -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Scope for var. Scope for var.
</description> </description>
<name>scope</name> <name>scope</name><!-- 作用域名 -->
<required>false</required> <required>false</required><!-- 此属性不是必须的 -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
</tag> </tag>
@ -480,9 +570,9 @@ whatever type the value expression evaluates to.
<description> <description>
Expression to be evaluated. Expression to be evaluated.
</description> </description>
<name>value</name> <name>value</name> <!-- 要评估的表达式 -->
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue><!-- 允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
@ -490,7 +580,7 @@ Target object whose property will be set. Must evaluate to
a JavaBeans object with setter property property, or to a a JavaBeans object with setter property property, or to a
java.util.Map object. java.util.Map object.
</description> </description>
<name>target</name> <name>target</name><!-- 目标对象 -->
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
@ -498,7 +588,7 @@ java.util.Map object.
<description> <description>
Name of the property to be set in the target object. Name of the property to be set in the target object.
</description> </description>
<name>property</name> <name>property</name><!-- 要设置的目标对象的属性名称 -->
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
@ -506,7 +596,7 @@ Name of the property to be set in the target object.
<description> <description>
Scope for var. Scope for var.
</description> </description>
<name>scope</name> <name>scope</name> <!-- 作用域 -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
@ -525,7 +615,7 @@ Name of the exported scoped variable for the
processed url. The type of the scoped variable is processed url. The type of the scoped variable is
String. String.
</description> </description>
<name>var</name> <name>var</name><!-- 处理后的URL作用域变量名称 -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
@ -533,7 +623,7 @@ String.
<description> <description>
Scope for var. Scope for var.
</description> </description>
<name>scope</name> <name>scope</name><!-- 作用域 -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
@ -541,7 +631,7 @@ Scope for var.
<description> <description>
URL to be processed. URL to be processed.
</description> </description>
<name>value</name> <name>value</name><!-- 要处理的URL -->
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
@ -550,7 +640,7 @@ URL to be processed.
Name of the context when specifying a relative URL Name of the context when specifying a relative URL
resource that belongs to a foreign context. resource that belongs to a foreign context.
</description> </description>
<name>context</name> <name>context</name><!-- 上下文名称 -->
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1" ?> <?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- <!--
~ Copyright (c) 2019. ??? ~ Copyright (c) 2019. ???
@ -417,3 +418,181 @@
</tag> </tag>
</taglib> </taglib>

@ -20,6 +20,7 @@
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
<taglib> <taglib>
<tlib-version>1.0</tlib-version> <tlib-version>1.0</tlib-version>
<!-- ??????-->
<jsp-version>1.2</jsp-version> <jsp-version>1.2</jsp-version>
<short-name>fmt</short-name> <short-name>fmt</short-name>
<uri>http://java.sun.com/jstl/fmt</uri> <uri>http://java.sun.com/jstl/fmt</uri>
@ -27,6 +28,7 @@
<description>JSTL 1.0 i18n-capable formatting library</description> <description>JSTL 1.0 i18n-capable formatting library</description>
<validator> <validator>
<validator-class> <validator-class>
org.apache.taglibs.standard.tlv.JstlFmtTLV org.apache.taglibs.standard.tlv.JstlFmtTLV
</validator-class> </validator-class>

@ -21,148 +21,156 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
version="2.0"> version="2.0">
<description>JSTL 1.1 i18n-capable formatting library</description> <description>JSTL 1.1 i18n-capable formatting library</description> <!-- 描述JSTL 1.1 国际化支持的格式化库 -->
<display-name>JSTL fmt</display-name> <display-name>JSTL fmt</display-name> <!-- 标签库的显示名称 -->
<tlib-version>1.1</tlib-version> <tlib-version>1.1</tlib-version> <!-- 标签库的版本 -->
<short-name>fmt</short-name> <short-name>fmt</short-name> <!-- 标签库的简短名称 -->
<uri>http://java.sun.com/jsp/jstl/fmt</uri> <uri>http://java.sun.com/jsp/jstl/fmt</uri> <!-- 标签库的URI -->
<validator> <validator>
<description> <description>
Provides core validation features for JSTL tags. Provides core validation features for JSTL tags. <!-- 描述提供JSTL标签的核心验证功能 -->
</description> </description>
<validator-class> <validator-class>
org.apache.taglibs.standard.tlv.JstlFmtTLV org.apache.taglibs.standard.tlv.JstlFmtTLV
</validator-class> </validator-class><!-- 验证器类 -->
</validator> </validator>
<tag> <tag>
<description> <description>
Sets the request character encoding Sets the request character encoding <!-- 描述:设置请求的字符编码 -->
</description> </description>
<name>requestEncoding</name> <name>requestEncoding</name> <!-- 标签名称 -->
<tag-class>org.apache.taglibs.standard.tag.rt.fmt.RequestEncodingTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.rt.fmt.RequestEncodingTag</tag-class> <!-- 标签实现类 -->
<body-content>empty</body-content> <body-content>empty</body-content> <!-- 标签主体内容为空 -->
<attribute> <attribute>
<description> <description>
Name of character encoding to be applied when Name of character encoding to be applied when decoding request parameters. <!-- 描述:在解码请求参数时应用的字符编码名称 -->
decoding request parameters.
</description> </description>
<name>value</name> <name>value</name> <!-- 属性名称 -->
<required>false</required> <required>false</required> <!-- 此属性不是必须的 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue> <!-- 允许使用运行时表达式 -->
</attribute> </attribute>
</tag> </tag>
<tag> <tag>
<description> <description>
Stores the given locale in the locale configuration variable Stores the given locale in the locale configuration variable <!-- 描述:将给定的区域设置存储在区域配置变量中 -->
</description> </description>
<name>setLocale</name> <name>setLocale</name> <!-- 标签名称 -->
<tag-class>org.apache.taglibs.standard.tag.rt.fmt.SetLocaleTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.rt.fmt.SetLocaleTag</tag-class> <!-- 标签实现类 -->
<body-content>empty</body-content> <body-content>empty</body-content> <!-- 标签主体内容为空 -->
<attribute> <attribute>
<description> <description>
A String value is interpreted as the A String value is interpreted as the printable representation of a locale, which must contain a two-letter (lower-case) language code (as defined by ISO-639), and may contain a two-letter (upper-case) country code (as defined by ISO-3166). Language and country codes must be separated by hyphen (-) or underscore (_). <!-- 描述字符串值被解释为区域的可打印表示必须包含一个两位小写语言代码根据ISO-639定义并且可以包含一个两位大写国家代码根据ISO-3166定义。语言和国家代码必须用连字符-或下划线_分隔。 -->
printable representation of a locale, which
must contain a two-letter (lower-case)
language code (as defined by ISO-639),
and may contain a two-letter (upper-case)
country code (as defined by ISO-3166).
Language and country codes must be
separated by hyphen (-) or underscore
(_).
</description> </description>
<name>value</name> <name>value</name> <!-- 属性名称 -->
<required>true</required> <required>true</required> <!-- 此属性是必须的 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue> <!-- 允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Vendor- or browser-specific variant. Vendor- or browser-specific variant. See the java.util.Locale javadocs for more information on variants. <!-- 描述供应商或浏览器特定的变体。有关变体的更多信息请参见java.util.Locale的Javadoc。 -->
See the java.util.Locale javadocs for
more information on variants.
</description> </description>
<name>variant</name> <name>variant</name> <!-- 属性名称 -->
<required>false</required> <required>false</required> <!-- 此属性不是必须的 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue> <!-- 允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Scope of the locale configuration variable. Scope of the locale configuration variable. <!-- 描述:区域配置变量的作用域 -->
</description> </description>
<name>scope</name> <name>scope</name> <!-- 属性名称 -->
<required>false</required> <required>false</required> <!-- 此属性不是必须的 -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- 不允许使用运行时表达式 -->
</attribute> </attribute>
</tag> </tag>
<tag> <tag>
<description> <description>
Specifies the time zone for any time formatting or parsing actions Specifies the time zone for any time formatting or parsing actions nested in its body <!-- 描述:指定其主体中嵌套的任何时间格式化或解析操作的时区 -->
nested in its body
</description> </description>
<name>timeZone</name> <name>timeZone</name> <!-- 标签名称 -->
<tag-class>org.apache.taglibs.standard.tag.rt.fmt.TimeZoneTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.rt.fmt.TimeZoneTag</tag-class> <!-- 标签实现类 -->
<body-content>JSP</body-content> <body-content>JSP</body-content> <!-- 标签主体内容为JSP -->
<attribute> <attribute>
<description> <description>
The time zone. A String value is interpreted as The time zone. A String value is interpreted as a time zone ID. This may be one of the time zone IDs supported by the Java platform (such as "America/Los_Angeles") or a custom time zone ID (such as "GMT-8"). See java.util.TimeZone for more information on supported time zone formats. <!-- 描述时区。字符串值被解释为时区ID。这可以是Java平台支持的时区ID之一如“America/Los_Angeles”或自定义时区ID如“GMT-8”。有关支持的时区格式的更多信息请参见java.util.TimeZone。 -->
a time zone ID. This may be one of the time zone
IDs supported by the Java platform (such as
"America/Los_Angeles") or a custom time zone
ID (such as "GMT-8"). See
java.util.TimeZone for more information on
supported time zone formats.
</description> </description>
<name>value</name> <name>value</name> <!-- 属性名称 -->
<required>true</required> <required>true</required> <!-- 此属性是必须的 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue> <!-- 允许使用运行时表达式 -->
</attribute> </attribute>
</tag> </tag>
<tag> <tag>
<description> <description>
Stores the given time zone in the time zone configuration variable Stores the given time zone in the time zone configuration variable <!-- 描述:将给定的时区存储在时区配置变量中 -->
</description> </description>
<name>setTimeZone</name> <name>setTimeZone</name> <!-- 标签名称 -->
<tag-class>org.apache.taglibs.standard.tag.rt.fmt.SetTimeZoneTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.rt.fmt.SetTimeZoneTag</tag-class> <!-- 标签实现类 -->
<body-content>empty</body-content> <body-content>empty</body-content> <!-- 标签主体内容为空 -->
<attribute> <attribute>
<description> <description>
The time zone. A String value is interpreted as The time zone. A String value is interpreted as a time zone ID. This may be one of the time zone IDs supported by the Java platform (such as "America/Los_Angeles") or a custom time zone ID (such as "GMT-8"). See java.util.TimeZone for more information on supported time zone formats. <!-- 描述时区。字符串值被解释为时区ID。这可以是Java平台支持的时区ID之一如“America/Los_Angeles”或自定义时区ID如“GMT-8”。有关支持的时区格式的更多信息请参见java.util.TimeZone。 -->
a time zone ID. This may be one of the time zone
IDs supported by the Java platform (such as
"America/Los_Angeles") or a custom time zone
ID (such as "GMT-8"). See java.util.TimeZone for
more information on supported time zone
formats.
</description> </description>
<name>value</name> <name>value</name> <!-- 属性名称 -->
<required>true</required> <required>true</required> <!-- 此属性是必须的 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue> <!-- 允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Name of the exported scoped variable which Name of the exported scoped variable which stores the time zone of type java.util.TimeZone. <!-- 描述存储java.util.TimeZone类型的时区的导出作用域变量的名称。 -->
stores the time zone of type
java.util.TimeZone.
</description> </description>
<name>var</name> <name>var</name> <!-- 属性名称 -->
<required>false</required> <required>false</required> <!-- 此属性不是必须的 -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- 不允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Scope of var or the time zone configuration Scope of var or the time zone configuration variable. <!-- 描述var或时区配置变量的作用域。 -->
variable.
</description> </description>
<name>scope</name> <name>scope</name> <!-- 属性名称 -->
<required>false</required> <required>false</required> <!-- 此属性不是必须的 -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- 不允许使用运行时表达式 -->
</attribute> </attribute>
</tag> </tag>
<tag> <tag>
<description> <description>
Loads a resource bundle to be used by its tag body Loads a resource bundle to be used by its tag body
@ -179,9 +187,9 @@ form as a fully-qualified class name, that is, it uses
have any file type (such as ".class" or ".properties") have any file type (such as ".class" or ".properties")
suffix. suffix.
</description> </description>
<name>basename</name> <name>basename</name> <!-- 属性名称 -->
<required>true</required> <required>true</required> <!-- 此属性是必须的 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue> <!-- 允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
@ -194,6 +202,11 @@ key of any nested &lt;fmt:message&gt; action.
</attribute> </attribute>
</tag> </tag>
<tag> <tag>
<description> <description>
Loads a resource bundle and stores it in the named scoped variable or Loads a resource bundle and stores it in the named scoped variable or
@ -211,9 +224,9 @@ form as a fully-qualified class name, that is, it uses
have any file type (such as ".class" or ".properties") have any file type (such as ".class" or ".properties")
suffix. suffix.
</description> </description>
<name>basename</name> <name>basename</name> <!-- 属性名称 -->
<required>true</required> <required>true</required> <!-- 此属性是必须的 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue> <!-- 允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
@ -222,114 +235,129 @@ the i18n localization context of type
javax.servlet.jsp.jstl.fmt.LocalizationC javax.servlet.jsp.jstl.fmt.LocalizationC
ontext. ontext.
</description> </description>
<name>var</name> <name>var</name> <!-- 属性名称 -->
<required>false</required> <required>false</required> <!-- 此属性不是必须的 -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- 不允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Scope of var or the localization context Scope of var or the localization context
configuration variable. configuration variable.<!-- 描述var或本地化上下文配置变量的作用域。 -->
</description> </description>
<name>scope</name> <name>scope</name> <!-- 属性名称 -->
<required>false</required> <required>false</required> <!-- 此属性不是必须的 -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- 不允许使用运行时表达式 -->
</attribute> </attribute>
</tag> </tag>
<tag> <tag>
<description> <description>
Maps key to localized message and performs parametric replacement Maps key to localized message and performs parametric replacement<!-- 描述:将键映射到本地化消息,并进行参数替换 -->
</description> </description>
<name>message</name> <name>message</name> <!-- 标签名称 -->
<tag-class>org.apache.taglibs.standard.tag.rt.fmt.MessageTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.rt.fmt.MessageTag</tag-class> <!-- 标签实现类 -->
<body-content>JSP</body-content> <body-content>JSP</body-content> <!-- 标签主体内容为JSP -->
<attribute> <attribute>
<description> <description>
Message key to be looked up. Message key to be looked up.<!-- 描述:要查找的消息键。 -->
</description> </description>
<name>key</name> <name>key</name> <!-- 属性名称 -->
<required>false</required> <required>false</required> <!-- 此属性不是必须的 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue> <!-- 允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Localization context in whose resource Localization context in whose resource
bundle the message key is looked up. bundle the message key is looked up.<!-- 描述:在其资源包中查找消息键的本地化上下文。 -->
</description> </description>
<name>bundle</name> <name>bundle</name> <!-- 属性名称 -->
<required>false</required> <required>false</required> <!-- 此属性不是必须的 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue> <!-- 允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Name of the exported scoped variable Name of the exported scoped variable
which stores the localized message. which stores the localized message.<!-- 描述:存储本地化消息的导出作用域变量的名称。 -->
</description> </description>
<name>var</name> <name>var</name> <!-- 属性名称 -->
<required>false</required> <required>false</required> <!-- 此属性不是必须的 -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- 不允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Scope of var. Scope of var.<!-- 描述var的作用域。 -->
</description> </description>
<name>scope</name> <name>scope</name> <!-- 属性名称 -->
<required>false</required> <required>false</required> <!-- 此属性不是必须的 -->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue> <!-- 不允许使用运行时表达式 -->
</attribute> </attribute>
</tag> </tag>
<tag> <tag>
<description> <description>
Supplies an argument for parametric replacement to a containing Supplies an argument for parametric replacement to a containing
&lt;message&gt; tag &lt;message&gt; tag<!-- 描述:为包含的<message>标签提供参数替换的参数 -->
</description> </description>
<name>param</name> <name>param</name> <!-- 标签名称 -->
<tag-class>org.apache.taglibs.standard.tag.rt.fmt.ParamTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.rt.fmt.ParamTag</tag-class> <!-- 标签实现类 -->
<body-content>JSP</body-content> <body-content>JSP</body-content> <!-- 标签主体内容为JSP -->
<attribute> <attribute>
<description> <description>
Argument used for parametric replacement. Argument used for parametric replacement.<!-- 描述:用于参数替换的参数。 -->
</description> </description>
<name>value</name> <name>value</name> <!-- 属性名称 -->
<required>false</required> <required>false</required> <!-- 此属性不是必须的 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue> <!-- 允许使用运行时表达式 -->
</attribute> </attribute>
</tag> </tag>
<tag> <tag>
<description> <description>
Formats a numeric value as a number, currency, or percentage Formats a numeric value as a number, currency, or percentage<!-- 描述:将数字值格式化为数字、货币或百分比 -->
</description> </description>
<name>formatNumber</name> <name>formatNumber</name> <!-- 标签名称 -->
<tag-class>org.apache.taglibs.standard.tag.rt.fmt.FormatNumberTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.rt.fmt.FormatNumberTag</tag-class> <!-- 标签实现类 -->
<body-content>JSP</body-content> <body-content>JSP</body-content> <!-- 标签主体内容为JSP -->
<attribute> <attribute>
<description> <description>
Numeric value to be formatted. Numeric value to be formatted.<!-- 描述:要格式化的数字值。 -->
</description> </description>
<name>value</name> <name>value</name> <!-- 属性名称 -->
<required>false</required> <required>false</required> <!-- 此属性不是必须的 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue> <!-- 允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Specifies whether the value is to be Specifies whether the value is to be
formatted as number, currency, or formatted as number, currency, or
percentage. percentage.<!-- 描述:指定值是否格式化为数字、货币或百分比。 -->
</description> </description>
<name>type</name> <name>type</name> <!-- 属性名称 -->
<required>false</required> <required>false</required> <!-- 此属性不是必须的 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue> <!-- 允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Custom formatting pattern. Custom formatting pattern.<!-- 描述:自定义格式化模式。 -->
</description> </description>
<name>pattern</name> <name>pattern</name> <!-- 属性名称 -->
<required>false</required> <required>false</required> <!-- 此属性不是必须的 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue> <!-- 允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
@ -337,9 +365,9 @@ ISO 4217 currency code. Applied only
when formatting currencies (i.e. if type is when formatting currencies (i.e. if type is
equal to "currency"); ignored otherwise. equal to "currency"); ignored otherwise.
</description> </description>
<name>currencyCode</name> <name>currencyCode</name><!-- 属性名称 -->
<required>false</required> <required>false</required><!-- 此属性不是必须的 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue><!-- 允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
@ -347,25 +375,30 @@ Currency symbol. Applied only when
formatting currencies (i.e. if type is equal formatting currencies (i.e. if type is equal
to "currency"); ignored otherwise. to "currency"); ignored otherwise.
</description> </description>
<name>currencySymbol</name> <name>currencySymbol</name><!-- 属性名称 -->
<required>false</required> <required>false</required><!-- 此属性不是必须的 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue><!-- 允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Specifies whether the formatted output Specifies whether the formatted output
will contain any grouping separators. will contain any grouping separators.
</description> </description>
<name>groupingUsed</name> <name>groupingUsed</name><!-- 属性名称 -->
<required>false</required> <required>false</required><!-- 此属性不是必须的 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue><!-- 允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Maximum number of digits in the integer Maximum number of digits in the integer
portion of the formatted output. portion of the formatted output.<!-- 描述:自定义格式化模式。 -->
</description> </description>
<name>maxIntegerDigits</name> <name>maxIntegerDigits</name><!--max-->
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
@ -373,7 +406,7 @@ portion of the formatted output.
<description> <description>
Minimum number of digits in the integer Minimum number of digits in the integer
portion of the formatted output. portion of the formatted output.
</description> </description><!--注释货币-->
<name>minIntegerDigits</name> <name>minIntegerDigits</name>
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
@ -381,10 +414,15 @@ portion of the formatted output.
<attribute> <attribute>
<description> <description>
Maximum number of digits in the Maximum number of digits in the
fractional portion of the formatted output. fractional portion of the formatted output.<!--货币最大值-->
</description> </description>
<name>maxFractionDigits</name> <name>maxFractionDigits</name>
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
@ -402,17 +440,22 @@ Name of the exported scoped variable
which stores the formatted result as a which stores the formatted result as a
String. String.
</description> </description>
<name>var</name> <name>var</name><!--属性明1-->
<required>false</required> <required>false</required><!---->
<rtexprvalue>false</rtexprvalue>
<rtexprvalue>false</rtexprvalue><!---->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Scope of var. Scope of var.
</description> </description>
<name>scope</name> <name>scope</name><!---->
<required>false</required> <required>false</required><!---->
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue><!---->
</attribute> </attribute>
</tag> </tag>
@ -428,26 +471,36 @@ Scope of var.
String to be parsed. String to be parsed.
</description> </description>
<name>value</name> <name>value</name>
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Specifies whether the string in the value Specifies whether the string in the value<!---->
attribute should be parsed as a number, attribute should be parsed as a number,
currency, or percentage. currency, or percentage.
</description> </description>
<name>type</name> <name>type</name>
<required>false</required> <required>false</required><!---->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Custom formatting pattern that determines <!--Custom formatting pattern that determines
how the string in the value attribute is to be how the string in the value attribute is to be
parsed. parsed.-->
</description> </description><!---->
<name>pattern</name> <name>pattern</name>
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
@ -460,24 +513,29 @@ operation, or to which the pattern specified
via the pattern attribute (if present) is via the pattern attribute (if present) is
applied. applied.
</description> </description>
<name>parseLocale</name> <name>parseLocale</name><!---->
<required>false</required> <required>false</required><!---->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue><!---->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Specifies whether just the integer portion of <!--Specifies whether just the integer portion of
the given value should be parsed. the given value should be parsed.-->
</description> </description>
<name>integerOnly</name> <name>integerOnly</name>
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Name of the exported scoped variable which <!--Name of the exported scoped variable which
stores the parsed result (of type stores the parsed result (of type
java.lang.Number). java.lang.Number).-->
</description> </description>
<name>var</name> <name>var</name>
<required>false</required> <required>false</required>
@ -487,7 +545,7 @@ java.lang.Number).
<description> <description>
Scope of var. Scope of var.
</description> </description>
<name>scope</name> <name>scope</name><!-- 不允许使用运行时表达式 -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
@ -495,7 +553,7 @@ Scope of var.
<tag> <tag>
<description> <description>
Formats a date and/or time using the supplied styles and pattern <!--Formats a date and/or time using the supplied styles and pattern-->
</description> </description>
<name>formatDate</name> <name>formatDate</name>
<tag-class>org.apache.taglibs.standard.tag.rt.fmt.FormatDateTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.rt.fmt.FormatDateTag</tag-class>
@ -505,8 +563,13 @@ Scope of var.
Date and/or time to be formatted. Date and/or time to be formatted.
</description> </description>
<name>value</name> <name>value</name>
<required>true</required> <required>true</required><!-- 不允许使用运行时表达式 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
@ -515,7 +578,7 @@ the time and date components of the given
date are to be formatted. date are to be formatted.
</description> </description>
<name>type</name> <name>type</name>
<required>false</required> <required>false</required><!-- 不允许使用运行时表达式 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
@ -528,6 +591,11 @@ time (i.e. if type is missing or is equal to
"date" or "both"); ignored otherwise. "date" or "both"); ignored otherwise.
</description> </description>
<name>dateStyle</name> <name>dateStyle</name>
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
@ -548,10 +616,10 @@ ignored otherwise.
<description> <description>
Custom formatting style for dates and times. Custom formatting style for dates and times.
</description> </description>
<name>pattern</name> <name>pattern</name><!-- 属性名称 -->
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute><!-- 描述:自定义格式化模式。 -->
<attribute> <attribute>
<description> <description>
Time zone in which to represent the formatted Time zone in which to represent the formatted
@ -559,53 +627,58 @@ time.
</description> </description>
<name>timeZone</name> <name>timeZone</name>
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue><!-- 描述:自定义格式化模式。 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Name of the exported scoped variable which Name of the exported scoped variable which<!-- 描述:自定义格式化模式。 -->
stores the formatted result as a String. stores the formatted result as a String.
</description> </description>
<name>var</name> <name>var</name><!-- 属性名称 -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Scope of var. Scope of var.
</description> </description><!---->
<name>scope</name> <name>scope</name><!-- 属性名称 -->
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<required>false</required><!---->
<rtexprvalue>false</rtexprvalue><!-- 描述:自定义格式化模式。 -->
</attribute> </attribute>
</tag> </tag>
<tag> <tag>
<description> <description><!-- 描述:自定义格式化模式。 -->
Parses the string representation of a date and/or time Parses the string representation of a date and/or time
</description> </description>
<name>parseDate</name> <name>parseDate</name><!---->
<tag-class>org.apache.taglibs.standard.tag.rt.fmt.ParseDateTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.rt.fmt.ParseDateTag</tag-class>
<body-content>JSP</body-content> <body-content>JSP</body-content>
<attribute> <attribute>
<description> <description>
Date string to be parsed. Date string to be parsed.
</description> </description>
<name>value</name> <name>value</name><!-- 描述:自定义格式化模式。 -->
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue><!---->
</attribute> </attribute>
<attribute> <attribute>
<description> <description>
Specifies whether the date string in the Specifies whether the date string in the
value attribute is supposed to contain a value attribute is supposed to contain a
time, a date, or both. time, a date, or both.
</description> </description><!-- 描述:自定义格式化模式。 -->
<name>type</name> <name>type</name><!-- 属性名称 -->
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue><!-- 不允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute><!---->
<description> <description>
Predefined formatting style for days Predefined formatting style for days
which determines how the date which determines how the date
@ -615,10 +688,10 @@ date or both a date and time (i.e. if type
is missing or is equal to "date" or "both"); is missing or is equal to "date" or "both");
ignored otherwise. ignored otherwise.
</description> </description>
<name>dateStyle</name> <name>dateStyle</name><!-- 描述:自定义格式化模式。 -->
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue><!-- 不允许使用运行时表达式 -->
</attribute> </attribute><!---->
<attribute> <attribute>
<description> <description>
Predefined formatting styles for times Predefined formatting styles for times
@ -628,28 +701,33 @@ parsed. Applied only when formatting a
time or both a date and time (i.e. if type time or both a date and time (i.e. if type
is equal to "time" or "both"); ignored is equal to "time" or "both"); ignored
otherwise. otherwise.
</description> </description><!---->
<name>timeStyle</name> <name>timeStyle</name><!-- 属性名称 -->
<required>false</required> <required>false</required><!-- 描述:自定义格式化模式。 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue><!-- 不允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description><!---->
Custom formatting pattern which Custom formatting pattern which
determines how the date string is to be determines how the date string is to be
parsed. parsed.
</description> </description>
<name>pattern</name> <name>pattern</name><!-- 属性名称 -->
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<description> <description><!---->
Time zone in which to interpret any time Time zone in which to interpret any time
information in the date string. information in the date string.<!-- 描述:自定义格式化模式。 -->
</description> </description>
<name>timeZone</name> <name>timeZone</name><!-- 属性名称 -->
<required>false</required>
<required>false</required><!-- 不允许使用运行时表达式 -->
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
@ -660,28 +738,33 @@ the parse operation, or to which the
pattern specified via the pattern pattern specified via the pattern
attribute (if present) is applied. attribute (if present) is applied.
</description> </description>
<name>parseLocale</name> <name>parseLocale</name><!-- 属性名称 -->
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue><!-- 允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description><!-- 描述:自定义格式化模式。 -->
Name of the exported scoped variable in Name of the exported scoped variable in
which the parsing result (of type which the parsing result (of type
java.util.Date) is stored. java.util.Date) is stored.
</description> </description>
<name>var</name> <name>var</name><!-- 属性名称 -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue><!-- 不允许使用运行时表达式 -->
</attribute> </attribute>
<attribute> <attribute>
<description> <description><!-- 描述:自定义格式化模式。 -->
Scope of var. Scope of var.
</description> </description>
<name>scope</name> <name>scope</name><!-- 属性名称 -->
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue><!-- 不允许使用运行时表达式 -->
</attribute> </attribute><!-- 描述:自定义格式化模式。 -->
</tag> </tag>
</taglib> </taglib>

@ -1,5 +1,306 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!--
~ Copyright (c) 2019. 黄钰朝
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
version="2.0">
<!-- 描述JSTL 1.1函数库 -->
<description>JSTL 1.1 functions library</description>
<!-- 显示名称 -->
<display-name>JSTL functions</display-name>
<!-- JSTL版本 -->
<tlib-version>1.1</tlib-version>
<!-- 短名称 -->
<short-name>fn</short-name>
<!-- URI -->
<uri>http://java.sun.com/jsp/jstl/functions</uri>
<!-- 定义一个函数 -->
<function>
<!-- 函数描述 -->
<description>
Tests if an input string contains the specified substring.
</description>
<!-- 函数名称 -->
<name>contains</name>
<!-- 函数所属类 -->
<function-class>org.apache.taglibs.standard.functions.Functions</function-class>
<!-- 函数签名 -->
<function-signature>boolean contains(java.lang.String, java.lang.String)</function-signature>
<!-- 函数示例 -->
<example>
&lt;c:if test="${fn:contains(name, searchString)}">
</example>
</function>
<!-- 定义一个函数 -->
<function>
<!-- 函数描述 -->
<description>
Tests if an input string contains the specified substring in a case insensitive way.
</description>
<!-- 函数名称 -->
<name>containsIgnoreCase</name>
<!-- 函数所属类 -->
<function-class>org.apache.taglibs.standard.functions.Functions</function-class>
<!-- 函数签名 -->
<function-signature>boolean containsIgnoreCase(java.lang.String, java.lang.String)</function-signature>
<!-- 函数示例 -->
<example>
&lt;c:if test="${fn:containsIgnoreCase(name, searchString)}">
</example>
</function>
<!-- 测试输入字符串是否以指定的后缀结尾 -->
<function>
<description>
Tests if an input string ends with the specified suffix.
</description>
<name>endsWith</name>
<function-class>org.apache.taglibs.standard.functions.Functions</function-class>
<function-signature>boolean endsWith(java.lang.String, java.lang.String)</function-signature>
<example>
&lt;c:if test="${fn:endsWith(filename, ".txt")}">
</example>
</function>
<!-- 转义XML标记 -->
<function>
<description>
Escapes characters that could be interpreted as XML markup.
</description>
<name>escapeXml</name>
<function-class>org.apache.taglibs.standard.functions.Functions</function-class>
<function-signature>java.lang.String escapeXml(java.lang.String)</function-signature>
<example>
${fn:escapeXml(param:info)}
</example>
</function>
<!-- 返回字符串中指定子字符串第一次出现的索引 -->
<function>
<description>
Returns the index withing a string of the first occurrence of a specified substring.
</description>
<name>indexOf</name>
<function-class>org.apache.taglibs.standard.functions.Functions</function-class>
<function-signature>int indexOf(java.lang.String, java.lang.String)</function-signature>
<example>
${fn:indexOf(name, "-")}
</example>
</function>
<!-- 将数组的所有元素连接成一个字符串 -->
<!-- 将数组中的所有元素连接成一个字符串 -->
<function>
<description>
Joins all elements of an array into a string.
</description>
<name>join</name>
<function-class>org.apache.taglibs.standard.functions.Functions</function-class>
<function-signature>java.lang.String join(java.lang.String[], java.lang.String)</function-signature>
<example>
${fn:join(array, ";")}
</example>
</function>
<!-- 返回集合中的项目数,或字符串中的字符数 -->
<function>
<description>
Returns the number of items in a collection, or the number of characters in a string.
</description>
<name>length</name>
<function-class>org.apache.taglibs.standard.functions.Functions</function-class>
<function-signature>int length(java.lang.Object)</function-signature>
<example>
You have ${fn:length(shoppingCart.products)} in your shopping cart.
</example>
</function>
<!-- 返回一个字符串,该字符串是通过将输入字符串中的所有"before"字符串替换为"after"子字符串得到的 -->
<function>
<description>
Returns a string resulting from replacing in an input string all occurrences
of a "before" string into an "after" substring.
</description>
<name>replace</name>
<function-class>org.apache.taglibs.standard.functions.Functions</function-class>
<function-signature>java.lang.String replace(java.lang.String, java.lang.String, java.lang.String)</function-signature>
<example>
${fn:replace(text, "-", "&#149;")}
</example>
</function>
<!-- 将字符串分割成一个子字符串数组 -->
<!-- 将字符串分割成子字符串数组 -->
<function>
<description>
Splits a string into an array of substrings.
</description>
<name>split</name>
<function-class>org.apache.taglibs.standard.functions.Functions</function-class>
<function-signature>java.lang.String[] split(java.lang.String, java.lang.String)</function-signature>
<example>
${fn:split(customerNames, ";")}
</example>
</function>
<!-- 测试输入字符串是否以指定的前缀开头 -->
<function>
<description>
Tests if an input string starts with the specified prefix.
</description>
<name>startsWith</name>
<function-class>org.apache.taglibs.standard.functions.Functions</function-class>
<function-signature>boolean startsWith(java.lang.String, java.lang.String)</function-signature>
<example>
&lt;c:if test="${fn:startsWith(product.id, "100-")}">
</example>
</function>
<!-- 返回字符串的子集 -->
<function>
<description>
Returns a subset of a string.
</description>
<name>substring</name>
<function-class>org.apache.taglibs.standard.functions.Functions</function-class>
<function-signature>java.lang.String substring(java.lang.String, int, int)</function-signature>
<example>
P.O. Box: ${fn:substring(zip, 6, -1)}
</example>
</function>
<!-- 返回字符串在特定子字符串之后的子集 -->
<function>
<description>
Returns a subset of a string following a specific substring.
</description>
<name>substringAfter</name>
<function-class>org.apache.taglibs.standard.functions.Functions</function-class>
<function-signature>java.lang.String substringAfter(java.lang.String, java.lang.String)</function-signature>
<example>
P.O. Box: ${fn:substringAfter(zip, "-")}
</example>
</function>
<!-- 返回字符串在特定子字符串之前的子集 -->
<function>
<description>
Returns a subset of a string before a specific substring.
</description>
<name>substringBefore</name>
<function-class>org.apache.taglibs.standard.functions.Functions</function-class>
<function-signature>java.lang.String substringBefore(java.lang.String, java.lang.String)</function-signature>
<example>
Zip (without P.O. Box): ${fn:substringBefore(zip, "-")}
</example>
</function>
<!-- 将字符串中的所有字符转换为小写 -->
<function>
<description>
Converts all of the characters of a string to lower case.
</description>
<name>toLowerCase</name>
<function-class>org.apache.taglibs.standard.functions.Functions</function-class>
<function-signature>java.lang.String toLowerCase(java.lang.String)</function-signature>
<example>
Product name: ${fn.toLowerCase(product.name)}
</example>
</function>
<!-- 将字符串中的所有字符转换为大写 -->
<function>
<description>
Converts all of the characters of a string to upper case.
</description>
<name>toUpperCase</name>
<function-class>org.apache.taglibs.standard.functions.Functions</function-class>
<function-signature>java.lang.String toUpperCase(java.lang.String)</function-signature>
<example>
Product name: ${fn.UpperCase(product.name)}
</example>
</function>
<!-- 去除字符串两端的空白字符 -->
<function>
<description>
Removes white spaces from both ends of a string.
</description>
<name>trim</name>
<function-class>org.apache.taglibs.standard.functions.Functions</function-class>
<function-signature>java.lang.String trim(java.lang.String)</function-signature>
<example>
Name: ${fn.trim(name)}
</example>
</function>
</taglib>
<?xml version="1.0" encoding="UTF-8" ?>
<!-- <!--
~ Copyright (c) 2019. 黄钰朝 ~ Copyright (c) 2019. 黄钰朝
~ ~
@ -16,41 +317,81 @@
~ limitations under the License. ~ limitations under the License.
--> -->
<taglib xmlns="http://java.sun.com/xml/ns/j2ee" <taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
version="2.0"> version="2.0">
<!-- 描述JSTL 1.1函数库 -->
<description>JSTL 1.1 functions library</description> <description>JSTL 1.1 functions library</description>
<!-- 显示名称 -->
<display-name>JSTL functions</display-name> <display-name>JSTL functions</display-name>
<!-- JSTL版本 -->
<tlib-version>1.1</tlib-version> <tlib-version>1.1</tlib-version>
<!-- 短名称 -->
<short-name>fn</short-name> <short-name>fn</short-name>
<!-- URI -->
<uri>http://java.sun.com/jsp/jstl/functions</uri> <uri>http://java.sun.com/jsp/jstl/functions</uri>
<!-- 定义一个函数 -->
<function> <function>
<!-- 函数描述 -->
<description> <description>
Tests if an input string contains the specified substring. Tests if an input string contains the specified substring.
</description> </description>
<!-- 函数名称 -->
<name>contains</name> <name>contains</name>
<!-- 函数所属类 -->
<function-class>org.apache.taglibs.standard.functions.Functions</function-class> <function-class>org.apache.taglibs.standard.functions.Functions</function-class>
<!-- 函数签名 -->
<function-signature>boolean contains(java.lang.String, java.lang.String)</function-signature> <function-signature>boolean contains(java.lang.String, java.lang.String)</function-signature>
<!-- 函数示例 -->
<example> <example>
&lt;c:if test="${fn:contains(name, searchString)}"> &lt;c:if test="${fn:contains(name, searchString)}">
</example> </example>
</function> </function>
<!-- 定义一个函数 -->
<function> <function>
<!-- 函数描述 -->
<description> <description>
Tests if an input string contains the specified substring in a case insensitive way. Tests if an input string contains the specified substring in a case insensitive way.
</description> </description>
<!-- 函数名称 -->
<name>containsIgnoreCase</name> <name>containsIgnoreCase</name>
<!-- 函数所属类 -->
<function-class>org.apache.taglibs.standard.functions.Functions</function-class> <function-class>org.apache.taglibs.standard.functions.Functions</function-class>
<!-- 函数签名 -->
<function-signature>boolean containsIgnoreCase(java.lang.String, java.lang.String)</function-signature> <function-signature>boolean containsIgnoreCase(java.lang.String, java.lang.String)</function-signature>
<!-- 函数示例 -->
<example> <example>
&lt;c:if test="${fn:containsIgnoreCase(name, searchString)}"> &lt;c:if test="${fn:containsIgnoreCase(name, searchString)}">
</example> </example>
</function> </function>
<!-- 测试输入字符串是否以指定的后缀结尾 -->
<function> <function>
<description> <description>
Tests if an input string ends with the specified suffix. Tests if an input string ends with the specified suffix.
@ -63,6 +404,8 @@
</example> </example>
</function> </function>
<!-- 转义XML标记 -->
<function> <function>
<description> <description>
Escapes characters that could be interpreted as XML markup. Escapes characters that could be interpreted as XML markup.
@ -75,6 +418,8 @@
</example> </example>
</function> </function>
<!-- 返回字符串中指定子字符串第一次出现的索引 -->
<function> <function>
<description> <description>
Returns the index withing a string of the first occurrence of a specified substring. Returns the index withing a string of the first occurrence of a specified substring.
@ -87,6 +432,10 @@
</example> </example>
</function> </function>
<!-- 将数组的所有元素连接成一个字符串 -->
<!-- 将数组中的所有元素连接成一个字符串 -->
<function> <function>
<description> <description>
Joins all elements of an array into a string. Joins all elements of an array into a string.
@ -99,6 +448,8 @@
</example> </example>
</function> </function>
<!-- 返回集合中的项目数,或字符串中的字符数 -->
<function> <function>
<description> <description>
Returns the number of items in a collection, or the number of characters in a string. Returns the number of items in a collection, or the number of characters in a string.
@ -111,6 +462,8 @@
</example> </example>
</function> </function>
<!-- 返回一个字符串,该字符串是通过将输入字符串中的所有"before"字符串替换为"after"子字符串得到的 -->
<function> <function>
<description> <description>
Returns a string resulting from replacing in an input string all occurrences Returns a string resulting from replacing in an input string all occurrences
@ -124,6 +477,10 @@
</example> </example>
</function> </function>
<!-- 将字符串分割成一个子字符串数组 -->
<!-- 将字符串分割成子字符串数组 -->
<function> <function>
<description> <description>
Splits a string into an array of substrings. Splits a string into an array of substrings.
@ -136,6 +493,8 @@
</example> </example>
</function> </function>
<!-- 测试输入字符串是否以指定的前缀开头 -->
<function> <function>
<description> <description>
Tests if an input string starts with the specified prefix. Tests if an input string starts with the specified prefix.
@ -148,6 +507,8 @@
</example> </example>
</function> </function>
<!-- 返回字符串的子集 -->
<function> <function>
<description> <description>
Returns a subset of a string. Returns a subset of a string.
@ -160,6 +521,8 @@
</example> </example>
</function> </function>
<!-- 返回字符串在特定子字符串之后的子集 -->
<function> <function>
<description> <description>
Returns a subset of a string following a specific substring. Returns a subset of a string following a specific substring.
@ -172,6 +535,8 @@
</example> </example>
</function> </function>
<!-- 返回字符串在特定子字符串之前的子集 -->
<function> <function>
<description> <description>
Returns a subset of a string before a specific substring. Returns a subset of a string before a specific substring.
@ -184,6 +549,8 @@
</example> </example>
</function> </function>
<!-- 将字符串中的所有字符转换为小写 -->
<function> <function>
<description> <description>
Converts all of the characters of a string to lower case. Converts all of the characters of a string to lower case.
@ -196,6 +563,8 @@
</example> </example>
</function> </function>
<!-- 将字符串中的所有字符转换为大写 -->
<function> <function>
<description> <description>
Converts all of the characters of a string to upper case. Converts all of the characters of a string to upper case.
@ -208,6 +577,8 @@
</example> </example>
</function> </function>
<!-- 去除字符串两端的空白字符 -->
<function> <function>
<description> <description>
Removes white spaces from both ends of a string. Removes white spaces from both ends of a string.
@ -221,3 +592,4 @@
</function> </function>
</taglib> </taglib>

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!-- <!--
~ Copyright (c) 2019. 黄钰朝 ~ Copyright (c) 2019. 黄钰朝
~ ~
@ -16,29 +19,58 @@
~ limitations under the License. ~ limitations under the License.
--> -->
<!-- 定义一个标签库 -->
<taglib xmlns="http://java.sun.com/xml/ns/j2ee" <taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
version="2.0"> version="2.0">
<!-- 标签库的描述 -->
<description> <description>
Restricts JSP pages to the JSTL tag libraries Restricts JSP pages to the JSTL tag libraries
</description> </description>
<!-- 标签库的显示名称 -->
<display-name>permittedTaglibs</display-name> <display-name>permittedTaglibs</display-name>
<!-- 标签库的版本号 -->
<tlib-version>1.1</tlib-version> <tlib-version>1.1</tlib-version>
<!-- 标签库的简称 -->
<short-name>permittedTaglibs</short-name> <short-name>permittedTaglibs</short-name>
<!-- 标签库的URI -->
<uri>http://jakarta.apache.org/taglibs/standard/permittedTaglibs</uri> <uri>http://jakarta.apache.org/taglibs/standard/permittedTaglibs</uri>
<!-- 验证器 -->
<validator> <validator>
<!-- 验证器的类 -->
<validator-class> <validator-class>
javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV
</validator-class> </validator-class>
<!-- 初始化参数 -->
<init-param> <init-param>
<!-- 参数的描述 -->
<description> <description>
Whitespace-separated list of taglib URIs to permit. This example Whitespace-separated list of taglib URIs to permit. This example
TLD for the Standard Taglib allows only JSTL 'el' taglibs to be TLD for the Standard Taglib allows only JSTL 'el' taglibs to be
imported. imported.
</description> </description>
<!-- 参数的名称 -->
<param-name>permittedTaglibs</param-name> <param-name>permittedTaglibs</param-name>
<!-- 参数的值 -->
<param-value> <param-value>
http://java.sun.com/jsp/jstl/core http://java.sun.com/jsp/jstl/core
http://java.sun.com/jsp/jstl/fmt http://java.sun.com/jsp/jstl/fmt

@ -24,7 +24,12 @@
Validates JSP pages to prohibit use of scripting elements. Validates JSP pages to prohibit use of scripting elements.
</description> </description>
<tlib-version>1.1</tlib-version> <tlib-version>1.1</tlib-version>
<!--版本序号-->
<short-name>scriptfree</short-name> <short-name>scriptfree</short-name>
<!--段字符-->
<uri>http://jakarta.apache.org/taglibs/standard/scriptfree</uri> <uri>http://jakarta.apache.org/taglibs/standard/scriptfree</uri>
<validator> <validator>
@ -40,6 +45,11 @@
</description> </description>
<param-name>allowDeclarations</param-name> <param-name>allowDeclarations</param-name>
<param-value>false</param-value> <param-value>false</param-value>
<!--类别方式-->
</init-param> </init-param>
<init-param> <init-param>
<description> <description>
@ -52,10 +62,19 @@
<description> <description>
Controls whether or not top-level expressions are considered valid. Controls whether or not top-level expressions are considered valid.
</description> </description>
<param-name>allowExpressions</param-name> <param-name>allowExpressions</param-name><!-- 属性类型 -->
<param-value>false</param-value> <param-value>false</param-value>
</init-param> </init-param>
<init-param> <init-param><!-- 当前项的作用域变量名称 -->
<description> <description>
Controls whether or not expressions used to supply request-time Controls whether or not expressions used to supply request-time
attribute values are considered valid. attribute values are considered valid.

File diff suppressed because it is too large Load Diff

@ -34,7 +34,7 @@
</br> </br>
<strong><p align="center">${message}</p></strong> <strong><p align="center">${message}</p></strong>
</br> </br>
</div> </div><!--ok-->
</div> </div>
<hr> <hr>
</body> </body>

File diff suppressed because it is too large Load Diff

@ -21,132 +21,220 @@
Time: 3:51 Time: 3:51
To change this template use File | Settings | File Templates. To change this template use File | Settings | File Templates.
--%> --%>
<%--
页面指令,设置页面的内容类型、字符集、脚本语言和页面编码。
contentType 指定了返回给客户端的内容类型为 HTML并使用 UTF-8 编码。
language 指定了页面中使用的脚本语言为 Java。
pageEncoding 明确指定了页面本身的编码为 UTF-8虽然通常与 contentType 中的 charset 相同,但在这里为了清晰起见还是单独设置了。
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %> <%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%--
引入 JSTL 核心标签库,前缀为 c。
这允许我们在 JSP 页面中使用 JSTL 标签,如 <c:set>、<c:if> 等。
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
使用 <c:set> 标签设置一个名为 host 的变量,其值为 "localhost:8080/wechat"。
这个变量稍后在页面中用于构建 URL。
--%>
<c:set var="host" value="localhost:8080/wechat"/> <c:set var="host" value="localhost:8080/wechat"/>
<%--设置主机名--%> <%--设置主机名--%>
<!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8"> <%-- 设置页面的字符集为 UTF-8 --%>
<title>wechat</title> <title>wechat</title> <%-- 页面标题 --%>
<link rel="shortcut icon" type=image/x-icon href=https://res.wx.qq.com/a/wx_fed/assets/res/NTI4MWU5.ico>
<%-- 引入微信图标 --%>
<link rel="shortcut icon" type="image/x-icon" href="https://res.wx.qq.com/a/wx_fed/assets/res/NTI4MWU5.ico">
<%-- 引入 Bootstrap CSS 框架 --%>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<%-- 引入 jQuery 库 --%>
<script src="${pageContext.request.contextPath}/static/js/jquery-3.4.1.js"></script> <script src="${pageContext.request.contextPath}/static/js/jquery-3.4.1.js"></script>
<%--
发送请求脚本的占位符,目前为空。
可以在这里添加 JavaScript 代码来处理发送请求的逻辑。
--%>
<!--BEGIN——发送请求脚本--> <!--BEGIN——发送请求脚本-->
<!--END——发送请求脚本--> <!--END——发送请求脚本-->
</head> </head>
<body> <body>
<%-- 页面背景容器 --%>
<div class="background"> <div class="background">
<%-- 页面头部 --%> <%-- 页面头部 --%>
<div class="login-head" style="height: 100px"> <div class="login-head" style="height: 100px">
<%-- 使用 Bootstrap 的 jumbotron 类来创建一个醒目的容器 --%>
<div class="jumbotron" style="padding-bottom: 20px;padding-top:20px;margin:0px"> <div class="jumbotron" style="padding-bottom: 20px;padding-top:20px;margin:0px">
<%-- 包含微信 logo 和标语的区域 --%>
<div class="logo"> <div class="logo">
<a href="${pageContext.request.contextPath}/index.jsp" <a href="${pageContext.request.contextPath}/index.jsp"
style="color: #999;font-size: 44px;text-decoration: none"><img style="color: #999;font-size: 44px;text-decoration: none">
src="${pageContext.request.contextPath}/static/img/logo.png" alt="logo" <img src="${pageContext.request.contextPath}/static/img/logo.png" alt="logo"
style="width: 100px;margin: 10px">微信,是一种生活方式</h2> style="width: 100px;margin: 10px">
</a> <%-- 注意:这里的 <h2> 标签被错误地关闭了,应该使用 </a> 来关闭 <a> 标签,而不是 </h2> --%>
微信,是一种生活方式</a> <%-- 这里应该使用正确的 HTML 结构,但原代码有误,已按原样注释 --%>
</a> <%-- 这是一个多余的闭合标签,应该删除 --%>
</div> </div>
</div> </div>
</div> </div>
<%--
使用 <c:if> 标签检查 message 变量是否不为 null。
如果不为 null则使用 JavaScript 显示一个警告框。
--%>
<script> <script>
<c:if test="${message!=null}"> <c:if test="${message!=null}">
alert("系统提示:${message}"); alert("系统提示:${message}");
</c:if> </c:if>
</script> </script>
<%-- 输入框容器 --%>
<div class="input-box"> <div class="input-box">
<%-- 输入字段的容器,带有自定义样式 --%>
<div class="color-input-field"> <div class="color-input-field">
<%--
表单,提交到 http://${host}/wechat/user?method=login.do。
使用 POST 方法提交。
--%>
<form action="http://${host}/wechat/user?method=login.do" method="post"> <form action="http://${host}/wechat/user?method=login.do" method="post">
<%--
一个隐藏的提交按钮,可能用于触发某些 JavaScript 事件,但在这里被设置为不显示。
--%>
<input id="index" type="submit" style="display: none"> <input id="index" type="submit" style="display: none">
<%-- 输入框标题 --%>
<h2 class="input-box-title">邮箱登陆</h2> <h2 class="input-box-title">邮箱登陆</h2>
<%-- 邮箱输入框,带有占位符和必填验证 --%>
<input type="text" required="required" class="form-control" id="email" <input type="text" required="required" class="form-control" id="email"
value="${param.email}" name="email" placeholder="请输入登陆邮箱"> value="${param.email}" name="email" placeholder="请输入登陆邮箱">
<br/> <br/>
<%-- 密码输入框,带有占位符和必填验证 --%>
<input id="password" type="password" required="required" class="form-control" name="password" <input id="password" type="password" required="required" class="form-control" name="password"
placeholder="请输入密码"> placeholder="请输入密码">
<%-- 记住登陆选项 --%>
<div class="remember-me"> <div class="remember-me">
<input id="option" name="auto_login" type="checkbox" value="true">记住登陆 <input id="option" name="auto_login" type="checkbox" value="true">记住登陆
</div> </div>
<%-- 提交按钮 --%>
<input type="submit" class="submit-button" value="登陆"> <input type="submit" class="submit-button" value="登陆">
<br> <br>
<%-- 切换按钮,包含注册链接和游客模式链接 --%>
<div class="switch-button"> <div class="switch-button">
<a href="${pageContext.request.contextPath}/register.jsp">立即注册</a> <a href="${pageContext.request.contextPath}/register.jsp">立即注册</a>
<%--
游客模式链接,带有 onclick 事件处理器(尽管这里没有定义 visitor() 函数,可能需要在 JavaScript 中定义)。
注意:这里的 URL 拼接方式可能会导致安全问题,建议使用更安全的参数传递方式。
--%>
<a href="http://${host}/wechat/user?method=login.do&email=visitor" onclick="visitor()">| 游客模式</a> <a href="http://${host}/wechat/user?method=login.do&email=visitor" onclick="visitor()">| 游客模式</a>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
</body>
</html>
<!-- 网页的结束body标签通常表示HTML文档的主体内容结束 -->
</body> </body>
<!-- 定义CSS样式 -->
<style type="text/css"> <style type="text/css">
/* 设置背景样式 */
.background { .background {
height: -webkit-fill-available; height: -webkit-fill-available; /* 高度填充可用空间针对webkit浏览器 */
min-height: 750px; min-height: 750px; /* 最小高度 */
text-align: center; text-align: center; /* 文本居中 */
font-size: 14px; font-size: 14px; /* 字体大小 */
background-color: #f1f1f1; background-color: #f1f1f1; /* 背景颜色 */
z-index: -1; z-index: -1; /* 堆叠顺序,设置为-1表示在其他元素之下 */
} }
/* 设置logo样式 */
.logo { .logo {
position: absolute; position: absolute; /* 绝对定位 */
top: 56px; top: 56px; /* 距离顶部56px */
margin-left: 50px; margin-left: 50px; /* 距离左侧50px */
} }
/* 设置表单控件样式 */
.form-control { .form-control {
padding: 10px; padding: 10px; /* 内边距 */
min-height: 55px; min-height: 55px; /* 最小高度 */
max-height: 70px; max-height: 70px; /* 最大高度 */
font-size: 22px; font-size: 22px; /* 字体大小 */
} }
/* 设置输入框标题样式 */
.input-box-title { .input-box-title {
text-align: center; text-align: center; /* 文本居中 */
margin: 0 auto 50px; margin: 0 auto 50px; /* 上下外边距自动底部外边距50px */
padding: 10px; padding: 10px; /* 内边距 */
font-weight: 400; font-weight: 400; /* 字体粗细 */
color: #969696 color: #969696 /* 字体颜色 */
} }
/* 设置颜色输入框样式 */
.color-input-field { .color-input-field {
padding: 50px; padding: 50px; /* 内边距 */
font-size: 22px; font-size: 22px; /* 字体大小 */
height: 625px; height: 625px; /* 高度 */
width: 500px width: 500px /* 宽度 */
} }
/* 设置输入框容器样式 */
.input-box { .input-box {
width: fit-content; width: fit-content; /* 宽度适应内容 */
margin: 104px auto; margin: 104px auto; /* 上下外边距104px左右外边距自动 */
background-color: #fff; background-color: #fff; /* 背景颜色 */
border-radius: 4px; border-radius: 4px; /* 边框圆角 */
box-shadow: 0 0 8px rgba(0, 0, 0, .1); box-shadow: 0 0 8px rgba(0, 0, 0, .1); /* 盒子阴影 */
vertical-align: middle; vertical-align: middle; /* 垂直对齐方式 */
} }
/* 设置提交按钮样式 */
.submit-button { .submit-button {
margin-top: 20px; margin-top: 20px; /* 上外边距 */
background-color: #1AAD19; background-color: #1AAD19; /* 背景颜色 */
color: #FFFFFF; color: #FFFFFF; /* 字体颜色 */
padding: 9px 18px; padding: 9px 18px; /* 内边距 */
border-radius: 5px; border-radius: 5px; /* 边框圆角 */
outline: none; outline: none; /* 移除默认轮廓 */
border: none; border: none; /* 无边框 */
width: 100%; width: 100%; /* 宽度100% */
} }
/* 设置记住我选项样式 */
.remember-me { .remember-me {
float: left; float: left; /* 左浮动 */
font-weight: 400; font-weight: 400; /* 字体粗细 */
color: #969696; color: #969696; /* 字体颜色 */
margin-top: 20px; margin-top: 20px; /* 上外边距 */
} }
/* 设置切换按钮容器样式 */
.switch-button { .switch-button {
text-align: left; text-align: left; /* 文本左对齐 */
} }
</style> </style>
<!-- 网页的结束html标签表示HTML文档结束 -->
</html> </html>

@ -21,41 +21,53 @@
Time: 21:23 Time: 21:23
To change this template use File | Settings | File Templates. To change this template use File | Settings | File Templates.
--%> --%>
<%-- 设置页面的内容类型为HTML并指定字符集和页面编码为UTF-8 --%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %> <%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%-- 引入JSTL核心标签库并设置前缀为c --%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%-- 设置一个名为host的变量其值为localhost:8080/wechat --%>
<c:set var="host" value="localhost:8080/wechat"/> <c:set var="host" value="localhost:8080/wechat"/>
<%--设置主机名--%> <%-- 注释:设置主机名 --%>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>wechat</title> <title>wechat</title>
<link rel="shortcut icon" type=image/x-icon href=https://res.wx.qq.com/a/wx_fed/assets/res/NTI4MWU5.ico> <%-- 设置网页的快捷图标favicon --%>
<link rel="shortcut icon" type="image/x-icon" href="https://res.wx.qq.com/a/wx_fed/assets/res/NTI4MWU5.ico">
<%-- 引入Bootstrap的CSS样式 --%>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<%-- 引入jQuery库 --%>
<script src="${pageContext.request.contextPath}/static/js/jquery-3.4.1.js"></script> <script src="${pageContext.request.contextPath}/static/js/jquery-3.4.1.js"></script>
<script> <script>
// 定义注册函数
function register() { function register() {
// 获取邮箱和密码输入框的值
var email = document.getElementById("email").value; var email = document.getElementById("email").value;
var password = document.getElementById("password").value; var password = document.getElementById("password").value;
// 验证邮箱是否填写
if(email==null||email==''){ if(email==null||email==''){
alert("请填写邮箱"); alert("请填写邮箱");
return; return;
} }
// 验证密码是否填写
if(password==null||password===''){ if(password==null||password===''){
alert("请填写密码"); alert("请填写密码");
return; return;
} }
// 验证是否同意用户使用协议
if(!document.getElementById("agree").checked){ if(!document.getElementById("agree").checked){
alert("请先同意用户使用协议"); alert("请先同意用户使用协议");
return; return;
} }
// 触发表单提交
document.getElementById("submit").click(); document.getElementById("submit").click();
} }
</script> </script>
</head> </head>
<body> <body>
<%-- 如果message变量不为空则弹出系统提示 --%>
<script> <script>
<c:if test="${message!=null}"> <c:if test="${message!=null}">
alert("系统提示:${message}"); alert("系统提示:${message}");
@ -66,10 +78,12 @@
<div class="login-head" style="height: 100px"> <div class="login-head" style="height: 100px">
<div class="jumbotron" style="padding-bottom: 20px;padding-top:20px;margin:0px"> <div class="jumbotron" style="padding-bottom: 20px;padding-top:20px;margin:0px">
<div class="logo"> <div class="logo">
<%-- 链接到首页并显示微信logo和标语 --%>
<a href="${pageContext.request.contextPath}/index.jsp" <a href="${pageContext.request.contextPath}/index.jsp"
style="color: #999;font-size: 44px;text-decoration: none"><img style="color: #999;font-size: 44px;text-decoration: none">
src="${pageContext.request.contextPath}/static/img/logo.png" alt="logo" <img src="${pageContext.request.contextPath}/static/img/logo.png" alt="logo"
style="width: 100px;margin: 10px">微信,是一种生活方式</h2> style="width: 100px;margin: 10px">
<h2>微信,是一种生活方式</h2>
</a> </a>
</div> </div>
</div> </div>
@ -77,21 +91,30 @@
<div class="input-box"> <div class="input-box">
<div class="color-input-field"> <div class="color-input-field">
<h2 class="input-box-title">注册账号</h2> <h2 class="input-box-title">注册账号</h2>
<%-- 表单提交到注册处理URL使用POST方法 --%>
<form action="http://${host}/wechat/user?method=register.do" method="post"> <form action="http://${host}/wechat/user?method=register.do" method="post">
<%-- 隐藏一个提交按钮用于在JavaScript中触发提交 --%>
<input id="index" type="submit" style="display: none"> <input id="index" type="submit" style="display: none">
<%-- 邮箱输入框 --%>
<input id="email" type="text" required="required" class="form-control" name="email" <input id="email" type="text" required="required" class="form-control" name="email"
value="${data.email}" placeholder="请输入邮箱号"> value="${data.email}" placeholder="请输入邮箱号">
<br/> <br/>
<%-- 密码输入框 --%>
<input id="password" type="password" required="required" class="form-control" name="password" <input id="password" type="password" required="required" class="form-control" name="password"
value="${data.password}" placeholder="请输入密码(6-20位英文字母数字或下划线)"> value="${data.password}" placeholder="请输入密码(6-20位英文字母数字或下划线)">
<div class="remember-me"> <div class="remember-me">
<%-- 同意协议复选框 --%>
<input id="agree" type="checkbox" name="agreement" value="true" <input id="agree" type="checkbox" name="agreement" value="true"
style="margin-bottom: 13px">我已阅读并同意<a href="agreement.html">《微信服务协议》</a> style="margin-bottom: 13px">
我已阅读并同意<a href="agreement.html">《微信服务协议》</a>
</div> </div>
<%-- 隐藏的真实提交按钮 --%>
<input type="submit" id="submit" style="display: none"> <input type="submit" id="submit" style="display: none">
<%-- 注册按钮点击后调用JavaScript的register函数 --%>
<input onclick="register()" type="button" class="submit-button" value="注册"> <input onclick="register()" type="button" class="submit-button" value="注册">
<br> <br>
<div class="switch-button"> <div class="switch-button">
<%-- 提供登录和游客模式的链接 --%>
已有账号?<a href="${pageContext.request.contextPath}/login.jsp">请登陆</a> 已有账号?<a href="${pageContext.request.contextPath}/login.jsp">请登陆</a>
<a href="http://${host}/wechat/user?method=login.do&email=visitor"> | 游客模式</a> <a href="http://${host}/wechat/user?method=login.do&email=visitor"> | 游客模式</a>
</div> </div>
@ -99,79 +122,88 @@
</div> </div>
</div> </div>
</div> </div>
</body> </body>
</html>
<!-- 样式定义开始 -->
<style type="text/css"> <style type="text/css">
/* 定义背景样式 */
.background { .background {
height: -webkit-fill-available; height: -webkit-fill-available; /* 在webkit浏览器中高度自动填充可用空间 */
min-height: 750px; min-height: 750px; /* 最小高度为750px */
text-align: center; text-align: center; /* 文本居中 */
font-size: 14px; font-size: 14px; /* 字体大小为14px */
background-color: #f1f1f1; background-color: #f1f1f1; /* 背景颜色为浅灰色 */
z-index: -1; z-index: -1; /* 元素的堆叠顺序为-1通常用于放在其他元素之后 */
} }
/* 定义logo样式 */
.logo { .logo {
position: absolute; position: absolute; /* 绝对定位 */
top: 56px; top: 56px; /* 距离顶部56px */
margin-left: 50px; margin-left: 50px; /* 距离左侧50px */
} }
/* 定义表单控件样式 */
.form-control { .form-control {
padding: 10px; padding: 10px; /* 内边距为10px */
min-height: 55px; min-height: 55px; /* 最小高度为55px */
max-height: 70px; max-height: 70px; /* 最大高度为70px */
font-size: 22px; font-size: 22px; /* 字体大小为22px */
} }
/* 定义输入框标题样式 */
.input-box-title { .input-box-title {
text-align: center; text-align: center; /* 文本居中 */
margin: 0 auto 50px; margin: 0 auto 50px; /* 上边距为0左右自动居中下边距为50px */
padding: 10px; padding: 10px; /* 内边距为10px */
font-weight: 400; font-weight: 400; /* 字体粗细为400 */
color: #969696 color: #969696; /* 字体颜色为深灰色 */
} }
/* 定义颜色输入框样式 */
.color-input-field { .color-input-field {
padding: 50px; padding: 50px; /* 内边距为50px */
font-size: 22px; font-size: 22px; /* 字体大小为22px */
height: 625px; height: 625px; /* 高度为625px */
width: 500px width: 500px; /* 宽度为500px */
} }
/* 定义输入框容器样式 */
.input-box { .input-box {
width: fit-content; width: fit-content; /* 宽度适应内容 */
margin: 104px auto; margin: 104px auto; /* 上下边距为104px左右自动居中 */
background-color: #fff; background-color: #fff; /* 背景颜色为白色 */
border-radius: 4px; border-radius: 4px; /* 边框圆角为4px */
box-shadow: 0 0 8px rgba(0, 0, 0, .1); box-shadow: 0 0 8px rgba(0, 0, 0, .1); /* 盒子阴影效果 */
vertical-align: middle; vertical-align: middle; /* 垂直对齐方式为中间 */
} }
/* 定义提交按钮样式 */
.submit-button { .submit-button {
margin-top: 20px; margin-top: 20px; /* 上边距为20px */
background-color: #1AAD19; background-color: #1AAD19; /* 背景颜色为绿色 */
color: #FFFFFF; color: #FFFFFF; /* 字体颜色为白色 */
padding: 9px 18px; padding: 9px 18px; /* 内边距为9px上下和18px左右 */
border-radius: 5px; border-radius: 5px; /* 边框圆角为5px */
outline: none; outline: none; /* 去除默认轮廓线 */
border: none; border: none; /* 无边框 */
width: 100%; width: 100%; /* 宽度为父容器的100% */
} }
/* 定义记住我选项样式 */
.remember-me { .remember-me {
float: left; float: left; /* 左浮动 */
font-weight: 400; font-weight: 400; /* 字体粗细为400 */
color: #969696; color: #969696; /* 字体颜色为深灰色 */
margin-top: 20px; margin-top: 20px; /* 上边距为20px */
} }
/* 定义切换按钮样式 */
.switch-button { .switch-button {
text-align: left; text-align: left; /* 文本左对齐 */
} }
</style> </style>
</html> <!-- 样式定义结束 -->

@ -1,4 +1,23 @@
/*
.page-body:
.menu:
.menu-head, .menu-head-photo, .menu-head-img, .menu-head-info, .menu-head-nickname:
.menu-search, .menu-search-icon, .menu-search-bar:
.menu-option, .menu-option-item, .menu-option-chat:
.chat-box, .chat-box-head, .chat-box-title, .chat-box-title-box, .chat-box-title-text:
.chat-input-box, .text-area:
.chat-output-box, .chat-output-head-photo-right, .chat-output-head-photo-left, .chat-output-content-right, .chat-output-content-left, .chat-output-meta-left, .chat-output-bubble-right, .chat-output-bubble-left, .chat-output-bubble-inner, .chat-output-bubble-pre-right, .chat-output-bubble-pre-left:
.user-photo, .my-photo, .user-list-block-href, .user-list-block, .user-info, .user-box, .my-name, .my-message:
*/
.page-body { .page-body {
min-width: 800px; min-width: 800px;
height: 100%; height: 100%;

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save