mirror of
https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
synced 2025-10-30 01:46:18 +08:00
add cancel command
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
package love.sola.netsupport.util;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* ***********************************************
|
||||
* Created by Sola on 2015/12/3.
|
||||
* Don't modify this source without my agreement
|
||||
* ***********************************************
|
||||
*/
|
||||
public class JsonP {
|
||||
|
||||
public static String parse(HttpServletRequest request, String json) {
|
||||
String jsonp = request.getParameter("jsonp");
|
||||
if (jsonp == null || jsonp.isEmpty())
|
||||
return json;
|
||||
else
|
||||
return jsonp.replace("{0}", json);
|
||||
}
|
||||
|
||||
}
|
||||
42
src/main/java/love/sola/netsupport/util/ParseUtil.java
Normal file
42
src/main/java/love/sola/netsupport/util/ParseUtil.java
Normal file
@@ -0,0 +1,42 @@
|
||||
package love.sola.netsupport.util;
|
||||
|
||||
import love.sola.netsupport.enums.Status;
|
||||
import love.sola.netsupport.pojo.Ticket;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import static love.sola.netsupport.config.Lang.lang;
|
||||
|
||||
/**
|
||||
* ***********************************************
|
||||
* Created by Sola on 2015/12/11.
|
||||
* Don't modify this source without my agreement
|
||||
* ***********************************************
|
||||
*/
|
||||
public class ParseUtil {
|
||||
|
||||
public static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm EEE");
|
||||
|
||||
public static String parseTicket(Ticket t) {
|
||||
StringBuilder sb = new StringBuilder()
|
||||
.append(lang("Ticket_Info_Id")).append(t.getId()).append("\n")
|
||||
.append(lang("Ticket_Info_Desc")).append(t.getDescription()).append("\n")
|
||||
.append(lang("Ticket_Info_Submit_Time")).append(dateFormat.format(t.getSubmitTime())).append("\n");
|
||||
if (t.getUpdateTime() != null) {
|
||||
sb.append(lang("Ticket_Info_Operator")).append(t.getOperator().getId()).append("\n");
|
||||
sb.append(lang("Ticket_Info_Remark")).append(t.getRemark()).append("\n");
|
||||
sb.append(lang("Ticket_Info_Update_Time")).append(dateFormat.format(t.getUpdateTime())).append("\n");
|
||||
}
|
||||
sb.append(lang("Ticket_Info_Status")).append(Status.getLocalized(t.getStatus()));
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static String parseJsonP(HttpServletRequest request, String json) {
|
||||
String jsonp = request.getParameter("jsonp");
|
||||
if (jsonp == null || jsonp.isEmpty())
|
||||
return json;
|
||||
else
|
||||
return jsonp.replace("{0}", json);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user