MCPcopy Create free account
hub / github.com/bsxj97/flower-mall / add

Method add

src/main/java/com/controller/ChatController.java:149–166  ·  view source on GitHub ↗

前端保存

(@RequestBody ChatEntity chat, HttpServletRequest request)

Source from the content-addressed store, hash-verified

147 * 前端保存
148 */
149 @RequestMapping("/add")
150 public R add(@RequestBody ChatEntity chat, HttpServletRequest request){
151 chat.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
152 //ValidatorUtils.validateEntity(chat);
153 chat.setUserid((Long)request.getSession().getAttribute("userId"));
154 if(StringUtils.isNotBlank(chat.getAsk())) {
155 chatService.updateForSet("isreply=0", new EntityWrapper<ChatEntity>().eq("userid", request.getSession().getAttribute("userId")));
156 chat.setUserid((Long)request.getSession().getAttribute("userId"));
157 chat.setIsreply(1);
158 }
159 if(StringUtils.isNotBlank(chat.getReply())) {
160 chatService.updateForSet("isreply=0", new EntityWrapper<ChatEntity>().eq("userid", chat.getUserid()));
161 chat.setAdminid((Long)request.getSession().getAttribute("userId"));
162 }
163
164 chatService.insert(chat);
165 return R.ok();
166 }
167
168 /**
169 * 修改

Callers 6

remindCountMethod · 0.45
matchFaceMethod · 0.45
remindCountMethod · 0.45
AaFunction · 0.45
chainWebpackFunction · 0.45

Calls 4

getReplyMethod · 0.80
setIdMethod · 0.45
setUseridMethod · 0.45
getUseridMethod · 0.45

Tested by

no test coverage detected