Commit 8de7e979 authored by 王琮's avatar 王琮

修改反编译之后的文件

parent fe02e312
/* */ package com.tiptimes.ctrl; //
/* */ // Source code recreated from a .class file by IntelliJ IDEA
/* */ import com.github.pagehelper.PageHelper; // (powered by FernFlower decompiler)
/* */ import com.github.pagehelper.PageInfo; //
/* */ import com.tiptimes.model.ActionLog;
/* */ import com.tiptimes.model.TeamMessage;
/* */ import com.tiptimes.model.UserLogin;
/* */ import com.tiptimes.service.ActionLogService;
/* */ import com.tiptimes.service.TeamMessageService;
/* */ import com.tiptimes.service.UserService;
/* */ import java.io.IOException;
/* */ import java.util.ArrayList;
/* */ import java.util.HashMap;
/* */ import java.util.List;
/* */ import java.util.Map;
/* */ import javax.servlet.http.HttpServletRequest;
/* */ import javax.servlet.http.HttpServletResponse;
/* */ import org.json.JSONObject;
/* */ import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.http.HttpEntity;
/* */ import org.springframework.stereotype.Controller;
/* */ import org.springframework.web.bind.annotation.RequestMapping;
/* */ import org.springframework.web.bind.annotation.ResponseBody;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Controller
/* */ @RequestMapping({"/ActionLog"})
/* */ public class ActionLogCtrl
/* */ {
/* */ @Autowired
/* */ private ActionLogService actionLogServer;
/* */ @Autowired
/* */ private UserService userService;
/* */ @Autowired
/* */ private TeamMessageService teamMessageService;
/* */
/* */ @RequestMapping({"seachActionLog"})
/* */ @ResponseBody
/* */ public Map<String, Object> seachActionLog(String userID, String startTime, String stopTime, HttpServletResponse response, HttpServletRequest request, ActionLog actionLog) throws IOException {
/* 63 */ Map<String, Object> map = new HashMap<>();
/* */
/* 65 */ PageHelper.startPage(actionLog.getStart().intValue() / actionLog.getLength().intValue() + 1, actionLog.getLength().intValue());
/* 66 */ int authorityID = Integer.parseInt(request.getSession().getAttribute("authorityID").toString());
/* 67 */ if (authorityID != 2) {
/* 68 */ map.put("list", new ArrayList());
/* 69 */ return map;
/* */ }
/* 71 */ List<Object> object_temp = new ArrayList();
/* 72 */ List<ActionLog> actionLog_list = this.actionLogServer.listActionLog(userID, startTime, stopTime);
/* 73 */ if (actionLog_list == null) {
/* 74 */ map.put("list", object_temp);
/* 75 */ return map;
/* */ }
/* 77 */ if (actionLog_list != null) {
/* 78 */ for (ActionLog sactionLog_list_i : actionLog_list) {
/* 79 */ Map<String, Object> map_temp_i = new HashMap<>();
/* 80 */ map_temp_i.put("userName", sactionLog_list_i.getUserName());
/* 81 */ map_temp_i.put("time", sactionLog_list_i.getTime());
/* 82 */ map_temp_i.put("remark", sactionLog_list_i.getRemark());
/* 83 */ object_temp.add(map_temp_i);
/* */ }
/* */ }
/* */
/* */
/* 88 */ PageInfo<ActionLog> p = new PageInfo(actionLog_list);
/* 89 */ map.put("aaData", object_temp);
/* 90 */ map.put("recordsFiltered", Integer.valueOf(p.getList().size()));
/* 91 */ map.put("iTotalRecords", Long.valueOf(p.getTotal()));
/* 92 */ map.put("iTotalDisplayRecords", Long.valueOf(p.getTotal()));
/* 93 */ return map;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @RequestMapping({"/getUserByAuthority"})
/* */ @ResponseBody
/* */ public Map<String, Object> getUserByAuthority(HttpServletRequest request, HttpServletResponse response, HttpEntity<String> data) {
/* 108 */ Map<String, Object> map = new HashMap<>();
/* 109 */ int authorityID = Integer.parseInt(request.getSession().getAttribute("authorityID").toString());
/* 110 */ if (authorityID != 2) {
/* 111 */ map.put("list", new ArrayList());
/* 112 */ return map;
/* */ }
/* 114 */ String strData = (String)data.getBody();
/* 115 */ JSONObject jObject = new JSONObject(strData);
/* 116 */ int authority = jObject.getInt("authority");
/* 117 */ List<UserLogin> userLogin_list = this.userService.getUserLoginByAuthority(authority);
/* 118 */ List<Object> object_temp = new ArrayList();
/* 119 */ if (userLogin_list != null) {
/* 120 */ for (UserLogin userLogin_list_i : userLogin_list) {
/* 121 */ Map<String, Object> map_temp_i = new HashMap<>();
/* 122 */ map_temp_i.put("realName", userLogin_list_i.getRealName());
/* 123 */ map_temp_i.put("userID", userLogin_list_i.getUserID());
/* 124 */ object_temp.add(map_temp_i);
/* */ }
/* */ }
/* */
/* */
/* 129 */ map.put("list", object_temp);
/* 130 */ return map;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @RequestMapping({"/getUserBySpaceId"})
/* */ @ResponseBody
/* */ public Map<String, Object> getUserBySpaceId(HttpServletRequest request, HttpServletResponse response, HttpEntity<String> data) {
/* 145 */ Map<String, Object> map = new HashMap<>();
/* 146 */ int authorityID = Integer.parseInt(request.getSession().getAttribute("authorityID").toString());
/* 147 */ if (authorityID != 2) {
/* 148 */ map.put("list", new ArrayList());
/* 149 */ return map;
/* */ }
/* 151 */ String strData = (String)data.getBody();
/* 152 */ JSONObject jObject = new JSONObject(strData);
/* 153 */ String space = jObject.getString("space");
/* 154 */ UserLogin userLogin = this.userService.listUserLoginByUserID(space);
/* 155 */ if (userLogin == null) {
/* 156 */ map.put("list", new ArrayList());
/* 157 */ return map;
/* */ }
/* 159 */ List<TeamMessage> spaceList = this.teamMessageService.listTeamMessageBySpaceMessageID(userLogin.getRealID());
/* 160 */ if (spaceList == null) {
/* 161 */ map.put("list", new ArrayList());
/* 162 */ return map;
/* */ }
/* 164 */ List<Object> object_temp = new ArrayList();
/* 165 */ if (spaceList != null) {
/* 166 */ for (TeamMessage item : spaceList) {
/* 167 */ UserLogin userLogin1 = this.userService.listUserLoginByRealID(item.getTeamMessageID());
/* 168 */ Map<String, Object> map_temp_i = new HashMap<>();
/* 169 */ map_temp_i.put("realName", item.getTeamName());
/* 170 */ map_temp_i.put("userID", userLogin1.getUserID());
/* 171 */ object_temp.add(map_temp_i);
/* */ }
/* */ }
/* */
/* */
/* 176 */ map.put("list", object_temp);
/* 177 */ return map;
/* */ }
/* */ }
package com.tiptimes.ctrl;
/* Location: D:\project\ROOT\WEB-INF\classes\!\com\tiptimes\ctrl\ActionLogCtrl.class import com.github.pagehelper.PageHelper;
* Java compiler version: 7 (51.0) import com.github.pagehelper.PageInfo;
* JD-Core Version: 1.1.3 import com.tiptimes.model.ActionLog;
*/ import com.tiptimes.model.TeamMessage;
\ No newline at end of file import com.tiptimes.model.UserLogin;
import com.tiptimes.service.ActionLogService;
import com.tiptimes.service.TeamMessageService;
import com.tiptimes.service.UserService;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping({"/ActionLog"})
public class ActionLogCtrl {
@Autowired
private ActionLogService actionLogServer;
@Autowired
private UserService userService;
@Autowired
private TeamMessageService teamMessageService;
public ActionLogCtrl() {
}
@RequestMapping({"seachActionLog"})
@ResponseBody
public Map<String, Object> seachActionLog(String userID, String startTime, String stopTime, HttpServletResponse response, HttpServletRequest request, ActionLog actionLog) throws IOException {
Map<String, Object> map = new HashMap();
PageHelper.startPage(actionLog.getStart() / actionLog.getLength() + 1, actionLog.getLength());
int authorityID = Integer.parseInt(request.getSession().getAttribute("authorityID").toString());
if (authorityID != 2) {
map.put("list", new ArrayList());
return map;
} else {
List<Object> object_temp = new ArrayList();
List<ActionLog> actionLog_list = this.actionLogServer.listActionLog(userID, startTime, stopTime);
if (actionLog_list == null) {
map.put("list", object_temp);
return map;
} else {
if (actionLog_list != null) {
Iterator var11 = actionLog_list.iterator();
while(var11.hasNext()) {
ActionLog sactionLog_list_i = (ActionLog)var11.next();
Map<String, Object> map_temp_i = new HashMap();
map_temp_i.put("userName", sactionLog_list_i.getUserName());
map_temp_i.put("time", sactionLog_list_i.getTime());
map_temp_i.put("remark", sactionLog_list_i.getRemark());
object_temp.add(map_temp_i);
}
}
PageInfo<ActionLog> p = new PageInfo(actionLog_list);
map.put("aaData", object_temp);
map.put("recordsFiltered", p.getList().size());
map.put("iTotalRecords", p.getTotal());
map.put("iTotalDisplayRecords", p.getTotal());
return map;
}
}
}
@RequestMapping({"/getUserByAuthority"})
@ResponseBody
public Map<String, Object> getUserByAuthority(HttpServletRequest request, HttpServletResponse response, HttpEntity<String> data) {
Map<String, Object> map = new HashMap();
int authorityID = Integer.parseInt(request.getSession().getAttribute("authorityID").toString());
if (authorityID != 2) {
map.put("list", new ArrayList());
return map;
} else {
String strData = (String)data.getBody();
JSONObject jObject = new JSONObject(strData);
int authority = jObject.getInt("authority");
List<UserLogin> userLogin_list = this.userService.getUserLoginByAuthority(authority);
List<Object> object_temp = new ArrayList();
if (userLogin_list != null) {
Iterator var11 = userLogin_list.iterator();
while(var11.hasNext()) {
UserLogin userLogin_list_i = (UserLogin)var11.next();
Map<String, Object> map_temp_i = new HashMap();
map_temp_i.put("realName", userLogin_list_i.getRealName());
map_temp_i.put("userID", userLogin_list_i.getUserID());
object_temp.add(map_temp_i);
}
}
map.put("list", object_temp);
return map;
}
}
@RequestMapping({"/getUserBySpaceId"})
@ResponseBody
public Map<String, Object> getUserBySpaceId(HttpServletRequest request, HttpServletResponse response, HttpEntity<String> data) {
Map<String, Object> map = new HashMap();
int authorityID = Integer.parseInt(request.getSession().getAttribute("authorityID").toString());
if (authorityID != 2) {
map.put("list", new ArrayList());
return map;
} else {
String strData = (String)data.getBody();
JSONObject jObject = new JSONObject(strData);
String space = jObject.getString("space");
UserLogin userLogin = this.userService.listUserLoginByUserID(space);
if (userLogin == null) {
map.put("list", new ArrayList());
return map;
} else {
List<TeamMessage> spaceList = this.teamMessageService.listTeamMessageBySpaceMessageID(userLogin.getRealID());
if (spaceList == null) {
map.put("list", new ArrayList());
return map;
} else {
List<Object> object_temp = new ArrayList();
if (spaceList != null) {
Iterator var12 = spaceList.iterator();
while(var12.hasNext()) {
TeamMessage item = (TeamMessage)var12.next();
UserLogin userLogin1 = this.userService.listUserLoginByRealID(item.getTeamMessageID());
Map<String, Object> map_temp_i = new HashMap();
map_temp_i.put("realName", item.getTeamName());
map_temp_i.put("userID", userLogin1.getUserID());
object_temp.add(map_temp_i);
}
}
map.put("list", object_temp);
return map;
}
}
}
}
}
/* */ package com.tiptimes.ctrl; //
/* */ // Source code recreated from a .class file by IntelliJ IDEA
/* */ import com.tiptimes.model.Banner; // (powered by FernFlower decompiler)
/* */ import com.tiptimes.model.TopSpaceAppearance; //
/* */ import com.tiptimes.service.ActionLogService;
/* */ import com.tiptimes.service.BannerService;
/* */ import com.tiptimes.service.SpaceMessageService;
/* */ import com.tiptimes.util.UUIDUtils;
/* */ import java.util.HashMap;
/* */ import java.util.Map;
/* */ import javax.servlet.http.HttpServletRequest;
/* */ import javax.servlet.http.HttpServletResponse;
/* */ import org.json.JSONObject;
/* */ import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.http.HttpEntity;
/* */ import org.springframework.stereotype.Controller;
/* */ import org.springframework.web.bind.annotation.RequestMapping;
/* */ import org.springframework.web.bind.annotation.ResponseBody;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Controller
/* */ @RequestMapping({"/Banner"})
/* */ public class BannerCtrl
/* */ {
/* */ @Autowired
/* */ private BannerService bannerService;
/* */ @Autowired
/* */ private ActionLogService actionLoginServer;
/* */ @Autowired
/* */ private SpaceMessageService spaceMessageService;
/* */
/* */ @RequestMapping({"/saveBanner"})
/* */ @ResponseBody
/* */ public Map<String, Object> saveBanner(HttpServletRequest request, HttpServletResponse response, HttpEntity<String> data) {
/* 67 */ String userID = request.getSession().getAttribute("userID").toString();
/* 68 */ String userName = request.getSession().getAttribute("userName").toString();
/* 69 */ Map<String, Object> map = new HashMap<>();
/* 70 */ int authorityID = Integer.parseInt(request.getSession().getAttribute("authorityID").toString());
/* 71 */ if (authorityID != 2 && authorityID != 1) {
/* 72 */ map.put("result", Boolean.valueOf(false));
/* 73 */ map.put("msg", "无权限!");
/* 74 */ this.actionLoginServer.saveActionLog(userID, userName, "保存前端banner,结果:无权限", "");
/* 75 */ return map;
/* */ }
/* 77 */ String strData = (String)data.getBody();
/* 78 */ JSONObject jObject = new JSONObject(strData);
/* */ try {
/* 80 */ String img = jObject.getString("img");
/* 81 */ Banner banner = this.bannerService.listBannerByUserID(userID);
/* 82 */ if (banner != null) {
/* 83 */ banner.setImg(img);
/* 84 */ this.bannerService.updateBanner(banner);
/* */ } else {
/* 86 */ banner = new Banner();
/* 87 */ banner.setId(UUIDUtils.getUUID());
/* 88 */ banner.setImg(img);
/* 89 */ banner.setUrl("");
/* 90 */ banner.setUserID(userID);
/* 91 */ this.bannerService.saveBanner(banner);
/* */ }
/* */
/* 94 */ this.actionLoginServer.saveActionLog(userID, userName, "保存前端banner,结果:保存成功", banner.getId());
/* 95 */ map.put("result", Boolean.valueOf(true));
/* 96 */ map.put("msg", "保存成功!");
/* 97 */ } catch (Exception e) {
/* 98 */ map.put("result", Boolean.valueOf(false));
/* 99 */ map.put("msg", "保存失败!");
/* 100 */ this.actionLoginServer.saveActionLog(userID, userName, "保存前端banner,结果:保存失败", "");
/* */ }
/* */
/* 103 */ return map;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @RequestMapping({"/getOneBanner"})
/* */ @ResponseBody
/* */ public Map<String, Object> getOneBanner(HttpServletRequest request, HttpServletResponse response, HttpEntity<String> data) {
/* 117 */ Map<String, Object> map = new HashMap<>();
/* 118 */ String userID = request.getSession().getAttribute("userID").toString();
/* 119 */ Banner banner = this.bannerService.listBannerByUserID(userID);
/* 120 */ map.put("banner", banner);
/* 121 */ return map;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @RequestMapping({"/saveTopSpaceAppearance"})
/* */ @ResponseBody
/* */ public Map<String, Object> saveTopSpaceAppearance(HttpServletRequest request, HttpServletResponse response, HttpEntity<String> data) {
/* 136 */ String userID = request.getSession().getAttribute("userID").toString();
/* 137 */ String userName = request.getSession().getAttribute("userName").toString();
/* 138 */ Map<String, Object> map = new HashMap<>();
/* 139 */ int authorityID = Integer.parseInt(request.getSession().getAttribute("authorityID").toString());
/* 140 */ if (authorityID != 1) {
/* 141 */ map.put("result", Boolean.valueOf(false));
/* 142 */ map.put("msg", "无权限!");
/* 143 */ this.actionLoginServer.saveActionLog(userID, userName, "保存前端空间外观,结果:无权限", "");
/* 144 */ return map;
/* */ }
/* 146 */ String strData = (String)data.getBody();
/* 147 */ JSONObject jObject = new JSONObject(strData);
/* */ try {
/* 149 */ String img = jObject.getString("img");
/* 150 */ String selectColor = jObject.getString("selectColor");
/* 151 */ String fontcolor = jObject.getString("fontcolor");
/* 152 */ String tell = jObject.getString("tell");
/* 153 */ String address = jObject.getString("address");
/* 154 */ TopSpaceAppearance topSpaceAppearance = this.bannerService.listTopSpaceAppearanceByUserID(userID);
/* 155 */ if (topSpaceAppearance != null) {
/* 156 */ topSpaceAppearance.setImg(img);
/* 157 */ topSpaceAppearance.setFontColor(fontcolor);
/* 158 */ topSpaceAppearance.setSelectColor(selectColor);
/* 159 */ topSpaceAppearance.setAddress(address);
/* 160 */ topSpaceAppearance.setTell(tell);
/* 161 */ this.bannerService.updateTopSpaceAppearance(topSpaceAppearance);
/* */ } else {
/* 163 */ topSpaceAppearance = new TopSpaceAppearance();
/* 164 */ topSpaceAppearance.setId(UUIDUtils.getUUID());
/* 165 */ topSpaceAppearance.setImg(img);
/* 166 */ topSpaceAppearance.setFontColor(fontcolor);
/* 167 */ topSpaceAppearance.setSelectColor(selectColor);
/* 168 */ topSpaceAppearance.setUserID(userID);
/* 169 */ topSpaceAppearance.setAddress(address);
/* 170 */ topSpaceAppearance.setTell(tell);
/* 171 */ this.bannerService.saveTopSpaceAppearance(topSpaceAppearance);
/* */ }
/* */
/* 174 */ this.actionLoginServer.saveActionLog(userID, userName, "保存前端空间外观,结果:保存成功", topSpaceAppearance.getId());
/* 175 */ map.put("result", Boolean.valueOf(true));
/* 176 */ map.put("msg", "保存成功!");
/* 177 */ } catch (Exception e) {
/* 178 */ map.put("result", Boolean.valueOf(false));
/* 179 */ map.put("msg", "保存失败!");
/* 180 */ this.actionLoginServer.saveActionLog(userID, userName, "保存前端空间外观,结果:保存失败", "");
/* */ }
/* */
/* 183 */ return map;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @RequestMapping({"/getOneTopSpaceAppearance"})
/* */ @ResponseBody
/* */ public Map<String, Object> getOneTopSpaceAppearance(HttpServletRequest request, HttpServletResponse response, HttpEntity<String> data) {
/* 197 */ Map<String, Object> map = new HashMap<>();
/* 198 */ String userID = request.getSession().getAttribute("userID").toString();
/* 199 */ TopSpaceAppearance topSpaceAppearance = this.bannerService.listTopSpaceAppearanceByUserID(userID);
/* */
/* 201 */ map.put("topSpaceAppearance", topSpaceAppearance);
/* 202 */ return map;
/* */ }
/* */ }
package com.tiptimes.ctrl;
/* Location: D:\project\ROOT\WEB-INF\classes\!\com\tiptimes\ctrl\BannerCtrl.class import com.tiptimes.model.Banner;
* Java compiler version: 7 (51.0) import com.tiptimes.model.TopSpaceAppearance;
* JD-Core Version: 1.1.3 import com.tiptimes.service.ActionLogService;
*/ import com.tiptimes.service.BannerService;
\ No newline at end of file import com.tiptimes.service.SpaceMessageService;
import com.tiptimes.util.UUIDUtils;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping({"/Banner"})
public class BannerCtrl {
@Autowired
private BannerService bannerService;
@Autowired
private ActionLogService actionLoginServer;
@Autowired
private SpaceMessageService spaceMessageService;
public BannerCtrl() {
}
@RequestMapping({"/saveBanner"})
@ResponseBody
public Map<String, Object> saveBanner(HttpServletRequest request, HttpServletResponse response, HttpEntity<String> data) {
String userID = request.getSession().getAttribute("userID").toString();
String userName = request.getSession().getAttribute("userName").toString();
Map<String, Object> map = new HashMap();
int authorityID = Integer.parseInt(request.getSession().getAttribute("authorityID").toString());
if (authorityID != 2 && authorityID != 1) {
map.put("result", false);
map.put("msg", "无权限!");
this.actionLoginServer.saveActionLog(userID, userName, "保存前端banner,结果:无权限", "");
return map;
} else {
String strData = (String)data.getBody();
JSONObject jObject = new JSONObject(strData);
try {
String img = jObject.getString("img");
Banner banner = this.bannerService.listBannerByUserID(userID);
if (banner != null) {
banner.setImg(img);
this.bannerService.updateBanner(banner);
} else {
banner = new Banner();
banner.setId(UUIDUtils.getUUID());
banner.setImg(img);
banner.setUrl("");
banner.setUserID(userID);
this.bannerService.saveBanner(banner);
}
this.actionLoginServer.saveActionLog(userID, userName, "保存前端banner,结果:保存成功", banner.getId());
map.put("result", true);
map.put("msg", "保存成功!");
} catch (Exception var12) {
map.put("result", false);
map.put("msg", "保存失败!");
this.actionLoginServer.saveActionLog(userID, userName, "保存前端banner,结果:保存失败", "");
}
return map;
}
}
@RequestMapping({"/getOneBanner"})
@ResponseBody
public Map<String, Object> getOneBanner(HttpServletRequest request, HttpServletResponse response, HttpEntity<String> data) {
Map<String, Object> map = new HashMap();
String userID = request.getSession().getAttribute("userID").toString();
Banner banner = this.bannerService.listBannerByUserID(userID);
map.put("banner", banner);
return map;
}
@RequestMapping({"/saveTopSpaceAppearance"})
@ResponseBody
public Map<String, Object> saveTopSpaceAppearance(HttpServletRequest request, HttpServletResponse response, HttpEntity<String> data) {
String userID = request.getSession().getAttribute("userID").toString();
String userName = request.getSession().getAttribute("userName").toString();
Map<String, Object> map = new HashMap();
int authorityID = Integer.parseInt(request.getSession().getAttribute("authorityID").toString());
if (authorityID != 1) {
map.put("result", false);
map.put("msg", "无权限!");
this.actionLoginServer.saveActionLog(userID, userName, "保存前端空间外观,结果:无权限", "");
return map;
} else {
String strData = (String)data.getBody();
JSONObject jObject = new JSONObject(strData);
try {
String img = jObject.getString("img");
String selectColor = jObject.getString("selectColor");
String fontcolor = jObject.getString("fontcolor");
String tell = jObject.getString("tell");
String address = jObject.getString("address");
TopSpaceAppearance topSpaceAppearance = this.bannerService.listTopSpaceAppearanceByUserID(userID);
if (topSpaceAppearance != null) {
topSpaceAppearance.setImg(img);
topSpaceAppearance.setFontColor(fontcolor);
topSpaceAppearance.setSelectColor(selectColor);
topSpaceAppearance.setAddress(address);
topSpaceAppearance.setTell(tell);
this.bannerService.updateTopSpaceAppearance(topSpaceAppearance);
} else {
topSpaceAppearance = new TopSpaceAppearance();
topSpaceAppearance.setId(UUIDUtils.getUUID());
topSpaceAppearance.setImg(img);
topSpaceAppearance.setFontColor(fontcolor);
topSpaceAppearance.setSelectColor(selectColor);
topSpaceAppearance.setUserID(userID);
topSpaceAppearance.setAddress(address);
topSpaceAppearance.setTell(tell);
this.bannerService.saveTopSpaceAppearance(topSpaceAppearance);
}
this.actionLoginServer.saveActionLog(userID, userName, "保存前端空间外观,结果:保存成功", topSpaceAppearance.getId());
map.put("result", true);
map.put("msg", "保存成功!");
} catch (Exception var16) {
map.put("result", false);
map.put("msg", "保存失败!");
this.actionLoginServer.saveActionLog(userID, userName, "保存前端空间外观,结果:保存失败", "");
}
return map;
}
}
@RequestMapping({"/getOneTopSpaceAppearance"})
@ResponseBody
public Map<String, Object> getOneTopSpaceAppearance(HttpServletRequest request, HttpServletResponse response, HttpEntity<String> data) {
Map<String, Object> map = new HashMap();
String userID = request.getSession().getAttribute("userID").toString();
TopSpaceAppearance topSpaceAppearance = this.bannerService.listTopSpaceAppearanceByUserID(userID);
map.put("topSpaceAppearance", topSpaceAppearance);
return map;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment