From 659df3544695ecec5c02800f56e2175f29614382 Mon Sep 17 00:00:00 2001 From: xjs <1294405880@qq.com> Date: Tue, 15 Mar 2022 21:54:30 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81pom=E6=96=87=E4=BB=B6=E5=BE=AE?= =?UTF-8?q?=E8=B0=83=E5=8D=87=E7=BA=A7=202=E3=80=81=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=95=86=E5=93=81=E7=AE=A1=E7=90=86=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 9 +- ruoyi-ui/src/api/business/english/article.js | 18 -- ruoyi-ui/src/api/common.js | 21 ++ ruoyi-ui/src/api/mall/product/brand.js | 48 ++++ ruoyi-ui/src/utils/socket-server.js | 1 - .../views/business/english/article/add.vue | 3 +- .../mall/product/brand-add-or-update.vue | 149 +++++++++++ ruoyi-ui/src/views/mall/product/brand.vue | 238 ++++++++++++++++++ ruoyi-ui/src/views/mall/product/category.vue | 7 +- .../product/controller/BrandController.java | 27 +- .../controller/CategoryController.java | 4 +- .../xjs/mall/product/entity/BrandEntity.java | 8 +- .../xjs-project-mall/mall-third-party/pom.xml | 29 +++ .../mall/thirdparty/MallThirdPartyApp.java | 29 +++ .../src/main/resources/bootstrap.yml | 29 +++ .../src/main/resources/logback.xml | 81 ++++++ .../src/main/resources/rebel.xml | 16 ++ xjs-business/xjs-project-mall/pom.xml | 1 + 18 files changed, 675 insertions(+), 43 deletions(-) create mode 100644 ruoyi-ui/src/api/common.js create mode 100644 ruoyi-ui/src/api/mall/product/brand.js create mode 100644 ruoyi-ui/src/views/mall/product/brand-add-or-update.vue create mode 100644 ruoyi-ui/src/views/mall/product/brand.vue create mode 100644 xjs-business/xjs-project-mall/mall-third-party/pom.xml create mode 100644 xjs-business/xjs-project-mall/mall-third-party/src/main/java/com/xjs/mall/thirdparty/MallThirdPartyApp.java create mode 100644 xjs-business/xjs-project-mall/mall-third-party/src/main/resources/bootstrap.yml create mode 100644 xjs-business/xjs-project-mall/mall-third-party/src/main/resources/logback.xml create mode 100644 xjs-business/xjs-project-mall/mall-third-party/src/main/resources/rebel.xml diff --git a/pom.xml b/pom.xml index a617fdfb..c1ebee85 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ 2020.0.4 2021.1 2.0.3 - 2.5.4 + 2.6.0 2.2.0 3.0.0 1.6.2 @@ -50,6 +50,7 @@ 3.5.1 5.7.1 0.7.5 + 2.2.0.RELEASE @@ -131,6 +132,12 @@ import + + com.alibaba.cloud + spring-cloud-starter-alicloud-oss + ${spring-cloud-alicloud-oss.version} + + com.alibaba.nacos diff --git a/ruoyi-ui/src/api/business/english/article.js b/ruoyi-ui/src/api/business/english/article.js index af6c079f..3f99ed09 100644 --- a/ruoyi-ui/src/api/business/english/article.js +++ b/ruoyi-ui/src/api/business/english/article.js @@ -26,24 +26,6 @@ export function addArticle(data) { }) } -//上传图片 -export function uploadImg(data){ - return request({ - url: '/file/upload', - method: 'post', - data: data - }) -} - -//删除图片 -export function removeImg(url){ - return request({ - url: '/file/remove', - method: 'delete', - params: url - }) -} - // 修改英语文章 export function updateArticle(data) { return request({ diff --git a/ruoyi-ui/src/api/common.js b/ruoyi-ui/src/api/common.js new file mode 100644 index 00000000..11ee3eea --- /dev/null +++ b/ruoyi-ui/src/api/common.js @@ -0,0 +1,21 @@ +//通用的api接口 + +import request from '@/utils/request' + +//上传图片 +export function uploadImg(data){ + return request({ + url: '/file/upload', + method: 'post', + data: data + }) +} + +//删除图片 +export function removeImg(url){ + return request({ + url: '/file/remove', + method: 'delete', + params: url + }) +} diff --git a/ruoyi-ui/src/api/mall/product/brand.js b/ruoyi-ui/src/api/mall/product/brand.js new file mode 100644 index 00000000..79e500e7 --- /dev/null +++ b/ruoyi-ui/src/api/mall/product/brand.js @@ -0,0 +1,48 @@ +import request from '@/utils/request' + +// 获取品牌分页数据 +export function getBrandList(data) { + return request({ + url: '/mall-product/product/brand/list', + method: 'get', + params:data + }) +} + +// 新增品牌信息 +export function addBrand(data) { + return request({ + url: '/mall-product/product/brand/save', + method: 'post', + data:data + }) +} + +// 修改品牌信息 +export function editBrand(data) { + return request({ + url: '/mall-product/product/brand/update', + method: 'put', + data:data + }) +} + +// 获取品牌信息 +export function getBrand(id) { + return request({ + url: '/mall-product/product/brand/info/'+id, + method: 'get', + }) +} + +//删除品牌信息 +export function delBrand(ids) { + return request({ + url: '/mall-product/product/brand/delete', + method: 'delete', + data:ids + }) +} + + + diff --git a/ruoyi-ui/src/utils/socket-server.js b/ruoyi-ui/src/utils/socket-server.js index 432f21a2..adb431ca 100644 --- a/ruoyi-ui/src/utils/socket-server.js +++ b/ruoyi-ui/src/utils/socket-server.js @@ -68,7 +68,6 @@ export default class SocketService { }; // 得到服务端发送过来的数据 this.ws.onmessage = (msg) => { - console.log("从服务端获取到了数据"); // 真正服务端发送过来的原始数据时在msg中的data字段 const recvData = JSON.parse(msg.data); console.log(recvData) diff --git a/ruoyi-ui/src/views/business/english/article/add.vue b/ruoyi-ui/src/views/business/english/article/add.vue index 3386032a..c8be2560 100644 --- a/ruoyi-ui/src/views/business/english/article/add.vue +++ b/ruoyi-ui/src/views/business/english/article/add.vue @@ -41,7 +41,8 @@ diff --git a/ruoyi-ui/src/views/mall/product/brand.vue b/ruoyi-ui/src/views/mall/product/brand.vue new file mode 100644 index 00000000..60a5094a --- /dev/null +++ b/ruoyi-ui/src/views/mall/product/brand.vue @@ -0,0 +1,238 @@ + + + diff --git a/ruoyi-ui/src/views/mall/product/category.vue b/ruoyi-ui/src/views/mall/product/category.vue index 28e02d6e..66affca2 100644 --- a/ruoyi-ui/src/views/mall/product/category.vue +++ b/ruoyi-ui/src/views/mall/product/category.vue @@ -142,13 +142,18 @@ export default { this.menus = res.page; }) }, - + batchDelete() { let catIds = []; let checkedNodes = this.$refs.menuTree.getCheckedNodes(); for (let i = 0; i < checkedNodes.length; i++) { catIds.push(checkedNodes[i].catId); } + if (catIds.length===0) { + this.$modal.notifyWarning("请选择删除内容") + return + } + this.$confirm(`是否批量删除菜单?`, "提示", { confirmButtonText: "确定", cancelButtonText: "取消", diff --git a/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/controller/BrandController.java b/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/controller/BrandController.java index c98aae06..f0ce095e 100644 --- a/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/controller/BrandController.java +++ b/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/controller/BrandController.java @@ -1,19 +1,14 @@ package com.xjs.mall.product.controller; -import java.util.Arrays; -import java.util.Map; - -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.xjs.mall.product.entity.BrandEntity; import com.xjs.mall.product.service.BrandService; import com.xjs.utils.PageUtils; import com.xjs.utils.R; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.Map; @@ -33,7 +28,7 @@ public class BrandController { /** * 列表 */ - @RequestMapping("/list") + @GetMapping("/list") public R list(@RequestParam Map params){ PageUtils page = brandService.queryPage(params); @@ -44,17 +39,17 @@ public class BrandController { /** * 信息 */ - @RequestMapping("/info/{brandId}") + @GetMapping("/info/{brandId}") public R info(@PathVariable("brandId") Long brandId){ BrandEntity brand = brandService.getById(brandId); - return R.ok().put("brand", brand); + return R.ok().put("data", brand); } /** * 保存 */ - @RequestMapping("/save") + @PostMapping("/save") public R save(@RequestBody BrandEntity brand){ brandService.save(brand); @@ -64,7 +59,7 @@ public class BrandController { /** * 修改 */ - @RequestMapping("/update") + @PutMapping("/update") public R update(@RequestBody BrandEntity brand){ brandService.updateById(brand); @@ -74,7 +69,7 @@ public class BrandController { /** * 删除 */ - @RequestMapping("/delete") + @DeleteMapping("/delete") public R delete(@RequestBody Long[] brandIds){ brandService.removeByIds(Arrays.asList(brandIds)); diff --git a/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/controller/CategoryController.java b/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/controller/CategoryController.java index 65d86c0a..5b7b054f 100644 --- a/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/controller/CategoryController.java +++ b/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/controller/CategoryController.java @@ -90,7 +90,9 @@ public class CategoryController { @ApiOperation("删除") @Log(title = "商品分类", businessType = BusinessType.DELETE) public R delete(@RequestBody Long[] catIds) { - + if (catIds == null || catIds.length == 0) { + return R.error("请选择删除的分类"); + } categoryService.removeMenuByIds(Arrays.asList(catIds)); return R.ok(); diff --git a/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/entity/BrandEntity.java b/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/entity/BrandEntity.java index 55112ba1..78fed74d 100644 --- a/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/entity/BrandEntity.java +++ b/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/entity/BrandEntity.java @@ -1,18 +1,18 @@ package com.xjs.mall.product.entity; +import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; import java.io.Serializable; -import java.util.Date; -import lombok.Data; /** * 品牌 * * @author xiejs * @email 1294405880@qq.com - * @date 2022-03-15 10:16:53 + * @since 2022-03-15 10:16:53 */ @Data @TableName("pms_brand") @@ -22,7 +22,7 @@ public class BrandEntity implements Serializable { /** * 品牌id */ - @TableId + @TableId(type = IdType.ASSIGN_ID) private Long brandId; /** * 品牌名 diff --git a/xjs-business/xjs-project-mall/mall-third-party/pom.xml b/xjs-business/xjs-project-mall/mall-third-party/pom.xml new file mode 100644 index 00000000..7817e4c4 --- /dev/null +++ b/xjs-business/xjs-project-mall/mall-third-party/pom.xml @@ -0,0 +1,29 @@ + + + + xjs-project-mall + com.xjs + 3.3.0 + + 4.0.0 + 第三方服务 + + mall-third-party + + + 11 + 11 + + + + + + + com.alibaba.cloud + spring-cloud-starter-alicloud-oss + + + + \ No newline at end of file diff --git a/xjs-business/xjs-project-mall/mall-third-party/src/main/java/com/xjs/mall/thirdparty/MallThirdPartyApp.java b/xjs-business/xjs-project-mall/mall-third-party/src/main/java/com/xjs/mall/thirdparty/MallThirdPartyApp.java new file mode 100644 index 00000000..93008626 --- /dev/null +++ b/xjs-business/xjs-project-mall/mall-third-party/src/main/java/com/xjs/mall/thirdparty/MallThirdPartyApp.java @@ -0,0 +1,29 @@ +package com.xjs.mall.thirdparty; + +import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration; +import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration; +import com.ruoyi.common.security.annotation.EnableCustomConfig; +import com.ruoyi.common.security.annotation.EnableRyFeignClients; +import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2; +import io.seata.spring.boot.autoconfigure.SeataAutoConfiguration; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; + +/** + * 商城Product启动器 + * @author xiejs + * @since 2022-03-15 + */ +@SpringBootApplication(exclude ={DataSourceAutoConfiguration.class, + SeataAutoConfiguration.class, + MybatisPlusAutoConfiguration.class, + DynamicDataSourceAutoConfiguration.class} ) +@EnableCustomConfig +@EnableCustomSwagger2 +@EnableRyFeignClients +public class MallThirdPartyApp { + public static void main(String[] args) { + SpringApplication.run(MallThirdPartyApp.class, args); + } +} diff --git a/xjs-business/xjs-project-mall/mall-third-party/src/main/resources/bootstrap.yml b/xjs-business/xjs-project-mall/mall-third-party/src/main/resources/bootstrap.yml new file mode 100644 index 00000000..63c05722 --- /dev/null +++ b/xjs-business/xjs-project-mall/mall-third-party/src/main/resources/bootstrap.yml @@ -0,0 +1,29 @@ +# Tomcat +server: + port: 9986 + +# Spring +spring: + application: + # 应用名称 + name: xjs-mall-third-party + profiles: + # 环境配置 + active: dev + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 127.0.0.1:8848 + config: + # 配置中心地址 + server-addr: 127.0.0.1:8848 + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + #配置组 + group: xjs + #命名空间 + namespace: xjs-666 diff --git a/xjs-business/xjs-project-mall/mall-third-party/src/main/resources/logback.xml b/xjs-business/xjs-project-mall/mall-third-party/src/main/resources/logback.xml new file mode 100644 index 00000000..45a245e0 --- /dev/null +++ b/xjs-business/xjs-project-mall/mall-third-party/src/main/resources/logback.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/xjs-business/xjs-project-mall/mall-third-party/src/main/resources/rebel.xml b/xjs-business/xjs-project-mall/mall-third-party/src/main/resources/rebel.xml new file mode 100644 index 00000000..71291e83 --- /dev/null +++ b/xjs-business/xjs-project-mall/mall-third-party/src/main/resources/rebel.xml @@ -0,0 +1,16 @@ + + + + + + mall-third-party + + + + + + + diff --git a/xjs-business/xjs-project-mall/pom.xml b/xjs-business/xjs-project-mall/pom.xml index 7f72ac09..7b2107eb 100644 --- a/xjs-business/xjs-project-mall/pom.xml +++ b/xjs-business/xjs-project-mall/pom.xml @@ -16,6 +16,7 @@ mall-member mall-coupon renren-generator + mall-third-party pom