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

Method add

src/main/java/com/controller/YonghuController.java:205–217  ·  view source on GitHub ↗

前端保存

(@RequestBody YonghuEntity yonghu, HttpServletRequest request)

Source from the content-addressed store, hash-verified

203 * 前端保存
204 */
205 @RequestMapping("/add")
206 public R add(@RequestBody YonghuEntity yonghu, HttpServletRequest request){
207 yonghu.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
208 //ValidatorUtils.validateEntity(yonghu);
209 YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("yonghuzhanghao", yonghu.getYonghuzhanghao()));
210 if(user!=null) {
211 return R.error("用户已存在");
212 }
213
214 yonghu.setId(new Date().getTime());
215 yonghuService.insert(yonghu);
216 return R.ok();
217 }
218
219 /**
220 * 修改

Callers 1

remindCountMethod · 0.45

Calls 1

setIdMethod · 0.45

Tested by

no test coverage detected