From b1cc202f066c77dfaa123d5221076623febf14cb Mon Sep 17 00:00:00 2001
From: ASUS <1621302159@qq.com>
Date: Mon, 18 Dec 2023 09:45:50 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9B=BE=E7=89=87(=E7=B1=BB?=
=?UTF-8?q?=E5=9E=8B=E6=90=9C=E7=B4=A2,=20=E5=95=86=E5=93=81=E5=88=97?=
=?UTF-8?q?=E8=A1=A8,=20=E6=B7=BB=E5=8A=A0=E5=95=86=E5=93=81,=20=E4=B8=8A?=
=?UTF-8?q?=E4=BC=A0=E5=9B=BE=E7=89=87)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.idea/inspectionProfiles/Project_Default.xml | 8 +
bwie-common/pom.xml | 13 +-
.../com/bwie/common/pojo/DTO/DTOShop.java | 8 +
.../java/com/bwie/common/pojo/VO/VOShop.java | 35 ++++
.../java/com/bwie/common/utils/FastUtil.java | 55 +++++++
.../com/bwie/common/utils/GenCodeUtils.java | 87 ++++++++++
.../java/com/bwie/common/utils/OssUtil.java | 153 ++++++++++++++++++
.../bwie/list/controller/ShopController.java | 34 ++++
.../bwie/list/controller/TypeController.java | 20 +++
.../java/com/bwie/list/mapper/ShopMapper.java | 16 ++
.../java/com/bwie/list/mapper/TypeMapper.java | 12 ++
.../com/bwie/list/service/ShopService.java | 14 ++
.../com/bwie/list/service/TypeService.java | 8 +
.../list/service/impl/ShopServiceImpl.java | 66 ++++++++
.../list/service/impl/TypeServiceImpl.java | 23 +++
.../src/main/resources/bootstrap.yml | 12 ++
.../src/main/resources/mapper/ShopMapper.xml | 42 +++++
.../main/resources/mapper/SysUserMapper.xml | 6 -
.../src/main/resources/mapper/TypeMapper.xml | 8 +
19 files changed, 613 insertions(+), 7 deletions(-)
create mode 100644 .idea/inspectionProfiles/Project_Default.xml
create mode 100644 bwie-common/src/main/java/com/bwie/common/pojo/VO/VOShop.java
create mode 100644 bwie-common/src/main/java/com/bwie/common/utils/FastUtil.java
create mode 100644 bwie-common/src/main/java/com/bwie/common/utils/GenCodeUtils.java
create mode 100644 bwie-common/src/main/java/com/bwie/common/utils/OssUtil.java
create mode 100644 bwie-models/bwie-shopList/src/main/java/com/bwie/list/controller/ShopController.java
create mode 100644 bwie-models/bwie-shopList/src/main/java/com/bwie/list/controller/TypeController.java
create mode 100644 bwie-models/bwie-shopList/src/main/java/com/bwie/list/mapper/ShopMapper.java
create mode 100644 bwie-models/bwie-shopList/src/main/java/com/bwie/list/mapper/TypeMapper.java
create mode 100644 bwie-models/bwie-shopList/src/main/java/com/bwie/list/service/ShopService.java
create mode 100644 bwie-models/bwie-shopList/src/main/java/com/bwie/list/service/TypeService.java
create mode 100644 bwie-models/bwie-shopList/src/main/java/com/bwie/list/service/impl/ShopServiceImpl.java
create mode 100644 bwie-models/bwie-shopList/src/main/java/com/bwie/list/service/impl/TypeServiceImpl.java
create mode 100644 bwie-models/bwie-shopList/src/main/resources/mapper/ShopMapper.xml
delete mode 100644 bwie-models/bwie-shopList/src/main/resources/mapper/SysUserMapper.xml
create mode 100644 bwie-models/bwie-shopList/src/main/resources/mapper/TypeMapper.xml
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..9394f4d
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/bwie-common/pom.xml b/bwie-common/pom.xml
index 0e5576b..112e473 100644
--- a/bwie-common/pom.xml
+++ b/bwie-common/pom.xml
@@ -98,12 +98,23 @@
dysmsapi20170525
2.0.1
+
+
+ com.aliyun.oss
+ aliyun-sdk-oss
+ 3.12.0
+
org.springframework.boot
spring-boot-starter-amqp
-
+
+
+ com.github.tobato
+ fastdfs-client
+ 1.26.5
+
diff --git a/bwie-common/src/main/java/com/bwie/common/pojo/DTO/DTOShop.java b/bwie-common/src/main/java/com/bwie/common/pojo/DTO/DTOShop.java
index 00d9c09..4a6541d 100644
--- a/bwie-common/src/main/java/com/bwie/common/pojo/DTO/DTOShop.java
+++ b/bwie-common/src/main/java/com/bwie/common/pojo/DTO/DTOShop.java
@@ -1,10 +1,13 @@
package com.bwie.common.pojo.DTO;
+import com.bwie.common.pojo.Picture;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
+import java.util.List;
+
@Data
@AllArgsConstructor
@NoArgsConstructor
@@ -22,4 +25,9 @@ public class DTOShop {
//商品类型名称
private String typeName;
+ //图片
+ private List pictureUrl;
+
+
+
}
diff --git a/bwie-common/src/main/java/com/bwie/common/pojo/VO/VOShop.java b/bwie-common/src/main/java/com/bwie/common/pojo/VO/VOShop.java
new file mode 100644
index 0000000..b129737
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/pojo/VO/VOShop.java
@@ -0,0 +1,35 @@
+package com.bwie.common.pojo.VO;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+
+import java.util.List;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@ToString
+public class VOShop {
+
+ //类型id
+ private Integer typeId;
+ //商品id
+ private Integer shopId;
+ //商品名称
+ private String shopName;
+ //商品价格
+ private double shopPrice;
+ //商品类型名称
+ private String typeName;
+
+ //图片
+ private List pictureUrl;
+
+ //分页
+ private Integer pageNum=1;
+ private Integer pageSize=3;
+
+
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/utils/FastUtil.java b/bwie-common/src/main/java/com/bwie/common/utils/FastUtil.java
new file mode 100644
index 0000000..3dbda5b
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/utils/FastUtil.java
@@ -0,0 +1,55 @@
+package com.bwie.common.utils;
+
+import org.springframework.stereotype.Component;
+import com.github.tobato.fastdfs.domain.fdfs.StorePath;
+import com.github.tobato.fastdfs.service.FastFileStorageClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.util.StringUtils;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+
+/**
+ * @BelongsProject: 0107day02
+ * @BelongsPackage: com.bw.config
+ * @Author: zhupengfei
+ * @CreateTime: 2023-02-01 08:52
+ */
+@Component
+public class FastUtil {
+ private static final Logger log = LoggerFactory.getLogger(FastUtil.class);
+
+ @Resource
+ private FastFileStorageClient storageClient ;
+
+ /**
+ * 上传文件
+ */
+ public String upload(MultipartFile multipartFile) throws Exception{
+ String originalFilename = multipartFile.getOriginalFilename().
+ substring(multipartFile.getOriginalFilename().
+ lastIndexOf(".") + 1);
+ StorePath storePath = this.storageClient.uploadImageAndCrtThumbImage(
+ multipartFile.getInputStream(),
+ multipartFile.getSize(),originalFilename , null);
+ return storePath.getFullPath();
+ }
+ /**
+ * 删除文件
+ */
+ public String deleteFile(String fileUrl) {
+ if (StringUtils.isEmpty(fileUrl)) {
+ log.info("fileUrl == >>文件路径为空...");
+ return "文件路径不能为空";
+ }
+ try {
+ StorePath storePath = StorePath.parseFromUrl(fileUrl);
+ storageClient.deleteFile(storePath.getGroup(), storePath.getPath());
+ } catch (Exception e) {
+ log.error(e.getMessage());
+ }
+ return "删除成功";
+ }
+
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/utils/GenCodeUtils.java b/bwie-common/src/main/java/com/bwie/common/utils/GenCodeUtils.java
new file mode 100644
index 0000000..24a9722
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/utils/GenCodeUtils.java
@@ -0,0 +1,87 @@
+package com.bwie.common.utils;
+
+import java.util.Random;
+
+/**
+ * @author DongZl
+ * @description: 生成验证码工具类
+ * @Date 2023-5-11 上午 10:09
+ */
+public class GenCodeUtils {
+
+ /**
+ * 数字类型
+ */
+ private static final String NUMBER_STR = "0123456789";
+ /**
+ * 字母类型
+ */
+ private static final String LETTERS_STR = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+ /**
+ * 短信验证码长度
+ */
+ private static final Integer SMS_CODE_LENGTH = 4;
+
+ /**
+ * 生成短信四位验证码
+ * @return 验证码
+ */
+ public static String genLetterStrSms(){
+ return genCode(LETTERS_STR, SMS_CODE_LENGTH);
+ }
+
+ /**
+ * 生成短信四位验证码
+ * @return 验证码
+ */
+ public static String genNumberCodeSms(){
+ return genCode(NUMBER_STR, SMS_CODE_LENGTH);
+ }
+
+ /**
+ * 生成验证码
+ * @param codeLength 验证码长度
+ * @return 验证码
+ */
+ public static String genLetterStr(int codeLength){
+ return genCode(LETTERS_STR, codeLength);
+ }
+
+ /**
+ * 生成验证码
+ * @param codeLength 验证码长度
+ * @return 验证码
+ */
+ public static String genNumberCode( int codeLength){
+ return genCode(NUMBER_STR, codeLength);
+ }
+
+ /**
+ * 生成验证码
+ * @param str 验证码字符串
+ * @param codeLength 验证码长度
+ * @return 验证码
+ */
+ public static String genCode (String str, int codeLength){
+ //将字符串转换为一个新的字符数组。
+ char[] verificationCodeArray = str.toCharArray();
+ Random random = new Random();
+ //计数器
+ int count = 0;
+ StringBuilder stringBuilder = new StringBuilder();
+ do {
+ //随机生成一个随机数
+ int index = random.nextInt(verificationCodeArray.length);
+ char c = verificationCodeArray[index];
+ //限制四位不重复数字
+ if (stringBuilder.indexOf(String.valueOf(c)) == -1) {
+ stringBuilder.append(c);
+ //计数器加1
+ count++;
+ }
+ //当count等于4时结束,随机生成四位数的验证码
+ } while (count != codeLength);
+ return stringBuilder.toString();
+ }
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/utils/OssUtil.java b/bwie-common/src/main/java/com/bwie/common/utils/OssUtil.java
new file mode 100644
index 0000000..9c1383f
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/utils/OssUtil.java
@@ -0,0 +1,153 @@
+package com.bwie.common.utils;
+
+import com.aliyun.oss.OSS;
+import com.aliyun.oss.OSSClientBuilder;
+import com.aliyun.oss.model.GetObjectRequest;
+import com.aliyun.oss.model.PutObjectRequest;
+import lombok.extern.log4j.Log4j2;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.*;
+import java.time.LocalDateTime;
+import java.util.UUID;
+
+/**
+ * Oss服务调用
+ */
+@Log4j2
+public class OssUtil {
+
+ /**
+ * Endpoint 存储对象概述 阿里云主账号AccessKey,accessKeySecret拥有所有API的访问权限 访问路径前缀 存储对象概述
+ */
+ private static String endPoint = "oss-cn-shanghai.aliyuncs.com";
+ private static String accessKeyId = "LTAI5tD2tppzLQ4Rb6yKYyph";
+ private static String accessKeySecret = "KEKNKwVvDq7PZLjE63NPBouqHXox4Q";
+ private static String accessPre = "https://dzlmuyu.oss-cn-shanghai.aliyuncs.com/";
+
+ /**
+ * bucket名称
+ * @return
+ */
+ private static String bucketName = "dzlmuyu";
+
+ private static OSS ossClient ;
+
+ static {
+ ossClient = new OSSClientBuilder().build(
+ endPoint,
+ accessKeyId,
+ accessKeySecret);
+ log.info("oss服务连接成功!");
+ }
+
+ /**
+ * 默认路径上传本地文件
+ * @param filePath
+ */
+ public static String uploadFile(String filePath){
+ return uploadFileForBucket(bucketName,getOssFilePath(filePath) ,filePath);
+ }
+
+ /**
+ * 默认路径上传multipartFile文件
+ * @param multipartFile
+ */
+ public static String uploadMultipartFile(MultipartFile multipartFile) {
+ return uploadMultipartFile(bucketName,getOssFilePath(multipartFile.getOriginalFilename()),multipartFile);
+ }
+ /**
+ * 上传 multipartFile 类型文件
+ * @param bucketName
+ * @param ossPath
+ * @param multipartFile
+ */
+ public static String uploadMultipartFile(String bucketName , String ossPath , MultipartFile multipartFile){
+ InputStream inputStream = null;
+ try {
+ inputStream = multipartFile.getInputStream();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ uploadFileInputStreamForBucket(bucketName, ossPath, inputStream);
+ return accessPre+ossPath;
+ }
+
+ /**
+ * 使用File上传PutObject上传文件 ** 程序默认使用次方法上传
+ * @param bucketName 实例名称
+ * @param ossPath oss存储路径
+ * @param filePath 本地文件路径
+ */
+ public static String uploadFileForBucket(String bucketName , String ossPath , String filePath) {
+ // 创建PutObjectRequest对象。
+ PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, ossPath, new File(filePath));
+
+ // 上传
+ ossClient.putObject(putObjectRequest);
+ return accessPre+ossPath;
+ }
+
+ /**
+ * 使用文件流上传到指定的bucket实例
+ * @param bucketName 实例名称
+ * @param ossPath oss存储路径
+ * @param filePath 本地文件路径
+ */
+ public static String uploadFileInputStreamForBucket(String bucketName , String ossPath , String filePath){
+
+ // 填写本地文件的完整路径。如果未指定本地路径,则默认从示例程序所属项目对应本地路径中上传文件流。
+ InputStream inputStream = null;
+ try {
+ inputStream = new FileInputStream(filePath);
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ }
+ // 填写Bucket名称和Object完整路径。Object完整路径中不能包含Bucket名称。
+ uploadFileInputStreamForBucket(bucketName, ossPath, inputStream);
+ return accessPre+ossPath;
+ }
+
+ public static void uploadFileInputStreamForBucket(String bucketName , String ossPath , InputStream inputStream ){
+ ossClient.putObject(bucketName, ossPath, inputStream);
+ }
+
+ /**
+ * 下载
+ * @param ossFilePath
+ * @param filePath
+ */
+ public static void downloadFile(String ossFilePath , String filePath ){
+ downloadFileForBucket(bucketName , ossFilePath , filePath);
+ }
+ /**
+ * 下载
+ * @param bucketName 实例名称
+ * @param ossFilePath oss存储路径
+ * @param filePath 本地文件路径
+ */
+ public static void downloadFileForBucket(String bucketName , String ossFilePath , String filePath ){
+ ossClient.getObject(new GetObjectRequest(bucketName, ossFilePath), new File(filePath));
+ }
+
+ /**
+ *
+ * @return
+ */
+ public static String getOssDefaultPath(){
+ LocalDateTime now = LocalDateTime.now();
+ String url =
+ now.getYear()+"/"+
+ now.getMonth()+"/"+
+ now.getDayOfMonth()+"/"+
+ now.getHour()+"/"+
+ now.getMinute()+"/";
+ return url;
+ }
+
+ public static String getOssFilePath(String filePath){
+ String fileSuf = filePath.substring(filePath.indexOf(".") + 1);
+ return getOssDefaultPath() + UUID.randomUUID().toString() + "." + fileSuf;
+ }
+
+}
diff --git a/bwie-models/bwie-shopList/src/main/java/com/bwie/list/controller/ShopController.java b/bwie-models/bwie-shopList/src/main/java/com/bwie/list/controller/ShopController.java
new file mode 100644
index 0000000..0434881
--- /dev/null
+++ b/bwie-models/bwie-shopList/src/main/java/com/bwie/list/controller/ShopController.java
@@ -0,0 +1,34 @@
+package com.bwie.list.controller;
+
+import com.bwie.common.pojo.VO.VOShop;
+import com.bwie.common.result.Result;
+import com.bwie.list.service.ShopService;
+import lombok.extern.log4j.Log4j2;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+@RestController
+@Log4j2
+public class ShopController {
+ @Autowired
+ private ShopService shopService;
+
+ //展示商品列表
+ @PostMapping("/shopList")
+ public Result shopList(@RequestBody VOShop voShop){
+ return shopService.shopList(voShop);
+ }
+
+ //上传图片
+ @PostMapping("/upImg")
+ public Result upImg(@RequestParam("file")MultipartFile myFile){
+ return shopService.upImg(myFile);
+ }
+ //添加商品
+ @PostMapping("/addShop")
+ public Result addShop(@RequestBody VOShop shop){
+ return shopService.addShop(shop);
+ }
+
+}
diff --git a/bwie-models/bwie-shopList/src/main/java/com/bwie/list/controller/TypeController.java b/bwie-models/bwie-shopList/src/main/java/com/bwie/list/controller/TypeController.java
new file mode 100644
index 0000000..4359e53
--- /dev/null
+++ b/bwie-models/bwie-shopList/src/main/java/com/bwie/list/controller/TypeController.java
@@ -0,0 +1,20 @@
+package com.bwie.list.controller;
+
+import com.bwie.common.result.Result;
+import com.bwie.list.service.TypeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+public class TypeController {
+ @Autowired
+ private TypeService typeService;
+
+ // 根据商品类型查询商品的商品类型菜单栏
+ @GetMapping("/findType")
+ public Result findType(){
+ return typeService.findType();
+ }
+
+}
diff --git a/bwie-models/bwie-shopList/src/main/java/com/bwie/list/mapper/ShopMapper.java b/bwie-models/bwie-shopList/src/main/java/com/bwie/list/mapper/ShopMapper.java
new file mode 100644
index 0000000..d154b98
--- /dev/null
+++ b/bwie-models/bwie-shopList/src/main/java/com/bwie/list/mapper/ShopMapper.java
@@ -0,0 +1,16 @@
+package com.bwie.list.mapper;
+
+import com.bwie.common.pojo.DTO.DTOShop;
+import com.bwie.common.pojo.VO.VOShop;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface ShopMapper {
+ List shopList(VOShop voShop);
+
+ Integer addShop(VOShop shop);
+
+ void addImg(VOShop shop);
+}
diff --git a/bwie-models/bwie-shopList/src/main/java/com/bwie/list/mapper/TypeMapper.java b/bwie-models/bwie-shopList/src/main/java/com/bwie/list/mapper/TypeMapper.java
new file mode 100644
index 0000000..c0a27fe
--- /dev/null
+++ b/bwie-models/bwie-shopList/src/main/java/com/bwie/list/mapper/TypeMapper.java
@@ -0,0 +1,12 @@
+package com.bwie.list.mapper;
+
+import com.bwie.common.pojo.Type;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface TypeMapper {
+
+ List findType();
+}
diff --git a/bwie-models/bwie-shopList/src/main/java/com/bwie/list/service/ShopService.java b/bwie-models/bwie-shopList/src/main/java/com/bwie/list/service/ShopService.java
new file mode 100644
index 0000000..e7617a4
--- /dev/null
+++ b/bwie-models/bwie-shopList/src/main/java/com/bwie/list/service/ShopService.java
@@ -0,0 +1,14 @@
+package com.bwie.list.service;
+
+import com.bwie.common.pojo.VO.VOShop;
+import com.bwie.common.result.Result;
+import org.springframework.web.multipart.MultipartFile;
+
+public interface ShopService {
+ Result shopList(VOShop voShop);
+
+ Result addShop(VOShop shop);
+
+ Result upImg(MultipartFile myFile);
+
+}
diff --git a/bwie-models/bwie-shopList/src/main/java/com/bwie/list/service/TypeService.java b/bwie-models/bwie-shopList/src/main/java/com/bwie/list/service/TypeService.java
new file mode 100644
index 0000000..c3eef42
--- /dev/null
+++ b/bwie-models/bwie-shopList/src/main/java/com/bwie/list/service/TypeService.java
@@ -0,0 +1,8 @@
+package com.bwie.list.service;
+
+import com.bwie.common.result.Result;
+
+public interface TypeService {
+ Result findType();
+
+}
diff --git a/bwie-models/bwie-shopList/src/main/java/com/bwie/list/service/impl/ShopServiceImpl.java b/bwie-models/bwie-shopList/src/main/java/com/bwie/list/service/impl/ShopServiceImpl.java
new file mode 100644
index 0000000..29349b6
--- /dev/null
+++ b/bwie-models/bwie-shopList/src/main/java/com/bwie/list/service/impl/ShopServiceImpl.java
@@ -0,0 +1,66 @@
+package com.bwie.list.service.impl;
+
+import com.bwie.common.pojo.DTO.DTOShop;
+import com.bwie.common.pojo.VO.VOShop;
+import com.bwie.common.result.Result;
+import com.bwie.common.utils.FastUtil;
+import com.bwie.list.mapper.ShopMapper;
+import com.bwie.list.service.ShopService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
+@Service
+public class ShopServiceImpl implements ShopService {
+ @Autowired
+ private ShopMapper shopMapper;
+ @Autowired
+ private FastUtil fastUtil;
+
+ @Override
+ public Result shopList(VOShop voShop) {
+
+ PageHelper.startPage(voShop.getPageNum(),voShop.getPageSize());
+
+ List dtoShops = shopMapper.shopList(voShop);
+
+ PageInfo info = new PageInfo<>(dtoShops);
+
+ return Result.success(info,"商品列表展示");
+ }
+
+ @Override
+ public Result addShop(VOShop shop) {
+
+ Integer i = shopMapper.addShop(shop);
+ if (i>0){
+ shopMapper.addImg(shop);
+ return Result.success(shop,"成功");
+ }
+ return Result.error("失败");
+ }
+
+ @Override
+ public Result upImg(MultipartFile myFile) {
+
+ String url = null;
+
+ try {
+ url = fastUtil.upload(myFile);
+
+ if (url==null || url.equals("")){
+ return Result.error("图片上传失败");
+ }
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+
+ return Result.success("http://82.157.236.130:8888/"+url,"上传成功");
+ }
+}
diff --git a/bwie-models/bwie-shopList/src/main/java/com/bwie/list/service/impl/TypeServiceImpl.java b/bwie-models/bwie-shopList/src/main/java/com/bwie/list/service/impl/TypeServiceImpl.java
new file mode 100644
index 0000000..4c572f6
--- /dev/null
+++ b/bwie-models/bwie-shopList/src/main/java/com/bwie/list/service/impl/TypeServiceImpl.java
@@ -0,0 +1,23 @@
+package com.bwie.list.service.impl;
+
+import com.bwie.common.pojo.Type;
+import com.bwie.common.result.Result;
+import com.bwie.list.mapper.TypeMapper;
+import com.bwie.list.service.TypeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class TypeServiceImpl implements TypeService {
+ @Autowired
+ private TypeMapper typeMapper;
+
+ @Override
+ public Result findType() {
+ List typeList = typeMapper.findType();
+ return Result.success(typeList,"类型展示");
+ }
+}
+
diff --git a/bwie-models/bwie-shopList/src/main/resources/bootstrap.yml b/bwie-models/bwie-shopList/src/main/resources/bootstrap.yml
index 178924b..f67aa2a 100644
--- a/bwie-models/bwie-shopList/src/main/resources/bootstrap.yml
+++ b/bwie-models/bwie-shopList/src/main/resources/bootstrap.yml
@@ -27,3 +27,15 @@ spring:
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
+fdfs:
+ so-timeout: 1500 # socket 连接时长
+ connect-timeout: 600 # 连接 tracker 服务器超时时长
+ # 这两个是你服务器的 IP 地址,注意 23000 端口也要打开,阿里云服务器记得配置安全组。tracker 要和 stroage 服务进行交流
+ tracker-list: 82.157.236.130:22122
+ web-server-url: 82.157.236.130:8888
+ pool:
+ jmx-enabled: false
+ # 生成缩略图
+ thumb-image:
+ height: 500
+ width: 500
\ No newline at end of file
diff --git a/bwie-models/bwie-shopList/src/main/resources/mapper/ShopMapper.xml b/bwie-models/bwie-shopList/src/main/resources/mapper/ShopMapper.xml
new file mode 100644
index 0000000..b20e457
--- /dev/null
+++ b/bwie-models/bwie-shopList/src/main/resources/mapper/ShopMapper.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO `shop_manage`.`t_shop` (`shop_name`, `shop_price`, `type_id`)
+ VALUES ( #{shopName}, #{shopPrice}, #{typeId});
+
+
+ INSERT INTO `shop_manage`.`t_picture`(`picture_url`,`shop_id`)
+ VALUES
+
+ (#{url},#{shopId})
+
+
+
+
+
+
+
diff --git a/bwie-models/bwie-shopList/src/main/resources/mapper/SysUserMapper.xml b/bwie-models/bwie-shopList/src/main/resources/mapper/SysUserMapper.xml
deleted file mode 100644
index d089973..0000000
--- a/bwie-models/bwie-shopList/src/main/resources/mapper/SysUserMapper.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/bwie-models/bwie-shopList/src/main/resources/mapper/TypeMapper.xml b/bwie-models/bwie-shopList/src/main/resources/mapper/TypeMapper.xml
new file mode 100644
index 0000000..b3279c5
--- /dev/null
+++ b/bwie-models/bwie-shopList/src/main/resources/mapper/TypeMapper.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+