Compare commits

...

1 Commits
main ... lsf

Author SHA1 Message Date
lsf d2929be5b4 first
3 weeks ago

@ -0,0 +1,66 @@
package com.controller;
import com.annotation.IgnoreAuth;
import com.entity.Users;
import com.service.UsersService;
import com.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.HashMap;
/**
* @ClassName LoginController
* @Description
*/
@RestController
public class LoginController {
@Autowired
private UsersService usersService;
//登陆验证
@IgnoreAuth
@RequestMapping("/login")
@ResponseBody
public ApiResponse verify(HttpServletRequest request, String loginpw, String type, String loginname) {
String result = "";
Users users = new Users();
users.setLoginname(loginname);
users.setLoginpw(Md5Util.strToMd5(loginpw));
if (null != type && !type.equals("")) {
users.setType(type);
}
users = usersService.findOneByEqualTo(users);
if (null == users || null == users.getId() || users.getId() == 0) {
//返回登录失败
result = "用户名或密码错误";
return ApiResponse.failed(result);
} else {
// if (null == users.getShenhe() || (!users.getShenhe().toLowerCase().equals("yes") && !users.getShenhe().equals("是"))) {
// //未审核返回登录失败
// result = "用户未通过审核,请及时联系管理员处理";
// return ApiResponse.failed(result);
// }
//返回登录成功
String token = CommonUtil.getRandomString(32);
System.out.println("生成token:" + token);
HttpSession session = request.getSession();
session.setAttribute("usersType", users.getType());
session.setAttribute("usersId", users.getId());
session.setAttribute("users", users);
session.setAttribute("token", token);
//session有效时间单位为秒-1表示当前会话内一直有效
session.setMaxInactiveInterval(-1);
HashMap<String,String> loginSuccess=new HashMap<>();
loginSuccess.put("token",token);
loginSuccess.put("usersId",users.getId().toString());
return ApiResponse.success(loginSuccess);
}
}
}

@ -0,0 +1,18 @@
package com.util;
import cn.hutool.crypto.digest.DigestUtil;
/**
* Md5
*/
public class Md5Util {
/**
* @param text
* @return
*/
public static String strToMd5(String text) {
// 加密后的字符串
text = DigestUtil.md5Hex(text);
return text;
}
}

@ -0,0 +1,262 @@
package com.entity;
/**
* @ClassName Shangpin
* @Description
*/
public class Shangpin {
//id列
private Integer id;
//名称
private String mingcheng;
//编号
private String bianhao;
//分类id
private Integer pinleiid;
//内容介绍
private String neirong;
//图片
private String image;
//原价
private Integer yuanshijiage;
//现价
private Integer jiage;
//单位
private String danwei;
//是否特价
private String shenhe;
//库存数量
private Integer kucunshuliang;
//销售数量
private Integer xiaoshoushuliang;
//父表分类表pinlei
private Pinlei pinlei;
/**
* id
*
* @return id id
*/
public Integer getId() {
return this.id;
}
/**
* id
*
* @param id id
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*
* @return mingcheng
*/
public String getMingcheng() {
return this.mingcheng;
}
/**
*
*
* @param mingcheng
*/
public void setMingcheng(String mingcheng) {
this.mingcheng = mingcheng;
}
/**
*
*
* @return bianhao
*/
public String getBianhao() {
return this.bianhao;
}
/**
*
*
* @param bianhao
*/
public void setBianhao(String bianhao) {
this.bianhao = bianhao;
}
/**
* id
*
* @return pinleiid id
*/
public Integer getPinleiid() {
return this.pinleiid;
}
/**
* id
*
* @param pinleiid id
*/
public void setPinleiid(Integer pinleiid) {
this.pinleiid = pinleiid;
}
/**
*
*
* @return neirong
*/
public String getNeirong() {
return this.neirong;
}
/**
*
*
* @param neirong
*/
public void setNeirong(String neirong) {
this.neirong = neirong;
}
/**
*
*
* @return image
*/
public String getImage() {
return this.image;
}
/**
*
*
* @param image
*/
public void setImage(String image) {
this.image = image;
}
/**
*
*
* @return yuanshijiage
*/
public Integer getYuanshijiage() {
return this.yuanshijiage;
}
/**
*
*
* @param yuanshijiage
*/
public void setYuanshijiage(Integer yuanshijiage) {
this.yuanshijiage = yuanshijiage;
}
/**
*
*
* @return jiage
*/
public Integer getJiage() {
return this.jiage;
}
/**
*
*
* @param jiage
*/
public void setJiage(Integer jiage) {
this.jiage = jiage;
}
/**
*
*
* @return danwei
*/
public String getDanwei() {
return this.danwei;
}
/**
*
*
* @param danwei
*/
public void setDanwei(String danwei) {
this.danwei = danwei;
}
/**
*
*
* @return shenhe
*/
public String getShenhe() {
return this.shenhe;
}
/**
*
*
* @param shenhe
*/
public void setShenhe(String shenhe) {
this.shenhe = shenhe;
}
/**
*
*
* @return kucunshuliang
*/
public Integer getKucunshuliang() {
return this.kucunshuliang;
}
/**
*
*
* @param kucunshuliang
*/
public void setKucunshuliang(Integer kucunshuliang) {
this.kucunshuliang = kucunshuliang;
}
/**
*
*
* @return xiaoshoushuliang
*/
public Integer getXiaoshoushuliang() {
return this.xiaoshoushuliang;
}
/**
*
*
* @param xiaoshoushuliang
*/
public void setXiaoshoushuliang(Integer xiaoshoushuliang) {
this.xiaoshoushuliang = xiaoshoushuliang;
}
/**
* pinlei
*
* @return pinlei pinlei
*/
public Pinlei getPinlei() {
return this.pinlei;
}
/**
* pinlei
*
* @param pinlei pinlei
*/
public void setPinlei(Pinlei pinlei) {
this.pinlei = pinlei;
}
}

@ -0,0 +1,178 @@
package com.controller;
import com.annotation.IgnoreAuth;
import com.entity.*;
import com.service.*;
import com.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
/**
* @ClassName ShangpinController
* @Description
*/
@RequestMapping("shangpin")
@RestController
public class ShangpinController {
@Autowired
private ShangpinService shangpinService;
//前台-根据条件获取零食列表分页数据接口
@IgnoreAuth
@RequestMapping("/manaqian")
public ApiResponse<Shangpin> manaQian(Shangpin req, @RequestParam(defaultValue = "1", value = "pageNo") int pageNo, @RequestParam(defaultValue = "10", value = "pageSize") int pageSize, @RequestParam(defaultValue = "id", value = "sortProperty") String sortProperty) {
PageData<Shangpin> shangpinList = getPageList(req, pageNo, pageSize, sortProperty);
return ApiResponse.success(shangpinList);
}
//前台-根据条件获取我的零食列表分页数据接口
@RequestMapping("/manamyqian")
public ApiResponse<Shangpin> manaMyQian(Shangpin req, @RequestParam(defaultValue = "1", value = "pageNo") int pageNo, @RequestParam(defaultValue = "10", value = "pageSize") int pageSize, @RequestParam(defaultValue = "id", value = "sortProperty") String sortProperty) {
PageData<Shangpin> shangpinList = getPageList(req, pageNo, pageSize, sortProperty);
return ApiResponse.success(shangpinList);
}
//前台-根据条件获取零食图片列表分页数据接口
@IgnoreAuth
@RequestMapping("/manaqiantp")
public ApiResponse<Shangpin> manaQianTp(Shangpin req, @RequestParam(defaultValue = "1", value = "pageNo") int pageNo, @RequestParam(defaultValue = "10", value = "pageSize") int pageSize, @RequestParam(defaultValue = "id", value = "sortProperty") String sortProperty) {
PageData<Shangpin> shangpinList = getPageList(req, pageNo, pageSize, sortProperty);
return ApiResponse.success(shangpinList);
}
//前台-零食详情
@IgnoreAuth
@RequestMapping("/detail/{id}")
public ApiResponse<Shangpin> detail(@PathVariable("id") Integer id) {
Shangpin info = shangpinService.findById(id);
return ApiResponse.success(info);
}
//前台-零食添加接口
@PostMapping("/add")
public ApiResponse<Integer> add(@RequestBody Shangpin req) {
int result = shangpinService.saveOrUpdate(req);
return ApiResponse.success(result);
}
//后台-根据条件获取零食管理列表分页数据接口
@RequestMapping("/mana")
public ApiResponse<Shangpin> mana(Shangpin req, @RequestParam(defaultValue = "1", value = "pageNo") int pageNo, @RequestParam(defaultValue = "10", value = "pageSize") int pageSize, @RequestParam(defaultValue = "id", value = "sortProperty") String sortProperty) {
PageData<Shangpin> shangpinList = getPageList(req, pageNo, pageSize, sortProperty);
return ApiResponse.success(shangpinList);
}
//后台-根据条件获取零食管理我的列表分页数据接口
@RequestMapping("/manamy")
public ApiResponse<Shangpin> manaMy(Shangpin req, @RequestParam(defaultValue = "1", value = "pageNo") int pageNo, @RequestParam(defaultValue = "10", value = "pageSize") int pageSize, @RequestParam(defaultValue = "id", value = "sortProperty") String sortProperty) {
PageData<Shangpin> shangpinList = getPageList(req, pageNo, pageSize, sortProperty);
return ApiResponse.success(shangpinList);
}
//后台-根据条件获取零食查看列表分页数据接口
@RequestMapping("/chakan")
public ApiResponse<Shangpin> chakan(Shangpin req, @RequestParam(defaultValue = "1", value = "pageNo") int pageNo, @RequestParam(defaultValue = "10", value = "pageSize") int pageSize, @RequestParam(defaultValue = "id", value = "sortProperty") String sortProperty) {
PageData<Shangpin> shangpinList = getPageList(req, pageNo, pageSize, sortProperty);
return ApiResponse.success(shangpinList);
}
//后台-根据条件获取零食查看我的列表分页数据接口
@RequestMapping("/chakanmy")
public ApiResponse<Shangpin> chakanMy(Shangpin req, @RequestParam(defaultValue = "1", value = "pageNo") int pageNo, @RequestParam(defaultValue = "10", value = "pageSize") int pageSize, @RequestParam(defaultValue = "id", value = "sortProperty") String sortProperty) {
PageData<Shangpin> shangpinList = getPageList(req, pageNo, pageSize, sortProperty);
return ApiResponse.success(shangpinList);
}
//后台-零食详情
@RequestMapping("/info/{id}")
public ApiResponse<Shangpin> info(@PathVariable("id") Integer id) {
Shangpin info = shangpinService.findById(id);
return ApiResponse.success(info);
}
//后台-零食添加接口
@PostMapping("/save")
public ApiResponse<Integer> save(@RequestBody Shangpin req) {
int result = shangpinService.saveOrUpdate(req);
return ApiResponse.success(result);
}
//零食删除(含批量删除)接口
@RequestMapping("/delete")
public ApiResponse<Integer> delete(@RequestBody Integer[] ids) {
int result = 0;
for (Integer id : ids) {
result = shangpinService.deleteById(id);
}
return ApiResponse.success(result);
}
//零食修改接口
@PostMapping("/set")
public ApiResponse<Integer> set(@RequestBody Shangpin req) {
int result = shangpinService.saveOrUpdate(req);
return ApiResponse.success(result);
}
//获取所有零食数据接口
@IgnoreAuth
@RequestMapping("/all")
public ApiResponse<Shangpin> shangpinAll() {
List<Shangpin> shangpinList = shangpinService.findAll();
return ApiResponse.success(shangpinList);
}
//根据条件(字符类型模糊匹配查询)获取零食数据接口
@IgnoreAuth
@RequestMapping("/search")
public ApiResponse<Shangpin> shangpinSearch(Shangpin req) {
List<Shangpin> shangpinList = shangpinService.find(req);
return ApiResponse.success(shangpinList);
}
//根据条件(字符类型完全匹配查询)获取零食数据接口
@IgnoreAuth
@RequestMapping("/searchByEqualTo")
public ApiResponse<Shangpin> shangpinSearchByEqualTo(Shangpin req) {
List<Shangpin> shangpinList = shangpinService.findByEqualTo(req);
return ApiResponse.success(shangpinList);
}
//按条件查询零食分页数据方法(模糊匹配查询)
private PageData<Shangpin> getPageList(Shangpin req, int pageNo, int pageSize, String sortProperty) {
PageWrap<Shangpin> pageWrap = getPageWrap(req, pageNo, pageSize, sortProperty);
PageData<Shangpin> shangpinList = shangpinService.findPage(pageWrap);
return shangpinList;
}
//按条件查询零食分页数据方法(完全匹配查询)
private PageData<Shangpin> getPageListByEqualTo(Shangpin req, int pageNo, int pageSize, String sortProperty) {
PageWrap<Shangpin> pageWrap = getPageWrap(req, pageNo, pageSize, sortProperty);
PageData<Shangpin> shangpinList = shangpinService.findPageByEqualTo(pageWrap);
return shangpinList;
}
//获取零食查询数据搜索条件
private PageWrap<Shangpin> getPageWrap(Shangpin req, int pageNo, int pageSize, String sortProperty) {
PageWrap<Shangpin> pageWrap = new PageWrap<>();
pageWrap.setModel(req);
pageWrap.setPageNum(pageNo);
pageWrap.setPageSize(pageSize);
PageWrap.SortData sortData = new PageWrap.SortData();
sortData.setDirection("DESC");
sortData.setProperty(sortProperty);
List<PageWrap.SortData> sorts = new ArrayList<>();
sorts.add(sortData);
pageWrap.setSorts(sorts);
return pageWrap;
}
}

@ -0,0 +1,47 @@
package com.dao;
import com.entity.Shangpin;
import com.entity.ShangpinExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @ClassName ShangpinMapper
* @Description
*/
public interface ShangpinMapper {
//根据条件获取零食表shangpin的数据数量
int countByExample(ShangpinExample example);
//根据条件删除零食表shangpin的数据
int deleteByExample(ShangpinExample example);
//根据主键ID列删除零食表shangpin的数据
int deleteByPrimaryKey(Integer id);
//插入零食表shangpin的实体数据包含null值
int insert(Shangpin record);
//插入零食表shangpin的实体数据不包含null值
int insertSelective(Shangpin record);
//根据条件获取零食表shangpin的数据列表
List<Shangpin> selectByExample(ShangpinExample example);
//根据主键ID列获取零食表shangpin的数据实体
Shangpin selectByPrimaryKey(Integer id);
//根据条件更新零食表shangpin的实体数据不包含null值
int updateByExampleSelective(@Param("record") Shangpin record, @Param("example") ShangpinExample example);
//根据条件更新零食表shangpin的实体数据包含null值
int updateByExample(@Param("record") Shangpin record, @Param("example") ShangpinExample example);
//根据主键ID列更新零食表shangpin的实体数据不包含null值
int updateByPrimaryKeySelective(Shangpin record);
//根据主键ID列更新零食表shangpin的实体数据包含null值
int updateByPrimaryKey(Shangpin record);
}

@ -0,0 +1,44 @@
package com.service;
import com.entity.Shangpin;
import com.util.PageData;
import com.util.PageWrap;
import java.util.List;
/**
* @ClassName ShangpinService
* @Description
*/
public interface ShangpinService {
//保存或更新零食表数据
Integer saveOrUpdate(Shangpin instance);
//查询所有零食表数据
List<Shangpin> findAll();
//根据条件(字符类型模糊)查询零食表数据
List<Shangpin> find(Shangpin instance);
//根据条件(字符类型完全匹配)查询零食表数据
List<Shangpin> findByEqualTo(Shangpin instance);
//根据条件(字符类型模糊)查询查询第一条零食表数据
Shangpin findOne(Shangpin instance);
//根据条件(字符类型完全匹配)查询查询第一条零食表数据
Shangpin findOneByEqualTo(Shangpin instance);
//根据id列查询零食表数据
Shangpin findById(Integer id);
//根据id列删除零食表数据
int deleteById(Integer id);
//根据条件(字符类型模糊)分页查询零食表数据
PageData<Shangpin> findPage(PageWrap<Shangpin> pageWrap);
//根据条件(字符类型完全匹配)分页查询零食表数据
PageData<Shangpin> findPageByEqualTo(PageWrap<Shangpin> pageWrap);
}

@ -0,0 +1,224 @@
package com.entity;
/**
* @ClassName Users
* @Description
*/
public class Users {
//id列
private Integer id;
//用户名称
private String loginname;
//密码
private String loginpw;
//类型
private String type;
//类型名称
private String typename;
//姓名
private String xingming;
//性别
private String xingbie;
//年龄
private String nianling;
//地址
private String address;
//电话
private String dianhua;
//审核
private String shenhe;
/**
* id
*
* @return id id
*/
public Integer getId() {
return this.id;
}
/**
* id
*
* @param id id
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*
* @return loginname
*/
public String getLoginname() {
return this.loginname;
}
/**
*
*
* @param loginname
*/
public void setLoginname(String loginname) {
this.loginname = loginname;
}
/**
*
*
* @return loginpw
*/
public String getLoginpw() {
return this.loginpw;
}
/**
*
*
* @param loginpw
*/
public void setLoginpw(String loginpw) {
this.loginpw = loginpw;
}
/**
*
*
* @return type
*/
public String getType() {
return this.type;
}
/**
*
*
* @param type
*/
public void setType(String type) {
this.type = type;
}
/**
*
*
* @return typename
*/
public String getTypename() {
return this.typename;
}
/**
*
*
* @param typename
*/
public void setTypename(String typename) {
this.typename = typename;
}
/**
*
*
* @return xingming
*/
public String getXingming() {
return this.xingming;
}
/**
*
*
* @param xingming
*/
public void setXingming(String xingming) {
this.xingming = xingming;
}
/**
*
*
* @return xingbie
*/
public String getXingbie() {
return this.xingbie;
}
/**
*
*
* @param xingbie
*/
public void setXingbie(String xingbie) {
this.xingbie = xingbie;
}
/**
*
*
* @return nianling
*/
public String getNianling() {
return this.nianling;
}
/**
*
*
* @param nianling
*/
public void setNianling(String nianling) {
this.nianling = nianling;
}
/**
*
*
* @return address
*/
public String getAddress() {
return this.address;
}
/**
*
*
* @param address
*/
public void setAddress(String address) {
this.address = address;
}
/**
*
*
* @return dianhua
*/
public String getDianhua() {
return this.dianhua;
}
/**
*
*
* @param dianhua
*/
public void setDianhua(String dianhua) {
this.dianhua = dianhua;
}
/**
*
*
* @return shenhe
*/
public String getShenhe() {
return this.shenhe;
}
/**
*
*
* @param shenhe
*/
public void setShenhe(String shenhe) {
this.shenhe = shenhe;
}
}

@ -0,0 +1,247 @@
package com.controller;
import com.annotation.IgnoreAuth;
import com.entity.*;
import com.service.*;
import com.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
/**
* @ClassName UsersController
* @Description
*/
@RequestMapping("users")
@RestController
public class UsersController {
@Autowired
private UsersService usersService;
//前台-根据条件获取用户列表分页数据接口
@IgnoreAuth
@RequestMapping("/manaqian")
public ApiResponse<Users> manaQian(Users req, @RequestParam(defaultValue = "1", value = "pageNo") int pageNo, @RequestParam(defaultValue = "10", value = "pageSize") int pageSize, @RequestParam(defaultValue = "id", value = "sortProperty") String sortProperty) {
PageData<Users> usersList = getPageList(req, pageNo, pageSize, sortProperty);
return ApiResponse.success(usersList);
}
//前台-根据条件获取我的用户列表分页数据接口
@RequestMapping("/manamyqian")
public ApiResponse<Users> manaMyQian(Users req, @RequestParam(defaultValue = "1", value = "pageNo") int pageNo, @RequestParam(defaultValue = "10", value = "pageSize") int pageSize, @RequestParam(defaultValue = "id", value = "sortProperty") String sortProperty) {
PageData<Users> usersList = getPageList(req, pageNo, pageSize, sortProperty);
return ApiResponse.success(usersList);
}
//前台-根据条件获取用户图片列表分页数据接口
@IgnoreAuth
@RequestMapping("/manaqiantp")
public ApiResponse<Users> manaQianTp(Users req, @RequestParam(defaultValue = "1", value = "pageNo") int pageNo, @RequestParam(defaultValue = "10", value = "pageSize") int pageSize, @RequestParam(defaultValue = "id", value = "sortProperty") String sortProperty) {
PageData<Users> usersList = getPageList(req, pageNo, pageSize, sortProperty);
return ApiResponse.success(usersList);
}
//前台-用户详情
@IgnoreAuth
@RequestMapping("/detail/{id}")
public ApiResponse<Users> detail(@PathVariable("id") Integer id) {
Users info = usersService.findById(id);
return ApiResponse.success(info);
}
//前台-用户添加接口
@IgnoreAuth
@PostMapping("/add")
public ApiResponse<Integer> add(@RequestBody Users req) {
if (null == req.getLoginname() || req.getLoginname().equals("")) {
return ApiResponse.failed("用户名loginname不能为空");
}
//判断用户名loginname是否已存在
Users instance = new Users();
instance.setLoginname(req.getLoginname());
instance = usersService.findOneByEqualTo(instance);
if (null != instance && (null == req.getId() || req.getId() == 0) || (null != instance && !instance.getId().equals(req.getId()))) {
return ApiResponse.failed("用户名" + req.getLoginname() + "已存在");
}
if (null != req.getLoginpw() && !req.getLoginpw().equals("")) {
req.setLoginpw(Md5Util.strToMd5(req.getLoginpw()));
} else {
req.setLoginpw(null);
}
int result = usersService.saveOrUpdate(req);
return ApiResponse.success(result);
}
//后台-根据条件获取用户管理列表分页数据接口
@RequestMapping("/mana")
public ApiResponse<Users> mana(Users req, @RequestParam(defaultValue = "1", value = "pageNo") int pageNo, @RequestParam(defaultValue = "10", value = "pageSize") int pageSize, @RequestParam(defaultValue = "id", value = "sortProperty") String sortProperty) {
PageData<Users> usersList = getPageList(req, pageNo, pageSize, sortProperty);
return ApiResponse.success(usersList);
}
//后台-根据条件获取用户管理我的列表分页数据接口
@RequestMapping("/manamy")
public ApiResponse<Users> manaMy(Users req, @RequestParam(defaultValue = "1", value = "pageNo") int pageNo, @RequestParam(defaultValue = "10", value = "pageSize") int pageSize, @RequestParam(defaultValue = "id", value = "sortProperty") String sortProperty) {
PageData<Users> usersList = getPageList(req, pageNo, pageSize, sortProperty);
return ApiResponse.success(usersList);
}
//后台-根据条件获取用户查看列表分页数据接口
@RequestMapping("/chakan")
public ApiResponse<Users> chakan(Users req, @RequestParam(defaultValue = "1", value = "pageNo") int pageNo, @RequestParam(defaultValue = "10", value = "pageSize") int pageSize, @RequestParam(defaultValue = "id", value = "sortProperty") String sortProperty) {
PageData<Users> usersList = getPageList(req, pageNo, pageSize, sortProperty);
return ApiResponse.success(usersList);
}
//后台-根据条件获取用户查看我的列表分页数据接口
@RequestMapping("/chakanmy")
public ApiResponse<Users> chakanMy(Users req, @RequestParam(defaultValue = "1", value = "pageNo") int pageNo, @RequestParam(defaultValue = "10", value = "pageSize") int pageSize, @RequestParam(defaultValue = "id", value = "sortProperty") String sortProperty) {
PageData<Users> usersList = getPageList(req, pageNo, pageSize, sortProperty);
return ApiResponse.success(usersList);
}
//后台-用户详情
@RequestMapping("/info/{id}")
public ApiResponse<Users> info(@PathVariable("id") Integer id) {
Users info = usersService.findById(id);
return ApiResponse.success(info);
}
//后台-用户添加接口
@IgnoreAuth
@PostMapping("/save")
public ApiResponse<Integer> save(@RequestBody Users req) {
if (null == req.getLoginname() || req.getLoginname().equals("")) {
return ApiResponse.failed("用户名loginname不能为空");
}
//判断用户名是否已存在
Users instance = new Users();
instance.setLoginname(req.getLoginname());
instance = usersService.findOneByEqualTo(instance);
if (null != instance && (null == req.getId() || req.getId() == 0) || (null != instance && !instance.getId().equals(req.getId()))) {
return ApiResponse.failed("用户名" + req.getLoginname() + "已存在");
}
if (null != req.getLoginpw() && !req.getLoginpw().equals("")) {
req.setLoginpw(Md5Util.strToMd5(req.getLoginpw()));
} else {
req.setLoginpw(null);
}
int result = usersService.saveOrUpdate(req);
return ApiResponse.success(result);
}
//用户删除(含批量删除)接口
@RequestMapping("/delete")
public ApiResponse<Integer> delete(@RequestBody Integer[] ids) {
int result = 0;
for (Integer id : ids) {
result = usersService.deleteById(id);
}
return ApiResponse.success(result);
}
//用户修改接口
@PostMapping("/set")
public ApiResponse<Integer> set(@RequestBody Users req) {
// if (null == req.getLoginname() || req.getLoginname().equals("")) {
// return ApiResponse.failed("用户名loginname不能为空");
// }
//判断用户名是否已存在
// Users instance = new Users();
// instance.setLoginname(req.getLoginname());
// instance = usersService.findOneByEqualTo(instance);
// if (null != instance && (null == req.getId() || req.getId() == 0) || (null != instance && !instance.getId().equals(req.getId()))) {
// return ApiResponse.failed("用户名" + req.getLoginname() + "已存在");
// }
// if (null != req.getLoginpw() && !req.getLoginpw().equals("")) {
// req.setLoginpw(Md5Util.strToMd5(req.getLoginpw()));
// } else {
// req.setLoginpw(null);
// }
int result = usersService.saveOrUpdate(req);
return ApiResponse.success(result);
}
//获取当前登陆用户的个人信息
@RequestMapping("/session")
public ApiResponse<Users> getCurrUser(HttpServletRequest request) {
Integer id = (Integer) request.getSession().getAttribute("usersId");
Users info = usersService.findById(id);
return ApiResponse.success(info);
}
//用户重置密码接口
@IgnoreAuth
@RequestMapping("/resetPw")
public ApiResponse<String> usersResetPw(@RequestBody Users req) {
Users info = usersService.findOneByEqualTo(req);
if (null == info || info.getId() == 0) {
return ApiResponse.failed("请确认您的用户名、姓名和电话是否正确!");
}
info.setLoginpw(Md5Util.strToMd5("000000"));
usersService.saveOrUpdate(info);
return ApiResponse.success("您的密码已被重置为000000如需修改请登陆个人中心操作!");
}
//获取所有用户数据接口
@IgnoreAuth
@RequestMapping("/all")
public ApiResponse<Users> usersAll() {
List<Users> usersList = usersService.findAll();
return ApiResponse.success(usersList);
}
//根据条件(字符类型模糊匹配查询)获取用户数据接口
@IgnoreAuth
@RequestMapping("/search")
public ApiResponse<Users> usersSearch(Users req) {
List<Users> usersList = usersService.find(req);
return ApiResponse.success(usersList);
}
//根据条件(字符类型完全匹配查询)获取用户数据接口
@IgnoreAuth
@RequestMapping("/searchByEqualTo")
public ApiResponse<Users> usersSearchByEqualTo(Users req) {
List<Users> usersList = usersService.findByEqualTo(req);
return ApiResponse.success(usersList);
}
//按条件查询用户分页数据方法(模糊匹配查询)
private PageData<Users> getPageList(Users req, int pageNo, int pageSize, String sortProperty) {
PageWrap<Users> pageWrap = getPageWrap(req, pageNo, pageSize, sortProperty);
PageData<Users> usersList = usersService.findPage(pageWrap);
return usersList;
}
//按条件查询用户分页数据方法(完全匹配查询)
private PageData<Users> getPageListByEqualTo(Users req, int pageNo, int pageSize, String sortProperty) {
PageWrap<Users> pageWrap = getPageWrap(req, pageNo, pageSize, sortProperty);
PageData<Users> usersList = usersService.findPageByEqualTo(pageWrap);
return usersList;
}
//获取用户查询数据搜索条件
private PageWrap<Users> getPageWrap(Users req, int pageNo, int pageSize, String sortProperty) {
PageWrap<Users> pageWrap = new PageWrap<>();
pageWrap.setModel(req);
pageWrap.setPageNum(pageNo);
pageWrap.setPageSize(pageSize);
PageWrap.SortData sortData = new PageWrap.SortData();
sortData.setDirection("DESC");
sortData.setProperty(sortProperty);
List<PageWrap.SortData> sorts = new ArrayList<>();
sorts.add(sortData);
pageWrap.setSorts(sorts);
return pageWrap;
}
}

@ -0,0 +1,47 @@
package com.dao;
import com.entity.Users;
import com.entity.UsersExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @ClassName UsersMapper
* @Description
*/
public interface UsersMapper {
//根据条件获取用户表users的数据数量
int countByExample(UsersExample example);
//根据条件删除用户表users的数据
int deleteByExample(UsersExample example);
//根据主键ID列删除用户表users的数据
int deleteByPrimaryKey(Integer id);
//插入用户表users的实体数据包含null值
int insert(Users record);
//插入用户表users的实体数据不包含null值
int insertSelective(Users record);
//根据条件获取用户表users的数据列表
List<Users> selectByExample(UsersExample example);
//根据主键ID列获取用户表users的数据实体
Users selectByPrimaryKey(Integer id);
//根据条件更新用户表users的实体数据不包含null值
int updateByExampleSelective(@Param("record") Users record, @Param("example") UsersExample example);
//根据条件更新用户表users的实体数据包含null值
int updateByExample(@Param("record") Users record, @Param("example") UsersExample example);
//根据主键ID列更新用户表users的实体数据不包含null值
int updateByPrimaryKeySelective(Users record);
//根据主键ID列更新用户表users的实体数据包含null值
int updateByPrimaryKey(Users record);
}

@ -0,0 +1,44 @@
package com.service;
import com.entity.Users;
import com.util.PageData;
import com.util.PageWrap;
import java.util.List;
/**
* @ClassName UsersService
* @Description
*/
public interface UsersService {
//保存或更新用户表数据
Integer saveOrUpdate(Users instance);
//查询所有用户表数据
List<Users> findAll();
//根据条件(字符类型模糊)查询用户表数据
List<Users> find(Users instance);
//根据条件(字符类型完全匹配)查询用户表数据
List<Users> findByEqualTo(Users instance);
//根据条件(字符类型模糊)查询查询第一条用户表数据
Users findOne(Users instance);
//根据条件(字符类型完全匹配)查询查询第一条用户表数据
Users findOneByEqualTo(Users instance);
//根据id列查询用户表数据
Users findById(Integer id);
//根据id列删除用户表数据
int deleteById(Integer id);
//根据条件(字符类型模糊)分页查询用户表数据
PageData<Users> findPage(PageWrap<Users> pageWrap);
//根据条件(字符类型完全匹配)分页查询用户表数据
PageData<Users> findPageByEqualTo(PageWrap<Users> pageWrap);
}

@ -0,0 +1,409 @@
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50621
Source Host : localhost:3306
Source Database : shopping
Target Server Type : MYSQL
Target Server Version : 50621
File Encoding : 65001
Date: 2024-11-14 14:52:41
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for dingdan
-- ----------------------------
DROP TABLE IF EXISTS `dingdan`;
CREATE TABLE `dingdan` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '订单',
`bianhao` varchar(50) DEFAULT NULL COMMENT '编号',
`jine` int(11) DEFAULT NULL COMMENT '订单金额',
`zhifushenhe` varchar(50) DEFAULT NULL COMMENT '是否支付',
`fahuoshenhe` varchar(50) DEFAULT NULL COMMENT '是否发货',
`shouhuoshenhe` varchar(50) DEFAULT NULL COMMENT '是否收货',
`zhifufangshiid` int(11) DEFAULT NULL COMMENT '支付方式',
`xingming` varchar(50) DEFAULT NULL COMMENT '姓名',
`dianhua` varchar(50) DEFAULT NULL COMMENT '电话',
`dizhi` varchar(50) DEFAULT NULL COMMENT '送货地址',
`shijian` varchar(50) DEFAULT NULL COMMENT '时间',
`wuliu` varchar(5000) DEFAULT NULL COMMENT '物流信息',
`beizhu` varchar(50) DEFAULT NULL COMMENT '备注',
`usersid` int(11) DEFAULT NULL COMMENT '用户id',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=47 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of dingdan
-- ----------------------------
INSERT INTO `dingdan` VALUES ('24', '15813885589189', '16', 'yes', 'yes', 'yes', '3', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '2');
INSERT INTO `dingdan` VALUES ('20', '15813414477261', '32', 'yes', 'yes', 'yes', '3', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '2');
INSERT INTO `dingdan` VALUES ('21', '15813415026171', '31', 'yes', 'yes', 'yes', '3', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '2');
INSERT INTO `dingdan` VALUES ('22', '15813448135662', '141', 'yes', 'yes', 'yes', '3', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '2');
INSERT INTO `dingdan` VALUES ('23', '15813847699886', '32', 'yes', 'yes', 'yes', '3', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', 'w', '', '2');
INSERT INTO `dingdan` VALUES ('25', '15813898770985', '32', 'yes', 'yes', 'yes', '3', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '2');
INSERT INTO `dingdan` VALUES ('26', '15813899736093', '48', 'yes', 'yes', 'yes', '3', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '2');
INSERT INTO `dingdan` VALUES ('27', '15813900729928', '32', 'yes', 'yes', 'yes', '3', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '2');
INSERT INTO `dingdan` VALUES ('28', '15813913070045', '156', 'yes', 'yes', 'yes', '3', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '5');
INSERT INTO `dingdan` VALUES ('29', '15813914223411', '63', 'yes', 'yes', 'yes', '3', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '5');
INSERT INTO `dingdan` VALUES ('30', '15826254302785', '64', 'yes', 'yes', 'yes', '3', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '2');
INSERT INTO `dingdan` VALUES ('31', '20200308090451', '326', 'yes', 'yes', 'yes', '1', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '2');
INSERT INTO `dingdan` VALUES ('32', '20200308092656', '296', 'yes', 'yes', 'yes', '1', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '2');
INSERT INTO `dingdan` VALUES ('33', '20200309120928', '496', 'yes', 'yes', 'yes', '1', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '2');
INSERT INTO `dingdan` VALUES ('34', '20200309122706', '40', 'yes', 'yes', 'yes', '1', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '2');
INSERT INTO `dingdan` VALUES ('35', '20200309123033', '20', 'yes', 'yes', 'yes', '1', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '2');
INSERT INTO `dingdan` VALUES ('36', '20200309044107', '334', 'yes', 'yes', 'yes', '1', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '5');
INSERT INTO `dingdan` VALUES ('37', '20200314040145', '72', 'yes', 'yes', 'yes', '1', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '2');
INSERT INTO `dingdan` VALUES ('38', '20200314044956', '20', 'yes', 'yes', 'yes', '1', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '5');
INSERT INTO `dingdan` VALUES ('39', '20200314050638', '40', 'yes', 'yes', 'yes', '1', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '5');
INSERT INTO `dingdan` VALUES ('40', '20200419113059', '60', 'yes', 'yes', 'yes', '1', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '2');
INSERT INTO `dingdan` VALUES ('41', '20201201045859', '90', 'yes', 'yes', 'yes', '1', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '5');
INSERT INTO `dingdan` VALUES ('42', '20201201054926', '60', 'yes', 'yes', 'yes', '1', '刘三', '13777777777', '北京中关村', '2024-06-01 16:36:36', null, '', '5');
INSERT INTO `dingdan` VALUES ('43', '1691239355758', '80', 'no', 'yes', 'no', '1', '123', '13777777777', '123', '2024-06-01 20:42:35', '', '15232', '2');
INSERT INTO `dingdan` VALUES ('44', '1691239376932', '160', 'no', 'yes', 'no', '2', '123', '13777777777', '132', '2024-06-01 20:42:56', '', '123', '2');
INSERT INTO `dingdan` VALUES ('45', '1721193957205', '160', 'no', 'no', 'no', '1', '123', '15005073069', '福建省长乐市', '2024-07-17 13:25:57', '', '123', '16');
INSERT INTO `dingdan` VALUES ('46', '1721194079137', '5040', 'no', 'yes', 'no', '2', '123', '15005073069', '福建省长乐市', '2024-07-17 13:27:59', '', '123', '16');
-- ----------------------------
-- Table structure for dingdanxiang
-- ----------------------------
DROP TABLE IF EXISTS `dingdanxiang`;
CREATE TABLE `dingdanxiang` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '订单项',
`dingdanid` int(11) DEFAULT NULL COMMENT '订单id',
`shangpinid` int(11) DEFAULT NULL COMMENT '商品id',
`goumaishuliang` int(11) DEFAULT NULL COMMENT '商品数量',
`usersid` int(11) DEFAULT NULL COMMENT '用户id',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=81 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of dingdanxiang
-- ----------------------------
INSERT INTO `dingdanxiang` VALUES ('59', '29', '7', '1', '5');
INSERT INTO `dingdanxiang` VALUES ('60', '29', '8', '3', '5');
INSERT INTO `dingdanxiang` VALUES ('53', '24', '8', '1', '2');
INSERT INTO `dingdanxiang` VALUES ('47', '20', '8', '2', '2');
INSERT INTO `dingdanxiang` VALUES ('48', '21', '8', '1', '2');
INSERT INTO `dingdanxiang` VALUES ('49', '21', '7', '1', '2');
INSERT INTO `dingdanxiang` VALUES ('50', '22', '8', '6', '2');
INSERT INTO `dingdanxiang` VALUES ('51', '22', '7', '3', '2');
INSERT INTO `dingdanxiang` VALUES ('52', '23', '8', '2', '2');
INSERT INTO `dingdanxiang` VALUES ('54', '25', '8', '2', '2');
INSERT INTO `dingdanxiang` VALUES ('55', '26', '8', '3', '2');
INSERT INTO `dingdanxiang` VALUES ('56', '27', '8', '2', '2');
INSERT INTO `dingdanxiang` VALUES ('57', '28', '8', '6', '5');
INSERT INTO `dingdanxiang` VALUES ('58', '28', '7', '4', '5');
INSERT INTO `dingdanxiang` VALUES ('61', '30', '8', '4', '2');
INSERT INTO `dingdanxiang` VALUES ('66', '36', '5', '2', '5');
INSERT INTO `dingdanxiang` VALUES ('65', '35', '5', '1', '2');
INSERT INTO `dingdanxiang` VALUES ('67', '36', '6', '3', '5');
INSERT INTO `dingdanxiang` VALUES ('68', '37', '5', '3', '2');
INSERT INTO `dingdanxiang` VALUES ('69', '37', '6', '2', '2');
INSERT INTO `dingdanxiang` VALUES ('70', '38', '5', '1', '5');
INSERT INTO `dingdanxiang` VALUES ('71', '39', '5', '2', '5');
INSERT INTO `dingdanxiang` VALUES ('72', '40', '5', '2', '2');
INSERT INTO `dingdanxiang` VALUES ('73', '41', '8', '2', '5');
INSERT INTO `dingdanxiang` VALUES ('74', '41', '5', '1', '5');
INSERT INTO `dingdanxiang` VALUES ('75', '42', '5', '1', '5');
INSERT INTO `dingdanxiang` VALUES ('76', '42', '8', '1', '5');
INSERT INTO `dingdanxiang` VALUES ('77', '43', '11', '1', '2');
INSERT INTO `dingdanxiang` VALUES ('78', '44', '8', '2', '2');
INSERT INTO `dingdanxiang` VALUES ('79', '45', '11', '2', '16');
INSERT INTO `dingdanxiang` VALUES ('80', '46', '8', '63', '16');
-- ----------------------------
-- Table structure for dx
-- ----------------------------
DROP TABLE IF EXISTS `dx`;
CREATE TABLE `dx` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '信息介绍',
`leibie` varchar(50) CHARACTER SET utf8 DEFAULT NULL COMMENT '类别',
`content` varchar(5000) CHARACTER SET utf8 DEFAULT NULL COMMENT '内容',
`addtime` varchar(50) CHARACTER SET utf8 DEFAULT NULL COMMENT '时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of dx
-- ----------------------------
INSERT INTO `dx` VALUES ('1', '系统简介', '内容介绍', '2024-06-01 16:36:36');
INSERT INTO `dx` VALUES ('2', '关于我们', '内容介绍', '2024-06-01 16:36:36');
INSERT INTO `dx` VALUES ('3', '系统公告', '内容介绍', '2024-06-01 16:36:36');
INSERT INTO `dx` VALUES ('4', '网站历史', '内容介绍', '2024-06-01 16:36:36');
-- ----------------------------
-- Table structure for gouwuche
-- ----------------------------
DROP TABLE IF EXISTS `gouwuche`;
CREATE TABLE `gouwuche` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '购物车',
`shangpinid` int(11) DEFAULT NULL COMMENT '商品id',
`goumaishuliang` int(11) DEFAULT NULL COMMENT '商品数量',
`usersid` int(11) DEFAULT NULL COMMENT '用户id',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=45 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of gouwuche
-- ----------------------------
INSERT INTO `gouwuche` VALUES ('44', '12', '100', '16');
INSERT INTO `gouwuche` VALUES ('2', '5', '3', '5');
INSERT INTO `gouwuche` VALUES ('40', '12', '2', '5');
INSERT INTO `gouwuche` VALUES ('41', '11', '1', '5');
-- ----------------------------
-- Table structure for lianjie
-- ----------------------------
DROP TABLE IF EXISTS `lianjie`;
CREATE TABLE `lianjie` (
`id` int(11) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`url` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of lianjie
-- ----------------------------
INSERT INTO `lianjie` VALUES ('2', '中华姓氏网', 'http://www.10000xing.cn/x010/wjx.html');
-- ----------------------------
-- Table structure for liuyan
-- ----------------------------
DROP TABLE IF EXISTS `liuyan`;
CREATE TABLE `liuyan` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '留言反馈',
`biaoti` varchar(55) DEFAULT NULL COMMENT '标题',
`neirong` varchar(4000) DEFAULT NULL COMMENT '内容',
`addshijian` varchar(55) DEFAULT NULL COMMENT '留言添加时间',
`usersid` int(11) DEFAULT NULL COMMENT '用户id',
`huifu` varchar(4000) DEFAULT NULL COMMENT '回复',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of liuyan
-- ----------------------------
INSERT INTO `liuyan` VALUES ('1', '留言信息', '内容介绍', '2024-06-01 16:36:36', '2', '222');
INSERT INTO `liuyan` VALUES ('2', '留言信息', '内容介绍', '2024-06-01 16:36:36', '2', 'h');
INSERT INTO `liuyan` VALUES ('3', '留言信息', '内容介绍', '2024-06-01 16:36:36', '2', 'hh');
INSERT INTO `liuyan` VALUES ('4', '留言信息', '内容介绍', '2024-06-01 16:36:36', '2', '');
INSERT INTO `liuyan` VALUES ('5', '留言信息', '内容介绍', '2024-06-01 16:36:36', '2', '');
INSERT INTO `liuyan` VALUES ('6', '留言信息', '内容介绍', '2024-06-01 16:36:36', '6', '');
INSERT INTO `liuyan` VALUES ('7', '留言信息', '内容介绍', '2024-06-01 16:36:36', '5', '');
INSERT INTO `liuyan` VALUES ('8', '留言信息', '内容介绍', '2024-06-01 16:36:36', '5', '');
INSERT INTO `liuyan` VALUES ('9', '留言信息', '内容介绍', '2024-06-01 16:36:36', '5', '22');
INSERT INTO `liuyan` VALUES ('10', '留言信息', '内容介绍', '2024-06-01 16:36:36', '2', ' ');
INSERT INTO `liuyan` VALUES ('11', '留言信息', '内容介绍', '2024-06-01 16:36:36', '5', null);
INSERT INTO `liuyan` VALUES ('13', '留言信息', '内容介绍', '2024-06-01 16:36:36', '5', null);
INSERT INTO `liuyan` VALUES ('14', '留言信息', '内容介绍', '2024-06-01 16:36:36', '2', null);
INSERT INTO `liuyan` VALUES ('15', '留言信息', '内容介绍', '2024-06-01 16:36:36', '2', 'ghj');
INSERT INTO `liuyan` VALUES ('19', '留言信息', '内容介绍', '2024-06-01 16:36:36', '2', null);
INSERT INTO `liuyan` VALUES ('20', '留言信息', '内容介绍', '2024-06-01 16:36:36', '2', null);
-- ----------------------------
-- Table structure for lunbo
-- ----------------------------
DROP TABLE IF EXISTS `lunbo`;
CREATE TABLE `lunbo` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '轮播图',
`biaoti` varchar(50) DEFAULT NULL COMMENT '标题',
`image` varchar(255) DEFAULT NULL COMMENT '图片',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of lunbo
-- ----------------------------
INSERT INTO `lunbo` VALUES ('13', 'ssd', 'upload/1617950350723.jpg');
INSERT INTO `lunbo` VALUES ('14', 'ssdsdf', 'upload/1617950372970.jpg');
INSERT INTO `lunbo` VALUES ('15', 'dfds', 'upload/1617950424839.jpg');
-- ----------------------------
-- Table structure for pingjia
-- ----------------------------
DROP TABLE IF EXISTS `pingjia`;
CREATE TABLE `pingjia` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '评论',
`biaoti` varchar(500) DEFAULT NULL COMMENT '评语',
`fenshu` varchar(50) DEFAULT NULL COMMENT '分数范围1-5',
`shijian` varchar(50) DEFAULT NULL COMMENT '时间',
`shangpinid` int(11) DEFAULT NULL COMMENT '零食id',
`usersid` int(255) DEFAULT NULL COMMENT '用户id',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of pingjia
-- ----------------------------
INSERT INTO `pingjia` VALUES ('1', '顶顶顶顶顶弟弟顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶ss', '5', '2024-06-01 16:36:36', '6', '5');
INSERT INTO `pingjia` VALUES ('2', '对方答复', '5', '2024-06-01 16:36:36', '5', '5');
INSERT INTO `pingjia` VALUES ('3', '大幅度', '5', '2024-06-01 16:36:36', '8', '5');
INSERT INTO `pingjia` VALUES ('4', '大幅度ss', '5', '2024-06-01 16:36:36', '6', '2');
INSERT INTO `pingjia` VALUES ('5', '大幅度', '5', '2024-06-01 16:36:36', '5', '2');
INSERT INTO `pingjia` VALUES ('6', '订单', '5', '2024-06-01 16:36:36', '6', '2');
INSERT INTO `pingjia` VALUES ('8', '发的', '5', '2024-06-01 16:36:36', '5', '2');
INSERT INTO `pingjia` VALUES ('9', '想吃粽子', '5', '2024-06-01 16:36:36', '6', '2');
INSERT INTO `pingjia` VALUES ('10', '好看s', '5', '2024-06-01 16:36:36', '5', '5');
INSERT INTO `pingjia` VALUES ('12', '好好', '5', '2024-06-01 16:36:36', '6', '5');
INSERT INTO `pingjia` VALUES ('13', '<p>啊啊好</p>', '5', '2024-06-01 16:36:36', '5', '2');
INSERT INTO `pingjia` VALUES ('14', '<p>好好</p>', '5', '2024-06-01 16:36:36', '6', '5');
INSERT INTO `pingjia` VALUES ('15', '好好好', '5', '2024-06-01 16:36:36', '5', '5');
INSERT INTO `pingjia` VALUES ('16', '三四十', '5', '2024-06-01 16:36:36', '6', '5');
INSERT INTO `pingjia` VALUES ('17', '啊啊试试ss', '5', '2024-06-01 16:36:36', '5', '2');
INSERT INTO `pingjia` VALUES ('18', 'test', '5', '2024-06-01 16:36:36', '6', '2');
-- ----------------------------
-- Table structure for pinlei
-- ----------------------------
DROP TABLE IF EXISTS `pinlei`;
CREATE TABLE `pinlei` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '分类',
`mingcheng` varchar(255) DEFAULT NULL COMMENT '名称',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of pinlei
-- ----------------------------
INSERT INTO `pinlei` VALUES ('1', '糕点');
INSERT INTO `pinlei` VALUES ('2', '糖类');
INSERT INTO `pinlei` VALUES ('3', '巧克力类');
INSERT INTO `pinlei` VALUES ('4', '肉类');
-- ----------------------------
-- Table structure for shangpin
-- ----------------------------
DROP TABLE IF EXISTS `shangpin`;
CREATE TABLE `shangpin` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '零食',
`mingcheng` varchar(200) DEFAULT NULL COMMENT '名称',
`bianhao` varchar(50) DEFAULT NULL COMMENT '编号',
`pinleiid` int(11) DEFAULT NULL COMMENT '分类id',
`neirong` varchar(3000) DEFAULT NULL COMMENT '内容介绍',
`image` varchar(255) DEFAULT NULL COMMENT '图片',
`yuanshijiage` int(11) DEFAULT NULL COMMENT '原价',
`jiage` int(11) DEFAULT NULL COMMENT '现价',
`danwei` varchar(50) DEFAULT NULL COMMENT '单位',
`shenhe` varchar(50) DEFAULT NULL COMMENT '是否特价',
`kucunshuliang` int(11) DEFAULT '0' COMMENT '库存数量',
`xiaoshoushuliang` int(11) DEFAULT '0' COMMENT '销售数量',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of shangpin
-- ----------------------------
INSERT INTO `shangpin` VALUES ('5', '嫩豆腐', 'A001', '2', '内容介绍', 'upload/1617951392528.png', '80', '80', 'KG', 'yes', '92', '6');
INSERT INTO `shangpin` VALUES ('6', '肉松面包', 'A002', '2', '内容介绍', 'upload/1617951406159.png', '80', '80', 'KG', 'yes', '93', '0');
INSERT INTO `shangpin` VALUES ('7', '香香锅巴', 'A003', '2', '内容介绍', 'upload/1617951429878.png', '80', '80', 'KG', 'yes', '91', '5');
INSERT INTO `shangpin` VALUES ('8', '饼干', '1004', '2', '内容介绍', 'upload/1617951670596.png', '80', '80', 'KG', 'yes', '0', '86');
INSERT INTO `shangpin` VALUES ('9', '嫩豆腐', 'A001', '2', '内容介绍', 'upload/1617951392528.png', '80', '80', 'KG', 'yes', '92', '6');
INSERT INTO `shangpin` VALUES ('10', '肉松面包', 'A002', '2', '内容介绍', 'upload/1617951406159.png', '80', '80', 'KG', 'yes', '93', '0');
INSERT INTO `shangpin` VALUES ('11', '香香锅巴', 'A003', '2', '内容介绍', 'upload/1617951429878.png', '80', '80', 'KG', 'yes', '88', '8');
INSERT INTO `shangpin` VALUES ('12', '饼干', '1004', '2', '内容介绍', 'upload/1617951670596.png', '80', '80', 'KG', 'yes', '65', '21');
-- ----------------------------
-- Table structure for shenqing
-- ----------------------------
DROP TABLE IF EXISTS `shenqing`;
CREATE TABLE `shenqing` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '售后申请',
`xingming` varchar(50) DEFAULT NULL COMMENT '姓名',
`dianhua` varchar(50) DEFAULT NULL COMMENT '电话',
`neirong` varchar(500) DEFAULT NULL COMMENT '说明',
`shijian` varchar(50) DEFAULT NULL COMMENT '时间',
`beizhu` varchar(50) DEFAULT NULL COMMENT '备注',
`shenhe` varchar(50) DEFAULT NULL COMMENT '是否审核',
`usersid` int(11) DEFAULT NULL COMMENT '用户id',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of shenqing
-- ----------------------------
INSERT INTO `shenqing` VALUES ('8', '刘三', '13777777777', '内容介绍', '2024-06-01 16:36:36', '', 'yes', '5');
INSERT INTO `shenqing` VALUES ('9', '刘三', '13777777777', '内容介绍', '2024-06-01 16:36:36', '', 'yes', '5');
-- ----------------------------
-- Table structure for shoucang
-- ----------------------------
DROP TABLE IF EXISTS `shoucang`;
CREATE TABLE `shoucang` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '收藏',
`shijian` varchar(50) DEFAULT NULL COMMENT '时间',
`shangpinid` int(11) DEFAULT NULL COMMENT '零食id',
`usersid` int(11) DEFAULT NULL COMMENT '用户id',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of shoucang
-- ----------------------------
INSERT INTO `shoucang` VALUES ('18', '2024-06-01 16:36:36', '5', '2');
INSERT INTO `shoucang` VALUES ('19', '2024-06-01 16:36:36', '6', '5');
INSERT INTO `shoucang` VALUES ('21', '2024-06-01 16:36:36', '5', '5');
INSERT INTO `shoucang` VALUES ('22', '2024-06-01 16:36:36', '6', '2');
INSERT INTO `shoucang` VALUES ('23', '2024-06-01 16:36:36', '5', '2');
INSERT INTO `shoucang` VALUES ('24', '2024-06-01 16:36:36', '6', '5');
INSERT INTO `shoucang` VALUES ('25', '2024-06-01 16:36:36', '5', '2');
INSERT INTO `shoucang` VALUES ('26', '2024-06-01 16:36:36', '6', '2');
INSERT INTO `shoucang` VALUES ('27', '2024-06-01 16:36:36', '5', '5');
INSERT INTO `shoucang` VALUES ('28', '2024-06-01 16:36:36', '6', '2');
INSERT INTO `shoucang` VALUES ('29', '2024-06-01 16:36:36', '5', '2');
INSERT INTO `shoucang` VALUES ('30', '2024-06-01 16:36:36', '6', '5');
-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户',
`loginname` varchar(50) DEFAULT NULL COMMENT '用户名称',
`loginpw` varchar(50) DEFAULT NULL COMMENT '密码',
`type` varchar(50) DEFAULT NULL COMMENT '类型',
`typename` varchar(50) DEFAULT NULL COMMENT '类型名称',
`xingming` varchar(50) DEFAULT NULL COMMENT '姓名',
`xingbie` varchar(50) DEFAULT NULL COMMENT '性别',
`nianling` varchar(50) DEFAULT NULL COMMENT '年龄',
`address` varchar(50) DEFAULT NULL COMMENT '地址',
`dianhua` varchar(255) DEFAULT NULL COMMENT '电话',
`shenhe` varchar(50) DEFAULT NULL COMMENT '审核',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of users
-- ----------------------------
INSERT INTO `users` VALUES ('1', 'laoshi', '670b14728ad9902aecba32e22fa4f6bd', '2', '用户', '刘三', '', '24', '北京路', '13777777777', 'yes');
INSERT INTO `users` VALUES ('2', 'a', '0cc175b9c0f1b6a831c399e269772661', '0', '管理', '刘三', '', '24', '北京路', '13777777777', 'yes');
INSERT INTO `users` VALUES ('5', 'liusan', '670b14728ad9902aecba32e22fa4f6bd', '2', '用户', '刘三', '', '24', '上海路', '13850127079', 'yes');
INSERT INTO `users` VALUES ('6', 'hsg', '94b40c6db280230b4211b06fa04c7be1', '0', '管理', '刘三', '', '24', '26441186', '13777777777', 'yes');
INSERT INTO `users` VALUES ('7', 'zzz', '670b14728ad9902aecba32e22fa4f6bd', '2', '用户', '刘三', '', '24', 'zzz', '13777777777', 'yes');
INSERT INTO `users` VALUES ('8', 'ggg', '670b14728ad9902aecba32e22fa4f6bd', '2', '用户', '刘三', '', '24', 'ggg', '13777777777', 'yes');
INSERT INTO `users` VALUES ('12', '55', '670b14728ad9902aecba32e22fa4f6bd', '2', '用户', '刘三', '', '24', '55', '13777777777', 'yes');
INSERT INTO `users` VALUES ('13', '5566', '670b14728ad9902aecba32e22fa4f6bd', '2', '用户', '刘三', '', '24', '55', '13777777777', 'yes');
INSERT INTO `users` VALUES ('14', 'ztest', '670b14728ad9902aecba32e22fa4f6bd', '2', '用户', '刘三', '', '24', '22', '13777777777', 'yes');
INSERT INTO `users` VALUES ('15', 'lsf', '123456', '2', '用户', '张杰', '', '21', '22', '15060578522', 'yes');
INSERT INTO `users` VALUES ('16', 'lsf4', '202cb962ac59075b964b07152d234b70', '2', '用户', 'lishengfeng', '', '21', '福建省长乐市金峰', '15007066931', 'no');
-- ----------------------------
-- Table structure for zhifufangshi
-- ----------------------------
DROP TABLE IF EXISTS `zhifufangshi`;
CREATE TABLE `zhifufangshi` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '支付方式',
`mingcheng` varchar(255) DEFAULT NULL COMMENT '支付方式',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of zhifufangshi
-- ----------------------------
INSERT INTO `zhifufangshi` VALUES ('1', '支付宝支付');
INSERT INTO `zhifufangshi` VALUES ('2', '微信支付');
INSERT INTO `zhifufangshi` VALUES ('3', '网银支付');
Loading…
Cancel
Save