use java reflection to make a lite-restful handler

This commit is contained in:
Sola
2016-03-03 01:37:47 +08:00
parent 4827621cc2
commit d81e9398b3
22 changed files with 446 additions and 771 deletions

View File

@@ -35,7 +35,7 @@ public class LoginHandler implements WxMpMessageHandler {
Operator operator = TableOperator.get(wxMessage.getFromUserName());
if (operator == null)
out.content(lang("Not_Operator"));
else if (operator.getAccess() == Access.NOLOGIN) {
else if (operator.getAccess() >= Access.NO_LOGIN) {
out.content(lang("No_Login"));
} else {
String id = WechatSession.genId();

View File

@@ -31,7 +31,7 @@ public class OperatorInfoHandler implements WxMpMessageHandler {
Operator op = TableOperator.get(wxMessage.getFromUserName());
if (op == null)
out.content(lang("Not_Operator"));
else if (op.getAccess() == Access.NOLOGIN) {
else if (op.getAccess() >= Access.NO_LOGIN) {
out.content(lang("No_Login"));
} else {
out.content(format("Operator_Info", op.getId(), op.getName(), op.getAccess(), op.getBlock(), op.getWeek()));