SSM+Vue+小程序+基于小程序的服装电商系统

2024-05-06 02:36

本文主要是介绍SSM+Vue+小程序+基于小程序的服装电商系统,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

maven工具管理依赖,数据库mysql,mybatsi处理数据库交互,一共12张表,小程序为客户端,vue页面为管理端。我的vue项目会给好modlues依赖包,安装好node启动即可,项目代文档。

可以在最下方扫码加我,可以加购调试,讲解。

图示:

部分数据库设计:

tongzhuangshangcheng表

列名

数据类型

长度

约束

id

bigint

19

NOT NULL

addtime

varchar

255

NOT NULL

mingcheng

varchar

255

NOT NULL

fenlei

varchar

255

NOT NULL

leibie

varchar

255

NOT NULL

pinpai

varchar

255

NOT NULL

chima

varchar

255

NOT NULL

yanse

varchar

255

NOT NULL

tupian

varchar

255

NOT NULL

xiangqing

varchar

255

NOT NULL

yonghu表

列名

数据类型

长度

约束

id

int

11

NOT NULL

addtime

varchar

255

NOT NULL

zhanghao

varchar

255

NOT NULL

mima

varchar

255

NOT NULL

xingming

varchar

255

NOT NULL

xingbie

varchar

255

NOT NULL

nianling

varchar

255

NOT NULL

shouji

varchar

255

NOT NULL

youxiang

varchar

255

NOT NULL

zhaopian

varchar

255

NOT NULL

jifen

varchar

255

NOT NULL

yuyueshijian

varchar

255

NOT NULL

EXISTS表

列名

数据类型

长度

约束

id

 int

9

NOT NULL

addtime

varchar

255

NOT NULL

userid

varchar

255

NOT NULL

username

varchar

255

NOT NULL

tablename

varchar

255

NOT NULL

role

varchar

255

NOT NULL

token

varchar

255

NOT NULL

addtime

varchar

255

NOT NULL

部分代码设计

服装产品接口

package com.controller;import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
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.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;import com.entity.TongzhuangshangchengEntity;
import com.entity.view.TongzhuangshangchengView;import com.service.TongzhuangshangchengService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MPUtil;/*** 童装商城后端接口*/
@RestController
@RequestMapping("/tongzhuangshangcheng")
public class TongzhuangshangchengController {@Autowiredprivate TongzhuangshangchengService tongzhuangshangchengService;/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params, TongzhuangshangchengEntity tongzhuangshangcheng, HttpServletRequest request) {EntityWrapper<TongzhuangshangchengEntity> ew = new EntityWrapper<TongzhuangshangchengEntity>();PageUtils page = tongzhuangshangchengService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, tongzhuangshangcheng), params), params));return R.ok().put("data", page);}/*** 前端列表*/@IgnoreAuth@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params, TongzhuangshangchengEntity tongzhuangshangcheng, HttpServletRequest request) {EntityWrapper<TongzhuangshangchengEntity> ew = new EntityWrapper<TongzhuangshangchengEntity>();PageUtils page = tongzhuangshangchengService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, tongzhuangshangcheng), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/lists")public R list(TongzhuangshangchengEntity tongzhuangshangcheng) {EntityWrapper<TongzhuangshangchengEntity> ew = new EntityWrapper<TongzhuangshangchengEntity>();ew.allEq(MPUtil.allEQMapPre(tongzhuangshangcheng, "tongzhuangshangcheng"));return R.ok().put("data", tongzhuangshangchengService.selectListView(ew));}/*** 查询*/@RequestMapping("/query")public R query(TongzhuangshangchengEntity tongzhuangshangcheng) {EntityWrapper<TongzhuangshangchengEntity> ew = new EntityWrapper<TongzhuangshangchengEntity>();ew.allEq(MPUtil.allEQMapPre(tongzhuangshangcheng, "tongzhuangshangcheng"));TongzhuangshangchengView tongzhuangshangchengView = tongzhuangshangchengService.selectView(ew);return R.ok("查询童装商城成功").put("data", tongzhuangshangchengView);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id) {TongzhuangshangchengEntity tongzhuangshangcheng = tongzhuangshangchengService.selectById(id);tongzhuangshangcheng.setClicknum(tongzhuangshangcheng.getClicknum() + 1);tongzhuangshangcheng.setClicktime(new Date());tongzhuangshangchengService.updateById(tongzhuangshangcheng);return R.ok().put("data", tongzhuangshangcheng);}/*** 前端详情*/@IgnoreAuth@RequestMapping("/detail/{id}")public R detail(@PathVariable("id") Long id) {TongzhuangshangchengEntity tongzhuangshangcheng = tongzhuangshangchengService.selectById(id);tongzhuangshangcheng.setClicknum(tongzhuangshangcheng.getClicknum() + 1);tongzhuangshangcheng.setClicktime(new Date());tongzhuangshangchengService.updateById(tongzhuangshangcheng);return R.ok().put("data", tongzhuangshangcheng);}/*** 赞或踩*/@RequestMapping("/thumbsup/{id}")public R thumbsup(@PathVariable("id") String id, String type) {TongzhuangshangchengEntity tongzhuangshangcheng = tongzhuangshangchengService.selectById(id);if (type.equals("1")) {tongzhuangshangcheng.setThumbsupnum(tongzhuangshangcheng.getThumbsupnum() + 1);} else {tongzhuangshangcheng.setCrazilynum(tongzhuangshangcheng.getCrazilynum() + 1);}tongzhuangshangchengService.updateById(tongzhuangshangcheng);return R.ok();}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody TongzhuangshangchengEntity tongzhuangshangcheng, HttpServletRequest request) {tongzhuangshangcheng.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());tongzhuangshangchengService.insert(tongzhuangshangcheng);return R.ok();}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody TongzhuangshangchengEntity tongzhuangshangcheng, HttpServletRequest request) {tongzhuangshangcheng.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());tongzhuangshangchengService.insert(tongzhuangshangcheng);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody TongzhuangshangchengEntity tongzhuangshangcheng, HttpServletRequest request) {tongzhuangshangchengService.updateById(tongzhuangshangcheng);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids) {tongzhuangshangchengService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 提醒接口*/@RequestMapping("/remind/{columnName}/{type}")public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,@PathVariable("type") String type, @RequestParam Map<String, Object> map) {map.put("column", columnName);map.put("type", type);if (type.equals("2")) {SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");Calendar c = Calendar.getInstance();Date remindStartDate = null;Date remindEndDate = null;if (map.get("remindstart") != null) {Integer remindStart = Integer.parseInt(map.get("remindstart").toString());c.setTime(new Date());c.add(Calendar.DAY_OF_MONTH, remindStart);remindStartDate = c.getTime();map.put("remindstart", sdf.format(remindStartDate));}if (map.get("remindend") != null) {Integer remindEnd = Integer.parseInt(map.get("remindend").toString());c.setTime(new Date());c.add(Calendar.DAY_OF_MONTH, remindEnd);remindEndDate = c.getTime();map.put("remindend", sdf.format(remindEndDate));}}Wrapper<TongzhuangshangchengEntity> wrapper = new EntityWrapper<TongzhuangshangchengEntity>();if (map.get("remindstart") != null) {wrapper.ge(columnName, map.get("remindstart"));}if (map.get("remindend") != null) {wrapper.le(columnName, map.get("remindend"));}int count = tongzhuangshangchengService.selectCount(wrapper);return R.ok().put("count", count);}/*** 前端智能排序*/@IgnoreAuth@RequestMapping("/autoSort")public R autoSort(@RequestParam Map<String, Object> params, TongzhuangshangchengEntity tongzhuangshangcheng, HttpServletRequest request, String pre) {EntityWrapper<TongzhuangshangchengEntity> ew = new EntityWrapper<TongzhuangshangchengEntity>();Map<String, Object> newMap = new HashMap<String, Object>();Map<String, Object> param = new HashMap<String, Object>();Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();while (it.hasNext()) {Map.Entry<String, Object> entry = it.next();String newKey = entry.getKey();if (pre.endsWith(".")) {newMap.put(pre + newKey, entry.getValue());} else if (StringUtils.isEmpty(pre)) {newMap.put(newKey, entry.getValue());} else {newMap.put(pre + "." + newKey, entry.getValue());}}params.put("sort", "clicknum");params.put("order", "desc");PageUtils page = tongzhuangshangchengService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, tongzhuangshangcheng), params), params));return R.ok().put("data", page);}
}

需要请扫码联系我:

                                

这篇关于SSM+Vue+小程序+基于小程序的服装电商系统的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/963277

相关文章

基于C++的UDP网络通信系统设计与实现详解

《基于C++的UDP网络通信系统设计与实现详解》在网络编程领域,UDP作为一种无连接的传输层协议,以其高效、低延迟的特性在实时性要求高的应用场景中占据重要地位,下面我们就来看看如何从零开始构建一个完整... 目录前言一、UDP服务器UdpServer.hpp1.1 基本框架设计1.2 初始化函数Init详解

Django调用外部Python程序的完整项目实战

《Django调用外部Python程序的完整项目实战》Django是一个强大的PythonWeb框架,它的设计理念简洁优雅,:本文主要介绍Django调用外部Python程序的完整项目实战,文中通... 目录一、为什么 Django 需要调用外部 python 程序二、三种常见的调用方式方式 1:直接 im

HTML5的input标签的`type`属性值详解和代码示例

《HTML5的input标签的`type`属性值详解和代码示例》HTML5的`input`标签提供了多种`type`属性值,用于创建不同类型的输入控件,满足用户输入的多样化需求,从文本输入、密码输入、... 目录一、引言二、文本类输入类型2.1 text2.2 password2.3 textarea(严格

SpringBoot返回文件让前端下载的几种方式

《SpringBoot返回文件让前端下载的几种方式》文章介绍了开发中文件下载的两种常见解决方案,并详细描述了通过后端进行下载的原理和步骤,包括一次性读取到内存和分块写入响应输出流两种方法,此外,还提供... 目录01 背景02 一次性读取到内存,通过响应输出流输出到前端02 将文件流通过循环写入到响应输出流

SpringBoot+Vue3整合SSE实现实时消息推送功能

《SpringBoot+Vue3整合SSE实现实时消息推送功能》在日常开发中,我们经常需要实现实时消息推送的功能,这篇文章将基于SpringBoot和Vue3来简单实现一个入门级的例子,下面小编就和大... 目录前言先大概介绍下SSE后端实现(SpringBoot)前端实现(vue3)1. 数据类型定义2.

前端Visual Studio Code安装配置教程之下载、汉化、常用组件及基本操作

《前端VisualStudioCode安装配置教程之下载、汉化、常用组件及基本操作》VisualStudioCode是微软推出的一个强大的代码编辑器,功能强大,操作简单便捷,还有着良好的用户界面,... 目录一、Visual Studio Code下载二、汉化三、常用组件1、Auto Rename Tag2

C++简单日志系统实现代码示例

《C++简单日志系统实现代码示例》日志系统是成熟软件中的一个重要组成部分,其记录软件的使用和运行行为,方便事后进行故障分析、数据统计等,:本文主要介绍C++简单日志系统实现的相关资料,文中通过代码... 目录前言Util.hppLevel.hppLogMsg.hppFormat.hppSink.hppBuf

Mysql 驱动程序的程序小结

《Mysql驱动程序的程序小结》MySQL驱动程序是连接应用程序与MySQL数据库的重要组件,根据不同的编程语言和应用场景,MySQL提供了多种驱动程序,下面就来详细的了解一下驱动程序,感兴趣的可以... 目录一、mysql 驱动程序的概念二、常见的 MySQL 驱动程序1. MySQL Connector

vite搭建vue3项目的搭建步骤

《vite搭建vue3项目的搭建步骤》本文主要介绍了vite搭建vue3项目的搭建步骤,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学... 目录1.确保Nodejs环境2.使用vite-cli工具3.进入项目安装依赖1.确保Nodejs环境

Nginx搭建前端本地预览环境的完整步骤教学

《Nginx搭建前端本地预览环境的完整步骤教学》这篇文章主要为大家详细介绍了Nginx搭建前端本地预览环境的完整步骤教学,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录项目目录结构核心配置文件:nginx.conf脚本化操作:nginx.shnpm 脚本集成总结:对前端的意义很多