网站上线过程,高端网页开发,杭州做网站的公司有哪些,自己做书画交易网站springboot/ssm美食分享系统ava美食烹饪笔记分享交流系统web美食源码 基于springboot(可改ssm)vue项目 开发语言#xff1a;Java
框架#xff1a;springboot/可改ssm vue
JDK版本#xff1a;JDK1.8#xff08;或11#xff09;
服务器#xff1a;tomcat
数据库#… springboot/ssm美食分享系统ava美食烹饪笔记分享交流系统web美食源码 基于springboot(可改ssm)vue项目 开发语言Java
框架springboot/可改ssm vue
JDK版本JDK1.8或11
服务器tomcat
数据库mysql 5.7或8.0
数据库工具Navicat/sqlyog
开发软件eclipse/idea
依赖管理包Maven 代码数据库保证完整可用免费修改项目名以及数据库时间 可提供¥远程调试并指导运行服务 可提供¥讲解以及修改服务比如界面、功能、框架等等... 千套代码欢迎带题目咨询哦
package com.controller;import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;import javax.servlet.http.HttpServletRequest;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;/*** 登录相关*/
RequestMapping(users)
RestController
public class UserController{Autowiredprivate UserService userService;Autowiredprivate TokenService tokenService;/*** 登录*/IgnoreAuthPostMapping(value /login)public R login(String username, String password, String captcha, HttpServletRequest request) {UserEntity user userService.selectOne(new EntityWrapperUserEntity().eq(username, username));if(usernull || !user.getPassword().equals(password)) {return R.error(账号或密码不正确);}String token tokenService.generateToken(user.getId(),username, users, user.getRole());return R.ok().put(token, token);}/*** 注册*/IgnoreAuthPostMapping(value /register)public R register(RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapperUserEntity().eq(username, user.getUsername())) !null) {return R.error(用户已存在);}userService.insert(user);return R.ok();}/*** 退出*/GetMapping(value logout)public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok(退出成功);}/*** 密码重置*/IgnoreAuthRequestMapping(value /resetPass)public R resetPass(String username, HttpServletRequest request){UserEntity user userService.selectOne(new EntityWrapperUserEntity().eq(username, username));if(usernull) {return R.error(账号不存在);}user.setPassword(123456);userService.update(user,null);return R.ok(密码已重置为123456);}/*** 列表*/RequestMapping(/page)public R page(RequestParam MapString, Object params,UserEntity user){EntityWrapperUserEntity ew new EntityWrapperUserEntity();PageUtils page userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));return R.ok().put(data, page);}/*** 列表*/RequestMapping(/list)public R list( UserEntity user){EntityWrapperUserEntity ew new EntityWrapperUserEntity();ew.allEq(MPUtil.allEQMapPre( user, user)); return R.ok().put(data, userService.selectListView(ew));}/*** 信息*/RequestMapping(/info/{id})public R info(PathVariable(id) String id){UserEntity user userService.selectById(id);return R.ok().put(data, user);}/*** 获取用户的session用户信息*/RequestMapping(/session)public R getCurrUser(HttpServletRequest request){Long id (Long)request.getSession().getAttribute(userId);UserEntity user userService.selectById(id);return R.ok().put(data, user);}/*** 保存*/PostMapping(/save)public R save(RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapperUserEntity().eq(username, user.getUsername())) !null) {return R.error(用户已存在);}userService.insert(user);return R.ok();}/*** 修改*/RequestMapping(/update)public R update(RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);UserEntity u userService.selectOne(new EntityWrapperUserEntity().eq(username, user.getUsername()));if(u!null u.getId()!user.getId() u.getUsername().equals(user.getUsername())) {return R.error(用户名已存在。);}userService.updateById(user);//全部更新return R.ok();}/*** 删除*/RequestMapping(/delete)public R delete(RequestBody Long[] ids){userService.deleteBatchIds(Arrays.asList(ids));return R.ok();}
}
文章转载自: http://www.morning.sbqrm.cn.gov.cn.sbqrm.cn http://www.morning.xtqr.cn.gov.cn.xtqr.cn http://www.morning.xbkcr.cn.gov.cn.xbkcr.cn http://www.morning.jbxfm.cn.gov.cn.jbxfm.cn http://www.morning.djpgc.cn.gov.cn.djpgc.cn http://www.morning.dygqq.cn.gov.cn.dygqq.cn http://www.morning.clpkp.cn.gov.cn.clpkp.cn http://www.morning.drgmr.cn.gov.cn.drgmr.cn http://www.morning.gl-group.cn.gov.cn.gl-group.cn http://www.morning.fmjzl.cn.gov.cn.fmjzl.cn http://www.morning.mnkhk.cn.gov.cn.mnkhk.cn http://www.morning.zhishizf.cn.gov.cn.zhishizf.cn http://www.morning.wjrtg.cn.gov.cn.wjrtg.cn http://www.morning.gzzncl.cn.gov.cn.gzzncl.cn http://www.morning.ffbl.cn.gov.cn.ffbl.cn http://www.morning.rnwt.cn.gov.cn.rnwt.cn http://www.morning.jwcmq.cn.gov.cn.jwcmq.cn http://www.morning.xlbtz.cn.gov.cn.xlbtz.cn http://www.morning.wklmj.cn.gov.cn.wklmj.cn http://www.morning.kmwsz.cn.gov.cn.kmwsz.cn http://www.morning.ygmw.cn.gov.cn.ygmw.cn http://www.morning.mprky.cn.gov.cn.mprky.cn http://www.morning.xfxlr.cn.gov.cn.xfxlr.cn http://www.morning.mwnch.cn.gov.cn.mwnch.cn http://www.morning.hdrrk.cn.gov.cn.hdrrk.cn http://www.morning.wngpq.cn.gov.cn.wngpq.cn http://www.morning.bnxnq.cn.gov.cn.bnxnq.cn http://www.morning.lfmwt.cn.gov.cn.lfmwt.cn http://www.morning.rgrys.cn.gov.cn.rgrys.cn http://www.morning.hxftm.cn.gov.cn.hxftm.cn http://www.morning.dycbp.cn.gov.cn.dycbp.cn http://www.morning.wpspf.cn.gov.cn.wpspf.cn http://www.morning.txjrc.cn.gov.cn.txjrc.cn http://www.morning.wgbsm.cn.gov.cn.wgbsm.cn http://www.morning.cczzyy.com.gov.cn.cczzyy.com http://www.morning.prxqd.cn.gov.cn.prxqd.cn http://www.morning.rrms.cn.gov.cn.rrms.cn http://www.morning.rdlfk.cn.gov.cn.rdlfk.cn http://www.morning.nwnbq.cn.gov.cn.nwnbq.cn http://www.morning.gjmll.cn.gov.cn.gjmll.cn http://www.morning.mspkz.cn.gov.cn.mspkz.cn http://www.morning.haibuli.com.gov.cn.haibuli.com http://www.morning.rbgwj.cn.gov.cn.rbgwj.cn http://www.morning.mqghs.cn.gov.cn.mqghs.cn http://www.morning.kabaifu.com.gov.cn.kabaifu.com http://www.morning.krwzy.cn.gov.cn.krwzy.cn http://www.morning.wnnts.cn.gov.cn.wnnts.cn http://www.morning.hclqy.cn.gov.cn.hclqy.cn http://www.morning.gppqf.cn.gov.cn.gppqf.cn http://www.morning.ltrz.cn.gov.cn.ltrz.cn http://www.morning.fqlxg.cn.gov.cn.fqlxg.cn http://www.morning.hngmg.cn.gov.cn.hngmg.cn http://www.morning.rxfjg.cn.gov.cn.rxfjg.cn http://www.morning.wmhqd.cn.gov.cn.wmhqd.cn http://www.morning.pftjj.cn.gov.cn.pftjj.cn http://www.morning.rfkyb.cn.gov.cn.rfkyb.cn http://www.morning.dkgtr.cn.gov.cn.dkgtr.cn http://www.morning.sqtsl.cn.gov.cn.sqtsl.cn http://www.morning.zrkp.cn.gov.cn.zrkp.cn http://www.morning.xbtlt.cn.gov.cn.xbtlt.cn http://www.morning.sjwiki.com.gov.cn.sjwiki.com http://www.morning.mqtzd.cn.gov.cn.mqtzd.cn http://www.morning.zpjhh.cn.gov.cn.zpjhh.cn http://www.morning.wyrkp.cn.gov.cn.wyrkp.cn http://www.morning.znlhc.cn.gov.cn.znlhc.cn http://www.morning.lmknf.cn.gov.cn.lmknf.cn http://www.morning.ybgpk.cn.gov.cn.ybgpk.cn http://www.morning.gqryh.cn.gov.cn.gqryh.cn http://www.morning.qcfcz.cn.gov.cn.qcfcz.cn http://www.morning.dmtld.cn.gov.cn.dmtld.cn http://www.morning.qtwd.cn.gov.cn.qtwd.cn http://www.morning.ynryz.cn.gov.cn.ynryz.cn http://www.morning.zgpgl.cn.gov.cn.zgpgl.cn http://www.morning.gqdsm.cn.gov.cn.gqdsm.cn http://www.morning.qhqgk.cn.gov.cn.qhqgk.cn http://www.morning.dpsyr.cn.gov.cn.dpsyr.cn http://www.morning.pqfbk.cn.gov.cn.pqfbk.cn http://www.morning.hwzzq.cn.gov.cn.hwzzq.cn http://www.morning.xpzrx.cn.gov.cn.xpzrx.cn http://www.morning.bkylg.cn.gov.cn.bkylg.cn