mirror of
https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
synced 2025-10-30 18:06:19 +08:00
new operator entity
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package love.sola.netsupport.api;
|
||||
|
||||
import love.sola.netsupport.enums.Block;
|
||||
import love.sola.netsupport.enums.ISP;
|
||||
import love.sola.netsupport.pojo.User;
|
||||
import love.sola.netsupport.sql.TableUser;
|
||||
@@ -38,7 +37,7 @@ public class Register extends HttpServlet {
|
||||
}
|
||||
|
||||
ISP isp = checkISP(request.getParameter("isp"));
|
||||
Block block = checkBlock(request.getParameter("block"));
|
||||
int block = checkBlock(request.getParameter("block"));
|
||||
String result = register(
|
||||
checkStudentId(request.getParameter("sid")),
|
||||
request.getParameter("name"),
|
||||
@@ -60,13 +59,13 @@ public class Register extends HttpServlet {
|
||||
Redirect.message(response, -1, "Illegal_Request");
|
||||
}
|
||||
|
||||
private String register(long sid, String name, ISP isp, String netAccount, Block block, int room, long phone, String wechat) {
|
||||
private String register(long sid, String name, ISP isp, String netAccount, int block, int room, long phone, String wechat) {
|
||||
if (wechat == null) return "Illegal_Request";
|
||||
if (sid == -1) return "Invalid_Student_Id";
|
||||
if (name == null) return "Invalid_Name";
|
||||
if (isp == null) return "Invalid_ISP";
|
||||
if (netAccount == null) return "Invalid_Account";
|
||||
if (block == null) return "Invalid_Block";
|
||||
if (block == -1) return "Invalid_Block";
|
||||
if (room == -1) return "Invalid_Room";
|
||||
if (phone == -1) return "Invalid_Phone_Number";
|
||||
User user = TableUser.getUserById(sid);
|
||||
@@ -122,17 +121,17 @@ public class Register extends HttpServlet {
|
||||
return account;
|
||||
}
|
||||
|
||||
private Block checkBlock(String block) {
|
||||
if (block == null) return null;
|
||||
private int checkBlock(String block) {
|
||||
if (block == null) return -1;
|
||||
try {
|
||||
return Block.fromId(Integer.parseInt(block));
|
||||
return Integer.parseInt(block);
|
||||
} catch (NumberFormatException ignored) {
|
||||
}
|
||||
return null;
|
||||
return -1;
|
||||
}
|
||||
|
||||
private int checkRoom(String room, Block block) {
|
||||
if (block == null) return -1;
|
||||
private int checkRoom(String room, int block) {
|
||||
if (block == -1) return -1;
|
||||
if (room == null) return -1;
|
||||
try {
|
||||
Integer i = Integer.parseInt(room);
|
||||
|
||||
10
src/main/java/love/sola/netsupport/api/TicketCancel.java
Normal file
10
src/main/java/love/sola/netsupport/api/TicketCancel.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package love.sola.netsupport.api;
|
||||
|
||||
/**
|
||||
* ***********************************************
|
||||
* Created by Sola on 2015/12/6.
|
||||
* Don't modify this source without my agreement
|
||||
* ***********************************************
|
||||
*/
|
||||
public class TicketCancel {
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import love.sola.netsupport.wechat.Command;
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.criterion.Order;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
@@ -64,6 +65,7 @@ public class TicketQuery extends HttpServlet {
|
||||
int limit = request.getParameter("limit") == null ? 5 : Integer.parseInt(request.getParameter("limit"));
|
||||
c.setFirstResult(first);
|
||||
c.setMaxResults(limit);
|
||||
c.addOrder(Order.desc(Ticket.PROPERTY_SUBMIT_TIME));
|
||||
c.add(Restrictions.eq(Ticket.PROPERTY_USER, u));
|
||||
if (request.getParameter("status") != null) {
|
||||
c.add(Restrictions.eq(Ticket.PROPERTY_STATUS, Integer.parseInt(request.getParameter("status"))));
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package love.sola.netsupport.api;
|
||||
package love.sola.netsupport.api.admin;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import love.sola.netsupport.api.Response;
|
||||
import love.sola.netsupport.pojo.User;
|
||||
import love.sola.netsupport.sql.SQLCore;
|
||||
import love.sola.netsupport.sql.TableUser;
|
||||
@@ -1,4 +1,4 @@
|
||||
package love.sola.netsupport.api;
|
||||
package love.sola.netsupport.api.test;
|
||||
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.servlet.ServletException;
|
||||
Reference in New Issue
Block a user