# springcloud **Repository Path**: Aliceshine/springcloud ## Basic Information - **Project Name**: springcloud - **Description**: 商品的增删改查 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-22 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # springcloud #### 介绍 商品的增删改查 #### 环境搭建 1.创建vue-element-admin工程 ```shell # 克隆项目 git clone https://github.com/PanJiaChen/vue-element-admin.git # 进入项目目录 cd vue-element-admin # 安装依赖 npm install # 建议不要用 cnpm 安装 会有各种诡异的bug 可以通过如下操作解决 npm 下载速度慢的问题 npm install --registry=https://registry.npm.taobao.org # 本地开发 启动项目 npm run dev ``` 2.创建父工程item-springcloud,添加依赖 ```xml org.springframework.boot spring-boot-starter-parent 2.1.5.RELEASE 1.8 Greenwich.SR1 2.1.5 5.1.46 org.springframework.cloud spring-cloud-dependencies ${spring-cloud.version} pom import tk.mybatis mapper-spring-boot-starter ${mapper.starter.version} mysql mysql-connector-java ${mysql.version} org.springframework.cloud spring-cloud-starter-config org.projectlombok lombok org.springframework.boot spring-boot-maven-plugin nexus-aliyun nexus-aliyun http://maven.aliyun.com/nexus/content/groups/public/ true false ``` ![image-20200922105523797](D:\百智云\item\springcloud\img\image-20200922105523797.png) 3.新建数据库,创建表 ```sql CREATE TABLE `tb_item` ( `id` bigint(20) NOT NULL COMMENT '商品id,同时也是商品编号', `title` varchar(100) NOT NULL COMMENT '商品标题', `sell_point` varchar(500) DEFAULT NULL COMMENT '商品卖点', `price` bigint(20) NOT NULL COMMENT '商品价格,单位为:分', `num` int(10) NOT NULL COMMENT '库存数量', `barcode` varchar(30) DEFAULT NULL COMMENT '商品条形码', `image` varchar(500) DEFAULT NULL COMMENT '商品图片', `cid` bigint(10) NOT NULL COMMENT '所属类目,叶子类目', `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '商品状态,1:正常 ,2:下架,3:删除', `created` datetime NOT NULL COMMENT '创建时间', `updated` datetime NOT NULL COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ``` #### 具体实现 ##### 后端实现