Procházet zdrojové kódy

Merge branch 'master' of http://47.100.37.243:10080/ZHOU/yunsu

wutt před 5 roky
rodič
revize
dd9a64cce1
37 změnil soubory, kde provedl 513 přidání a 369 odebrání
  1. 59 0
      official_backend/src/main/java/com/hssx/ysofficial/controller/VipProductsController.java
  2. 1 1
      official_backend/src/main/java/com/hssx/ysofficial/entity/Article.java
  3. 1 1
      official_backend/src/main/java/com/hssx/ysofficial/entity/BannerPictures.java
  4. 9 9
      official_backend/src/main/java/com/hssx/ysofficial/entity/Comment.java
  5. 1 7
      official_backend/src/main/java/com/hssx/ysofficial/entity/CompanyProducts.java
  6. 4 4
      official_backend/src/main/java/com/hssx/ysofficial/entity/Cooperations.java
  7. 1 4
      official_backend/src/main/java/com/hssx/ysofficial/entity/OnlineApplication.java
  8. 1 1
      official_backend/src/main/java/com/hssx/ysofficial/entity/User.java
  9. 71 0
      official_backend/src/main/java/com/hssx/ysofficial/entity/VipProducts.java
  10. 16 0
      official_backend/src/main/java/com/hssx/ysofficial/mapper/VipProductsMapper.java
  11. 22 0
      official_backend/src/main/java/com/hssx/ysofficial/service/VipProductsService.java
  12. 80 0
      official_backend/src/main/java/com/hssx/ysofficial/service/impl/VipProductsServiceImpl.java
  13. 1 1
      official_backend/src/main/java/com/hssx/ysofficial/utility/CodeGenerator.java
  14. 9 2
      official_backend/src/main/resources/application-prod.properties
  15. 10 3
      official_backend/src/main/resources/application.properties
  16. 1 2
      official_backend/src/main/resources/mapper/CompanyProductsMapper.xml
  17. 20 0
      official_backend/src/main/resources/mapper/VipProductsMapper.xml
  18. 0 5
      website/src/main/java/com/hssx/website/controller/ArticleController.java
  19. 0 21
      website/src/main/java/com/hssx/website/controller/CompanyProductsController.java
  20. 9 5
      website/src/main/java/com/hssx/website/controller/UserController.java
  21. 7 78
      website/src/main/java/com/hssx/website/entity/Article.java
  22. 7 60
      website/src/main/java/com/hssx/website/entity/BannerPictures.java
  23. 7 51
      website/src/main/java/com/hssx/website/entity/Comment.java
  24. 1 7
      website/src/main/java/com/hssx/website/entity/CompanyProducts.java
  25. 8 61
      website/src/main/java/com/hssx/website/entity/Cooperations.java
  26. 1 1
      website/src/main/java/com/hssx/website/entity/OnlineApplication.java
  27. 7 33
      website/src/main/java/com/hssx/website/entity/User.java
  28. 69 0
      website/src/main/java/com/hssx/website/entity/VipProducts.java
  29. 16 0
      website/src/main/java/com/hssx/website/mapper/VipProductsMapper.java
  30. 6 1
      website/src/main/java/com/hssx/website/service/UserService.java
  31. 16 0
      website/src/main/java/com/hssx/website/service/VipProductsService.java
  32. 0 1
      website/src/main/java/com/hssx/website/service/impl/ArticleServiceImpl.java
  33. 10 7
      website/src/main/java/com/hssx/website/service/impl/UserServiceImpl.java
  34. 20 0
      website/src/main/java/com/hssx/website/service/impl/VipProductsServiceImpl.java
  35. 1 1
      website/src/main/java/com/hssx/website/until/CodeGenerator.java
  36. 1 2
      website/src/main/resources/mapper/CompanyProductsMapper.xml
  37. 20 0
      website/src/main/resources/mapper/VipProductsMapper.xml

+ 59 - 0
official_backend/src/main/java/com/hssx/ysofficial/controller/VipProductsController.java

@@ -0,0 +1,59 @@
+package com.hssx.ysofficial.controller;
+
+
+import com.hssx.ysofficial.entity.VipProducts;
+import com.hssx.ysofficial.service.VipProductsService;
+import com.hssx.ysofficial.utility.HttpRespMsg;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * <p>
+ * 第一个数据是公司优势 其他是案例 前端控制器
+ * </p>
+ *
+ * @author Reiskuchen
+ * @since 2020-02-05
+ */
+@RestController
+@RequestMapping("/vip-products")
+public class VipProductsController {
+    @Autowired
+    private VipProductsService vipProductsService;
+
+    /**
+     * 分页获取VIP产品
+     * pageIndex 页面索引
+     * pageSize 页面大小
+     */
+    @RequestMapping("/list")
+    public HttpRespMsg getVipProductList(@RequestParam Integer pageIndex, @RequestParam Integer pageSize) {
+        return vipProductsService.getVipProductList(pageIndex, pageSize);
+    }
+
+    /**
+     * 插入或更新VIP产品
+     * id 要修改的产品id(仅修改时)
+     * title 产品标题
+     * introduction 产品介绍
+     * address 地址
+     * file 照片
+     */
+    @RequestMapping("/insertOrUpdate")
+    public HttpRespMsg insertOrUpdateVipProduct(VipProducts vipProducts, MultipartFile file) {
+        return vipProductsService.insertOrUpdateVipProduct(vipProducts, file);
+    }
+
+    /**
+     * 删除VIP产品
+     * id 要删除的产品id
+     */
+    @RequestMapping("/delete")
+    public HttpRespMsg deleteVipProduct(@RequestParam Integer id) {
+        return vipProductsService.deleteVipProduct(id);
+    }
+}
+

+ 1 - 1
official_backend/src/main/java/com/hssx/ysofficial/entity/Article.java

@@ -16,7 +16,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Reiskuchen
- * @since 2019-10-24
+ * @since 2020-02-05
  */
 @Data
 @EqualsAndHashCode(callSuper = false)

+ 1 - 1
official_backend/src/main/java/com/hssx/ysofficial/entity/BannerPictures.java

@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Reiskuchen
- * @since 2019-10-24
+ * @since 2020-02-05
  */
 @Data
 @EqualsAndHashCode(callSuper = false)

+ 9 - 9
official_backend/src/main/java/com/hssx/ysofficial/entity/Comment.java

@@ -1,25 +1,25 @@
 package com.hssx.ysofficial.entity;
 
-import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.extension.activerecord.Model;
-import com.baomidou.mybatisplus.annotation.TableId;
-import java.time.LocalDateTime;
 import com.baomidou.mybatisplus.annotation.TableField;
-import java.io.Serializable;
-
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
 /**
  * <p>
  * the comments left by customers
  * </p>
  *
  * @author Reiskuchen
- * @since 2019-10-24
+ * @since 2020-02-05
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -27,7 +27,7 @@ import lombok.experimental.Accessors;
 @TableName("comment")
 public class Comment extends Model<Comment> {
 
-    private static final long serialVersionUID=1L;
+    private static final long serialVersionUID = 1L;
 
     /**
      * id
@@ -56,8 +56,8 @@ public class Comment extends Model<Comment> {
     /**
      * 留言时间
      */
-    @TableField("indate")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField("indate")
     private LocalDateTime indate;
 
 

+ 1 - 7
official_backend/src/main/java/com/hssx/ysofficial/entity/CompanyProducts.java

@@ -16,7 +16,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Reiskuchen
- * @since 2020-02-04
+ * @since 2020-02-05
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -50,12 +50,6 @@ public class CompanyProducts extends Model<CompanyProducts> {
     @TableField("introduction")
     private String introduction;
 
-    /**
-     * 地址
-     */
-    @TableField("address")
-    private String address;
-
     /**
      * 是否显示在首页 0不显示 1显示
      */

+ 4 - 4
official_backend/src/main/java/com/hssx/ysofficial/entity/Cooperations.java

@@ -16,7 +16,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Reiskuchen
- * @since 2019-10-24
+ * @since 2020-02-05
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -36,7 +36,7 @@ public class Cooperations extends Model<Cooperations> {
     private String name;
 
     /**
-     * 合作者描述
+     * 合作者描述
      */
     @TableField("description")
     private String description;
@@ -48,13 +48,13 @@ public class Cooperations extends Model<Cooperations> {
     private String imageUrl;
 
     /**
-     * 合作者种类: 学校或公司
+     * 合作者种类 0-联合开发 1-材料供应商 2-芯片及PCB版合作伙伴 3-软件合作伙伴 4-投融资服务机构
      */
     @TableField("type")
     private Integer type;
 
     /**
-     * 是否显示于首页 0为不显示 1为显示
+     * 是否显示于首页 0-不显示 1-显示
      */
     @TableField("sticky")
     private Integer sticky;

+ 1 - 4
official_backend/src/main/java/com/hssx/ysofficial/entity/OnlineApplication.java

@@ -7,8 +7,6 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import java.time.LocalDateTime;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
@@ -19,7 +17,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Reiskuchen
- * @since 2019-11-21
+ * @since 2020-02-05
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -69,7 +67,6 @@ public class OnlineApplication extends Model<OnlineApplication> {
      * 申请时间
      */
     @TableField("indate")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime indate;
 
     /**

+ 1 - 1
official_backend/src/main/java/com/hssx/ysofficial/entity/User.java

@@ -16,7 +16,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Reiskuchen
- * @since 2019-10-24
+ * @since 2020-02-05
  */
 @Data
 @EqualsAndHashCode(callSuper = false)

+ 71 - 0
official_backend/src/main/java/com/hssx/ysofficial/entity/VipProducts.java

@@ -0,0 +1,71 @@
+package com.hssx.ysofficial.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 第一个数据是公司优势 其他是案例
+ * </p>
+ *
+ * @author Reiskuchen
+ * @since 2020-02-05
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("vip_products")
+public class VipProducts extends Model<VipProducts> {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * id
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 产品名称
+     */
+    @TableField("title")
+    private String title;
+
+    /**
+     * 产品图片地址
+     */
+    @TableField("image_url")
+    private String imageUrl;
+
+    /**
+     * 简介
+     */
+    @TableField("introduction")
+    private String introduction;
+
+    /**
+     * 地址
+     */
+    @TableField("address")
+    private String address;
+
+    /**
+     * 置顶 0-否 1-是
+     */
+    @TableField("sticky")
+    private Integer sticky;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 16 - 0
official_backend/src/main/java/com/hssx/ysofficial/mapper/VipProductsMapper.java

@@ -0,0 +1,16 @@
+package com.hssx.ysofficial.mapper;
+
+import com.hssx.ysofficial.entity.VipProducts;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 第一个数据是公司优势 其他是案例 Mapper 接口
+ * </p>
+ *
+ * @author Reiskuchen
+ * @since 2020-02-05
+ */
+public interface VipProductsMapper extends BaseMapper<VipProducts> {
+
+}

+ 22 - 0
official_backend/src/main/java/com/hssx/ysofficial/service/VipProductsService.java

@@ -0,0 +1,22 @@
+package com.hssx.ysofficial.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.hssx.ysofficial.entity.VipProducts;
+import com.hssx.ysofficial.utility.HttpRespMsg;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * <p>
+ * 第一个数据是公司优势 其他是案例 服务类
+ * </p>
+ *
+ * @author Reiskuchen
+ * @since 2020-02-05
+ */
+public interface VipProductsService extends IService<VipProducts> {
+    HttpRespMsg getVipProductList(Integer pageIndex, Integer pageSize);
+
+    HttpRespMsg insertOrUpdateVipProduct(VipProducts vipProducts, MultipartFile file);
+
+    HttpRespMsg deleteVipProduct(Integer id);
+}

+ 80 - 0
official_backend/src/main/java/com/hssx/ysofficial/service/impl/VipProductsServiceImpl.java

@@ -0,0 +1,80 @@
+package com.hssx.ysofficial.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hssx.ysofficial.entity.VipProducts;
+import com.hssx.ysofficial.mapper.VipProductsMapper;
+import com.hssx.ysofficial.service.VipProductsService;
+import com.hssx.ysofficial.utility.HttpRespMsg;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.util.UUID;
+
+/**
+ * <p>
+ * 第一个数据是公司优势 其他是案例 服务实现类
+ * </p>
+ *
+ * @author Reiskuchen
+ * @since 2020-02-05
+ */
+@Service
+public class VipProductsServiceImpl extends ServiceImpl<VipProductsMapper, VipProducts> implements VipProductsService {
+
+    @Value("${upload.path}")
+    private String uploadPath;
+
+    @Resource
+    private VipProductsMapper vipProductsMapper;
+
+    @Override
+    public HttpRespMsg getVipProductList(Integer pageIndex, Integer pageSize) {
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        httpRespMsg.data = vipProductsMapper.selectPage(new Page<VipProducts>(pageIndex, pageSize), new QueryWrapper<>());
+        return httpRespMsg;
+    }
+
+    @Override
+    public HttpRespMsg insertOrUpdateVipProduct(VipProducts vipProducts, MultipartFile multipartFile) {
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        if (multipartFile != null) {
+            String fileName = multipartFile.getOriginalFilename();
+            File direction = new File(uploadPath);
+            String rand = UUID.randomUUID().toString().replaceAll("-", "");
+            String suffix = fileName.substring(fileName.lastIndexOf("."));
+            String storedFileName = rand + suffix;
+            try {
+                File savedFile = new File(direction, storedFileName);
+                savedFile.createNewFile();
+                multipartFile.transferTo(savedFile);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            vipProducts.setImageUrl("/upload/" + storedFileName);
+        }
+        if (vipProducts.getId() == null) {
+            if (vipProductsMapper.insert(vipProducts) == 0) {
+                httpRespMsg.setError("新增失败");
+            }
+        } else {
+            if (vipProductsMapper.updateById(vipProducts) == 0) {
+                httpRespMsg.setError("修改失败");
+            }
+        }
+        return httpRespMsg;
+    }
+
+    @Override
+    public HttpRespMsg deleteVipProduct(Integer id) {
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        if (vipProductsMapper.deleteById(id) == 0) {
+            httpRespMsg.setError("删除失败");
+        }
+        return httpRespMsg;
+    }
+}

+ 1 - 1
official_backend/src/main/java/com/hssx/ysofficial/utility/CodeGenerator.java

@@ -190,7 +190,7 @@ public class CodeGenerator {
         //单独生成逗号隔开
 //        strategy.setInclude("");
         //全生成
-        strategy.setInclude("company_products");//表名,多个英文逗号分割
+//        strategy.setInclude();//表名,多个英文逗号分割
         //多个英文逗号隔开
 //        strategy.setInclude(scanner("user").split(","));
         strategy.setControllerMappingHyphenStyle(true);

+ 9 - 2
official_backend/src/main/resources/application-prod.properties

@@ -13,13 +13,16 @@ mybatis-plus.mapper-locations=mapper/*.xml
 mybatis-plus.global-config.db-config.select-strategy=not_empty
 mybatis-plus.global-config.db-config.update-strategy=not_empty
 mybatis-plus.global-config.db-config.insert-strategy=not_empty
+mybatis-plus.configuration.map-underscore-to-camel-case=true
+mybatis-plus.configuration.cache-enabled=false
+
 #Êý¾Ý¿â
 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
 spring.datasource.url=jdbc:mysql://127.0.0.1:3306/cloud_model_website?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
-#spring.datasource.url=jdbc:mysql://118.190.47.230:3306/cloud_model_website?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
-spring.datasource.username=root
 spring.datasource.password=Hssx2019.!
+#spring.datasource.url=jdbc:mysql://118.190.47.230:3306/cloud_model_website?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
 #spring.datasource.password=p011430seya1026
+spring.datasource.username=root
 spring.datasource.hikari.max-lifetime=60000
 spring.datasource.hikari.IdleTimeout=60000
 spring.datasource.hikari.ConnectionTimeout=60000
@@ -32,6 +35,10 @@ spring.servlet.multipart.max-file-size=100MB
 spring.servlet.multipart.max-request-size=100MB
 spring.servlet.multipart.resolve-lazily=false
 
+spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
+spring.jackson.default-property-inclusion=always
+spring.jackson.time-zone=GMT+8
+
 #ÎļþÉÏ´«Â·¾¶
 #upload.path=D:/mould/upload/
 upload.path=E:/staticproject/website/upload

+ 10 - 3
official_backend/src/main/resources/application.properties

@@ -13,13 +13,16 @@ mybatis-plus.mapper-locations=mapper/*.xml
 mybatis-plus.global-config.db-config.select-strategy=not_empty
 mybatis-plus.global-config.db-config.update-strategy=not_empty
 mybatis-plus.global-config.db-config.insert-strategy=not_empty
+mybatis-plus.configuration.map-underscore-to-camel-case=true
+mybatis-plus.configuration.cache-enabled=false
+
 #Êý¾Ý¿â
 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
-#spring.datasource.url=jdbc:mysql://111.231.87.63:3306/cloud_model_website?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
 spring.datasource.url=jdbc:mysql://118.190.47.230:3306/cloud_model_website?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
-spring.datasource.username=root
-#spring.datasource.password=Hssx2019.!
 spring.datasource.password=p011430seya1026
+#spring.datasource.url=jdbc:mysql://111.231.87.63:3306/cloud_model_website?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
+#spring.datasource.password=Hssx2019.!
+spring.datasource.username=root
 spring.datasource.hikari.max-lifetime=60000
 spring.datasource.hikari.IdleTimeout=60000
 spring.datasource.hikari.ConnectionTimeout=60000
@@ -32,6 +35,10 @@ spring.servlet.multipart.max-file-size=100MB
 spring.servlet.multipart.max-request-size=100MB
 spring.servlet.multipart.resolve-lazily=false
 
+spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
+spring.jackson.default-property-inclusion=always
+spring.jackson.time-zone=GMT+8
+
 #ÎļþÉÏ´«Â·¾¶
 upload.path=D:/mould/upload/
 #upload.path=E:/staticproject/website/upload

+ 1 - 2
official_backend/src/main/resources/mapper/CompanyProductsMapper.xml

@@ -8,14 +8,13 @@
         <result column="title" property="title" />
         <result column="image_url" property="imageUrl" />
         <result column="introduction" property="introduction" />
-        <result column="address" property="address" />
         <result column="sticky" property="sticky" />
         <result column="type" property="type" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, title, image_url, introduction, address, sticky, type
+        id, title, image_url, introduction, sticky, type
     </sql>
 
 </mapper>

+ 20 - 0
official_backend/src/main/resources/mapper/VipProductsMapper.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.hssx.ysofficial.mapper.VipProductsMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.hssx.ysofficial.entity.VipProducts">
+        <id column="id" property="id" />
+        <result column="title" property="title" />
+        <result column="image_url" property="imageUrl" />
+        <result column="introduction" property="introduction" />
+        <result column="address" property="address" />
+        <result column="sticky" property="sticky" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, title, image_url, introduction, address, sticky
+    </sql>
+
+</mapper>

+ 0 - 5
website/src/main/java/com/hssx/website/controller/ArticleController.java

@@ -1,19 +1,14 @@
 package com.hssx.website.controller;
 
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.hssx.website.entity.Comment;
 import com.hssx.website.entity.OnlineApplication;
 import com.hssx.website.service.ArticleService;
 import com.hssx.website.service.CommentService;
-import com.hssx.website.service.CompanyProductsService;
 import com.hssx.website.service.OnlineApplicationService;
 import com.hssx.website.until.HttpRespMsg;
 import com.hssx.website.until.PageUtil;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.PropertySource;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.GetMapping;

+ 0 - 21
website/src/main/java/com/hssx/website/controller/CompanyProductsController.java

@@ -1,21 +0,0 @@
-package com.hssx.website.controller;
-
-
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- * 第一个数据是公司优势 其他是案例 前端控制器
- * </p>
- *
- * @author 吴涛涛
- * @since 2020-02-04
- */
-@RestController
-@RequestMapping("/company-products")
-public class CompanyProductsController {
-
-}
-

+ 9 - 5
website/src/main/java/com/hssx/website/controller/UserController.java

@@ -1,15 +1,12 @@
 package com.hssx.website.controller;
 
-import com.hssx.website.entity.Comment;
-import com.hssx.website.service.ArticleService;
-import com.hssx.website.service.CommentService;
 import com.hssx.website.service.UserService;
-import com.hssx.website.until.HttpRespMsg;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 
 @Controller
 public class UserController {
@@ -44,5 +41,12 @@ public class UserController {
         model = userService.getDetail(model, id);
         return "caseDetail";
     }
+
+    @ApiOperation("VIP")
+    @GetMapping("/vip")
+    public String vip(Model model) {
+        model = userService.getVip(model);
+        return "vip";
+    }
 }
 

+ 7 - 78
website/src/main/java/com/hssx/website/entity/Article.java

@@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
 
 /**
  * <p>
@@ -12,8 +15,11 @@ import java.io.Serializable;
  * </p>
  *
  * @author 吴涛涛
- * @since 2019-10-24
+ * @since 2020-02-05
  */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
 public class Article extends Model<Article> {
 
     private static final long serialVersionUID=1L;
@@ -67,86 +73,9 @@ public class Article extends Model<Article> {
     private String introduction;
 
 
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public String getContent() {
-        return content;
-    }
-
-    public void setContent(String content) {
-        this.content = content;
-    }
-
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public Integer getSticky() {
-        return sticky;
-    }
-
-    public void setSticky(Integer sticky) {
-        this.sticky = sticky;
-    }
-
-    public Integer getPosition() {
-        return position;
-    }
-
-    public void setPosition(Integer position) {
-        this.position = position;
-    }
-
-    public String getImageUrl() {
-        return imageUrl;
-    }
-
-    public void setImageUrl(String imageUrl) {
-        this.imageUrl = imageUrl;
-    }
-
-    public String getIntroduction() {
-        return introduction;
-    }
-
-    public void setIntroduction(String introduction) {
-        this.introduction = introduction;
-    }
-
     @Override
     protected Serializable pkVal() {
         return this.id;
     }
 
-    @Override
-    public String toString() {
-        return "Article{" +
-        "id=" + id +
-        ", title=" + title +
-        ", content=" + content +
-        ", type=" + type +
-        ", sticky=" + sticky +
-        ", position=" + position +
-        ", imageUrl=" + imageUrl +
-        ", introduction=" + introduction +
-        "}";
-    }
 }

+ 7 - 60
website/src/main/java/com/hssx/website/entity/BannerPictures.java

@@ -6,6 +6,9 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import java.time.LocalDateTime;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
 
 /**
  * <p>
@@ -13,8 +16,11 @@ import java.io.Serializable;
  * </p>
  *
  * @author 吴涛涛
- * @since 2019-10-24
+ * @since 2020-02-05
  */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
 public class BannerPictures extends Model<BannerPictures> {
 
     private static final long serialVersionUID=1L;
@@ -56,68 +62,9 @@ public class BannerPictures extends Model<BannerPictures> {
     private LocalDateTime uploadIndate;
 
 
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public String getUrl() {
-        return url;
-    }
-
-    public void setUrl(String url) {
-        this.url = url;
-    }
-
-    public String getFileName() {
-        return fileName;
-    }
-
-    public void setFileName(String fileName) {
-        this.fileName = fileName;
-    }
-
-    public String getFileSize() {
-        return fileSize;
-    }
-
-    public void setFileSize(String fileSize) {
-        this.fileSize = fileSize;
-    }
-
-    public String getFileType() {
-        return fileType;
-    }
-
-    public void setFileType(String fileType) {
-        this.fileType = fileType;
-    }
-
-    public LocalDateTime getUploadIndate() {
-        return uploadIndate;
-    }
-
-    public void setUploadIndate(LocalDateTime uploadIndate) {
-        this.uploadIndate = uploadIndate;
-    }
-
     @Override
     protected Serializable pkVal() {
         return this.id;
     }
 
-    @Override
-    public String toString() {
-        return "BannerPictures{" +
-        "id=" + id +
-        ", url=" + url +
-        ", fileName=" + fileName +
-        ", fileSize=" + fileSize +
-        ", fileType=" + fileType +
-        ", uploadIndate=" + uploadIndate +
-        "}";
-    }
 }

+ 7 - 51
website/src/main/java/com/hssx/website/entity/Comment.java

@@ -6,6 +6,9 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import java.time.LocalDateTime;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
 
 /**
  * <p>
@@ -13,8 +16,11 @@ import java.io.Serializable;
  * </p>
  *
  * @author 吴涛涛
- * @since 2019-10-24
+ * @since 2020-02-05
  */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
 public class Comment extends Model<Comment> {
 
     private static final long serialVersionUID=1L;
@@ -50,59 +56,9 @@ public class Comment extends Model<Comment> {
     private LocalDateTime indate;
 
 
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getPhone() {
-        return phone;
-    }
-
-    public void setPhone(String phone) {
-        this.phone = phone;
-    }
-
-    public String getComment() {
-        return comment;
-    }
-
-    public void setComment(String comment) {
-        this.comment = comment;
-    }
-
-    public LocalDateTime getIndate() {
-        return indate;
-    }
-
-    public void setIndate(LocalDateTime indate) {
-        this.indate = indate;
-    }
-
     @Override
     protected Serializable pkVal() {
         return this.id;
     }
 
-    @Override
-    public String toString() {
-        return "Comment{" +
-        "id=" + id +
-        ", name=" + name +
-        ", phone=" + phone +
-        ", comment=" + comment +
-        ", indate=" + indate +
-        "}";
-    }
 }

+ 1 - 7
website/src/main/java/com/hssx/website/entity/CompanyProducts.java

@@ -15,7 +15,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author 吴涛涛
- * @since 2020-02-04
+ * @since 2020-02-05
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -48,12 +48,6 @@ public class CompanyProducts extends Model<CompanyProducts> {
     @TableField("introduction")
     private String introduction;
 
-    /**
-     * 地址
-     */
-    @TableField("address")
-    private String address;
-
     /**
      * 是否显示在首页 0不显示 1显示
      */

+ 8 - 61
website/src/main/java/com/hssx/website/entity/Cooperations.java

@@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
 
 /**
  * <p>
@@ -12,8 +15,11 @@ import java.io.Serializable;
  * </p>
  *
  * @author 吴涛涛
- * @since 2019-10-24
+ * @since 2020-02-05
  */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
 public class Cooperations extends Model<Cooperations> {
 
     private static final long serialVersionUID=1L;
@@ -40,7 +46,7 @@ public class Cooperations extends Model<Cooperations> {
     private String imageUrl;
 
     /**
-     * 合作者种类 0-研发机构类、1-材料供应商、2-设备合作商、3-系统授权商、4-孵化中心、5-平台合作单位
+     * 合作者种类 0-联合开发 1-材料供应商 2-芯片及PCB版合作伙伴 3-软件合作伙伴 4-投融资服务机构
      */
     @TableField("type")
     private Integer type;
@@ -52,68 +58,9 @@ public class Cooperations extends Model<Cooperations> {
     private Integer sticky;
 
 
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public String getImageUrl() {
-        return imageUrl;
-    }
-
-    public void setImageUrl(String imageUrl) {
-        this.imageUrl = imageUrl;
-    }
-
-    public Integer getType() {
-        return type;
-    }
-
-    public void setType(Integer type) {
-        this.type = type;
-    }
-
-    public Integer getSticky() {
-        return sticky;
-    }
-
-    public void setSticky(Integer sticky) {
-        this.sticky = sticky;
-    }
-
     @Override
     protected Serializable pkVal() {
         return this.id;
     }
 
-    @Override
-    public String toString() {
-        return "Cooperations{" +
-        "id=" + id +
-        ", name=" + name +
-        ", description=" + description +
-        ", imageUrl=" + imageUrl +
-        ", type=" + type +
-        ", sticky=" + sticky +
-        "}";
-    }
 }

+ 1 - 1
website/src/main/java/com/hssx/website/entity/OnlineApplication.java

@@ -16,7 +16,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author 吴涛涛
- * @since 2019-11-21
+ * @since 2020-02-05
  */
 @Data
 @EqualsAndHashCode(callSuper = false)

+ 7 - 33
website/src/main/java/com/hssx/website/entity/User.java

@@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
 
 /**
  * <p>
@@ -12,8 +15,11 @@ import java.io.Serializable;
  * </p>
  *
  * @author 吴涛涛
- * @since 2019-10-24
+ * @since 2020-02-05
  */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
 public class User extends Model<User> {
 
     private static final long serialVersionUID=1L;
@@ -37,41 +43,9 @@ public class User extends Model<User> {
     private String password;
 
 
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public String getUsername() {
-        return username;
-    }
-
-    public void setUsername(String username) {
-        this.username = username;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
-
     @Override
     protected Serializable pkVal() {
         return this.id;
     }
 
-    @Override
-    public String toString() {
-        return "User{" +
-        "id=" + id +
-        ", username=" + username +
-        ", password=" + password +
-        "}";
-    }
 }

+ 69 - 0
website/src/main/java/com/hssx/website/entity/VipProducts.java

@@ -0,0 +1,69 @@
+package com.hssx.website.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 第一个数据是公司优势 其他是案例
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2020-02-05
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class VipProducts extends Model<VipProducts> {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * id
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 产品名称
+     */
+    @TableField("title")
+    private String title;
+
+    /**
+     * 产品图片地址
+     */
+    @TableField("image_url")
+    private String imageUrl;
+
+    /**
+     * 简介
+     */
+    @TableField("introduction")
+    private String introduction;
+
+    /**
+     * 地址
+     */
+    @TableField("address")
+    private String address;
+
+    /**
+     * 置顶 0-否 1-是
+     */
+    @TableField("sticky")
+    private Integer sticky;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 16 - 0
website/src/main/java/com/hssx/website/mapper/VipProductsMapper.java

@@ -0,0 +1,16 @@
+package com.hssx.website.mapper;
+
+import com.hssx.website.entity.VipProducts;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 第一个数据是公司优势 其他是案例 Mapper 接口
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2020-02-05
+ */
+public interface VipProductsMapper extends BaseMapper<VipProducts> {
+
+}

+ 6 - 1
website/src/main/java/com/hssx/website/service/UserService.java

@@ -1,7 +1,7 @@
 package com.hssx.website.service;
 
-import com.hssx.website.entity.User;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.hssx.website.entity.User;
 import org.springframework.ui.Model;
 
 /**
@@ -14,7 +14,12 @@ import org.springframework.ui.Model;
  */
 public interface UserService extends IService<User> {
     Model getAdvantage(Model model);
+
     Model getCooperation(Model model);
+
     Model getCase(Model model);
+
     Model getDetail(Model model, Integer id);
+
+    Model getVip(Model model);
 }

+ 16 - 0
website/src/main/java/com/hssx/website/service/VipProductsService.java

@@ -0,0 +1,16 @@
+package com.hssx.website.service;
+
+import com.hssx.website.entity.VipProducts;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 第一个数据是公司优势 其他是案例 服务类
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2020-02-05
+ */
+public interface VipProductsService extends IService<VipProducts> {
+
+}

+ 0 - 1
website/src/main/java/com/hssx/website/service/impl/ArticleServiceImpl.java

@@ -51,7 +51,6 @@ public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> impl
 
     @Override
     public Model getGoodsList(Model model) {
-        /*这里应该把产品类型分类返回了*/
         model.addAttribute("companyProducts", companyProductsMapper.selectList(new QueryWrapper<CompanyProducts>().orderByDesc("id")));
         return model;
     }

+ 10 - 7
website/src/main/java/com/hssx/website/service/impl/UserServiceImpl.java

@@ -1,13 +1,11 @@
 package com.hssx.website.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.hssx.website.entity.Article;
-import com.hssx.website.entity.Cooperations;
-import com.hssx.website.entity.User;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hssx.website.entity.*;
 import com.hssx.website.entity.vo.CooperationsVO;
 import com.hssx.website.mapper.*;
 import com.hssx.website.service.UserService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.ui.Model;
@@ -31,9 +29,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
     @Resource
     private CooperationsMapper cooperationsMapper;
     @Resource
-    private BannerPicturesMapper bannerPicturesMapper;
-    @Resource
-    private CommentMapper commentMapper;
+    private VipProductsMapper vipProductsMapper;
 
     @Override
     public Model getAdvantage(Model model) {
@@ -99,4 +95,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         model.addAttribute("detail", articleMapper.selectById(id));
         return model;
     }
+
+    @Override
+    public Model getVip(Model model) {
+        model.addAttribute("vipProducts", vipProductsMapper.selectList(
+                new QueryWrapper<VipProducts>().orderByDesc("id")));
+        return model;
+    }
 }

+ 20 - 0
website/src/main/java/com/hssx/website/service/impl/VipProductsServiceImpl.java

@@ -0,0 +1,20 @@
+package com.hssx.website.service.impl;
+
+import com.hssx.website.entity.VipProducts;
+import com.hssx.website.mapper.VipProductsMapper;
+import com.hssx.website.service.VipProductsService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 第一个数据是公司优势 其他是案例 服务实现类
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2020-02-05
+ */
+@Service
+public class VipProductsServiceImpl extends ServiceImpl<VipProductsMapper, VipProducts> implements VipProductsService {
+
+}

+ 1 - 1
website/src/main/java/com/hssx/website/until/CodeGenerator.java

@@ -206,7 +206,7 @@ public class CodeGenerator {
         //此处user是表名,多个英文逗号分割
 //        strategy.setInclude("mould_down_packet");
 //        strategy.setExclude();//数据库表全生成
-        strategy.setInclude("company_products");//表名,多个英文逗号分割
+//        strategy.setInclude("company_products");//表名,多个英文逗号分割
         strategy.setControllerMappingHyphenStyle(true);
         //数据库表前缀,不配置这行的话,生成的类会带有T如:TUser,配置后即可将前缀去掉
 //        strategy.setTablePrefix("tb_");

+ 1 - 2
website/src/main/resources/mapper/CompanyProductsMapper.xml

@@ -8,14 +8,13 @@
         <result column="title" property="title" />
         <result column="image_url" property="imageUrl" />
         <result column="introduction" property="introduction" />
-        <result column="address" property="address" />
         <result column="sticky" property="sticky" />
         <result column="type" property="type" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, title, image_url, introduction, address, sticky, type
+        id, title, image_url, introduction, sticky, type
     </sql>
 
 </mapper>

+ 20 - 0
website/src/main/resources/mapper/VipProductsMapper.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.hssx.website.mapper.VipProductsMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.hssx.website.entity.VipProducts">
+        <id column="id" property="id" />
+        <result column="title" property="title" />
+        <result column="image_url" property="imageUrl" />
+        <result column="introduction" property="introduction" />
+        <result column="address" property="address" />
+        <result column="sticky" property="sticky" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, title, image_url, introduction, address, sticky
+    </sql>
+
+</mapper>