소스 검색

完善实体类以及pom文件

Shi Kejing 4 년 전
부모
커밋
325fc04348

+ 34 - 0
guns-main/pom.xml

@ -4,6 +4,12 @@
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <properties>
        <version.fastdfs>1.25</version.fastdfs>
        <version.fastdfs>1.2.17</version.fastdfs>
    </properties>
    <parent>
        <groupId>cn.stylefeng</groupId>
        <artifactId>guns-separation</artifactId>
@ -39,6 +45,34 @@
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
  <!--  解决 Illegal DefaultValue null for parameter type integer    异常  -->
         <dependency>
             <groupId>io.swagger</groupId>
             <artifactId>swagger-annotations</artifactId>
             <version>1.5.21</version>
         </dependency>
         <dependency>
             <groupId>io.swagger</groupId>
             <artifactId>swagger-models</artifactId>
             <version>1.5.21</version>
         </dependency>
        <!--fastdfs start-->
        <dependency>
            <groupId>org.csource</groupId>
            <artifactId>fastdfs_lib</artifactId>
        </dependency>
        <!--fastdfs end-->
        <!--fastdfs start-->
        <dependency>
            <groupId>org.csource</groupId>
            <artifactId>fastdfs_lib</artifactId>
            <version>${version.fastdfs}</version>
        </dependency>
        <!--fastdfs end-->
    </dependencies>
    <build>

+ 108 - 15
guns-main/src/main/java/cn/stylefeng/guns/zjxl/cnotroller/ZjxlBannerCnotroller.java

@ -1,18 +1,30 @@
package cn.stylefeng.guns.zjxl.cnotroller;
import cn.stylefeng.guns.zjxl.model.UploadModel;
import cn.stylefeng.guns.zjxl.model.ZjxlBanner;
import cn.stylefeng.guns.zjxl.model.ZjxlCompanyCase;
import cn.stylefeng.guns.zjxl.model.ret.BannerCompanyCaseRet;
import cn.stylefeng.guns.zjxl.model.ret.BaseResultModel;
import cn.stylefeng.guns.zjxl.model.ret.ResultOneModel;
import cn.stylefeng.guns.zjxl.service.ZjxlBannerService;
import cn.stylefeng.guns.zjxl.service.ZjxlCompanyCaseService;
import cn.stylefeng.guns.zjxlUtil.BaseController;
import cn.stylefeng.guns.zjxlUtil.FastDFSUtil;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.node.ObjectNode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.ini4j.spi.RegEscapeTool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.List;
import java.util.Optional;
@ -24,20 +36,25 @@ import java.util.Optional;
 */
@RestController
@Api(description = "公司官网主页")
@RequestMapping(value = "/zjxl")
@RequestMapping(value = "/zjxl/banner")
public class ZjxlBannerCnotroller extends BaseController {
    @Autowired
    private ZjxlBannerService bannerService;
    @Autowired
    private ZjxlCompanyCaseService companyCaseService;
//    @Autowired
//    FastDFSUtil fastDFSUtil;
//    @Value("${fastDFS.fastdfs_file_url}")
//    private String fastdfs_file_url;
    @RequestMapping(value = "/findBannerById", method = RequestMethod.GET)
    @ApiOperation(value = "根据Id查看banner")
    public String findBannerById(String id){
    @ApiOperation(value = "查看banner列表")
    public String findBannerById(@ApiParam(name = "id", value = "bannerId", required = false) @RequestParam(value = "id", required = false)String id,
                                 @ApiParam(name = "name", value = "bannerName", required = false) @RequestParam(value = "name", required = false)String name,
                                 @ApiParam(name = "page", value = "第几页", defaultValue = "0") @RequestParam(value = "page", required = false) Integer page,
                                 @ApiParam(name = "pagesize", value = "分页大小", defaultValue = "10") @RequestParam(value = "pagesize", required = false) Integer pagesize){
        try {
            ZjxlBanner banner = bannerService.findById(id);
            List<ZjxlBanner> banner = bannerService.findById(id,name,page,pagesize);
            return write(200,"查询成功","data",banner);
        }catch (Exception e){
            e.printStackTrace();
@ -45,20 +62,96 @@ public class ZjxlBannerCnotroller extends BaseController {
        }
    }
    @RequestMapping(value = "/findCompanyCaseById", method = RequestMethod.GET)
    @ApiOperation(value = "根据Id查看CompanyCase")
    public String findCompanyCaseById(String id){
    @RequestMapping(value = "/addBanner", method = RequestMethod.POST)
    @ApiOperation(value = "添加banner")
    public String addBanner(@ApiParam(name = "bannerName", value = "bannerName", required = false) @RequestParam(value = "bannerName", required = false)String bannerName,
                            @ApiParam(name = "bannerImage", value = "图片", required = false) @RequestParam(value = "bannerImage", required = false)String bannerImage,
                            @ApiParam(name = "bannerType", value = "跳转方式", required = false) @RequestParam(value = "bannerType", required = false)Integer bannerType,
                            @ApiParam(name = "bannerTypeUrl", value = "跳转链接", required = false) @RequestParam(value = "bannerTypeUrl", required = false)String bannerTypeUrl,
                            @ApiParam(name = "bannerSort", value = "排序", required = false) @RequestParam(value = "bannerSort", required = false)Integer bannerSort,
                            @ApiParam(name = "bannerIsLine", value = "是否上线", required = false) @RequestParam(value = "bannerIsLine", required = false)Integer bannerIsLine){
        ZjxlBanner banner = new ZjxlBanner();
        banner.setBannerImage(bannerImage);//String
        banner.setBannerIsLine(bannerIsLine);//integer
        banner.setBannerName(bannerName);//string
        banner.setBannerSort(bannerSort);
        banner.setBannerType(bannerType);
        banner.setBannerTypeUrl(bannerTypeUrl);
        try {
            return write(200,"添加成功","data",bannerService.addBanner(banner));
        }catch (Exception e){
            return write(-1,"添加失败");
        }
    }
    @RequestMapping(value = "/deleteBannerById", method = RequestMethod.DELETE)
    @ApiOperation(value = "删除banner")
    public String deleteBannerById(String id){
        try {
            return write(200,"查询成功","data",companyCaseService.findById(id));
            return write(200,"删除成功","data",bannerService.deleteBannerById(id));
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"查询失败");
            return write(-1,"删除失败");
        }
    }
    @RequestMapping(value = "/finfBannerCompanyCaseById", method = RequestMethod.GET)
    @ApiOperation(value = "两表查询,把结果放一个实体类返回(测试)")
    public List<BannerCompanyCaseRet> finfBannerCompanyCaseById(String id){
       return bannerService.finfBannerCompanyCaseById(id);
    @RequestMapping(value = "/updateIsLine", method = RequestMethod.POST)
    @ApiOperation(value = "修改是否上线")
    public String updateIsLine(String id,Integer isLine){
        try {
            return write(200,"修改成功","data",bannerService.updateIsLine(id,isLine));
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"修改失败");
        }
    }
//    /**
//     * 聊天附件上传
//     *
//     * @return
//     * @throws IOException
//     * @throws IllegalStateException
//     */
//    @RequestMapping(value = "/file", method = RequestMethod.POST)
//    @ApiOperation(value = "单文件上传")
//    public ResultOneModel<UploadModel> uploadFile(
//            @ApiParam(value = "文件", required = true) @RequestParam(value = "file", required = true) MultipartFile file
//    ) {
//        try {
//            UploadModel uploadModel = fileUpload(file);
//            return new ResultOneModel<UploadModel>(uploadModel);
//        } catch (Exception e) {
//            return new ResultOneModel(BaseResultModel.statusEm.file_upload_error.getCode(), BaseResultModel.statusEm.file_upload_error.getMessage() + "," + e.getMessage(), new JSONObject());
//        }
//    }
//
//    @RequestMapping(value = "/finfBannerCompanyCaseById", method = RequestMethod.GET)
//    @ApiOperation(value = "两表查询,把结果放一个实体类返回(测试)")
//    public List<BannerCompanyCaseRet> finfBannerCompanyCaseById(String id){
//       return bannerService.finfBannerCompanyCaseById(id);
//    }
//
//    /**
//     * 文件上传到fastDfs
//     *
//     * @param mf
//     * @return
//     */
//    private UploadModel fileUpload(MultipartFile mf) throws Exception {
//        UploadModel uploadModel = new UploadModel();
//        // 得到文件的完整名称  xxx.txt
//        String fullName = mf.getOriginalFilename();
//        //得到文件类型
//        String fileType = fullName.substring(fullName.lastIndexOf(".") + 1).toLowerCase();
//        String fileName = fullName.substring(0, fullName.lastIndexOf("."));
//        //上传到fastdfs
//        ObjectNode objectNode = fastDFSUtil.upload(mf.getInputStream(), fileType, "");
//        //解析返回的objectNode
//        uploadModel.setFileName(fileName);
//        uploadModel.setFileType(fileType);
//        uploadModel.setFullUri(objectNode.get("fid").toString().replaceAll("\"", ""));
//        uploadModel.setFullUrl(fastdfs_file_url + objectNode.get("fid").toString().replaceAll("\"", ""));
//        return uploadModel;
//    }
}

+ 24 - 1
guns-main/src/main/java/cn/stylefeng/guns/zjxl/cnotroller/ZjxlCompanyCaseController.java

@ -1,5 +1,12 @@
package cn.stylefeng.guns.zjxl.cnotroller;
import cn.stylefeng.guns.zjxl.service.ZjxlCompanyCaseService;
import cn.stylefeng.guns.zjxlUtil.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/***
@ -9,5 +16,21 @@ import org.springframework.web.bind.annotation.RestController;
 * @Date: 2020/11/2 9:21
 */
@RestController
public class ZjxlCompanyCaseController {
@Api(description = "公司官网主页")
@RequestMapping(value = "/zjxl/CompanyCase")
public class ZjxlCompanyCaseController extends BaseController {
    @Autowired
    private ZjxlCompanyCaseService companyCaseService;
    @RequestMapping(value = "/findCompanyCaseById", method = RequestMethod.GET)
    @ApiOperation(value = "根据Id查看CompanyCase")
    public String findCompanyCaseById(String id){
        try {
            return write(200,"查询成功","data",companyCaseService.findById(id));
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"查询失败");
        }
    }
}

+ 10 - 1
guns-main/src/main/java/cn/stylefeng/guns/zjxl/dao/ZjxlBannerDao.java

@ -2,6 +2,7 @@ package cn.stylefeng.guns.zjxl.dao;
import cn.stylefeng.guns.zjxl.model.ZjxlBanner;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
@ -13,6 +14,14 @@ import org.springframework.data.repository.PagingAndSortingRepository;
 */
public interface ZjxlBannerDao extends PagingAndSortingRepository<ZjxlBanner, Long>, JpaSpecificationExecutor<ZjxlBanner> {
    @Query("select p from ZjxlBanner p where p.id = ?1")
    @Query("select p from ZjxlBanner p where p.bannerId = ?1")
    ZjxlBanner findById(String id);
    @Modifying
    @Query("delete from ZjxlBanner p where p.bannerId = ?1")
    int deleteById(String id);
    @Modifying
    @Query("update ZjxlBanner a set a.bannerIsLine = ?2 where a.bannerId = ?1")
    int updateIsLine(String id, Integer isLine);
}

+ 1 - 2
guns-main/src/main/java/cn/stylefeng/guns/zjxl/dao/ZjxlCompanyCaseDao.java

@ -1,6 +1,5 @@
package cn.stylefeng.guns.zjxl.dao;
import cn.stylefeng.guns.zjxl.model.ZjxlBanner;
import cn.stylefeng.guns.zjxl.model.ZjxlCompanyCase;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
@ -14,6 +13,6 @@ import org.springframework.data.repository.PagingAndSortingRepository;
 */
public interface ZjxlCompanyCaseDao extends PagingAndSortingRepository<ZjxlCompanyCase, Long>, JpaSpecificationExecutor<ZjxlCompanyCase> {
    @Query("select a from ZjxlCompanyCase a where a.id = ?1")
    @Query("select a from ZjxlCompanyCase a where a.companyId = ?1")
    ZjxlCompanyCase findById(String id);
}

+ 53 - 0
guns-main/src/main/java/cn/stylefeng/guns/zjxl/model/UploadModel.java

@ -0,0 +1,53 @@
package cn.stylefeng.guns.zjxl.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 * Created by chenweida on 2017/8/29.
 */
@ApiModel(description = "文件上传实体")
public class UploadModel {
    @ApiModelProperty(value = "文件名字", required = true, access = "response")
    private String fileName; //xxx
    @ApiModelProperty(value = "文件类型", required = true, access = "response")
    private String fileType; //txt
    @ApiModelProperty(value = "完整的url", required = true, access = "response")
    private String fullUrl; //http://172.19.103.13/healthArchiveGroup/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg
    @ApiModelProperty(value = "完整的uri", required = true, access = "response")
    private String fullUri; //healthArchiveGroup/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg
    public String getFullUrl() {
        return fullUrl;
    }
    public void setFullUrl(String fullUrl) {
        this.fullUrl = fullUrl;
    }
    public String getFullUri() {
        return fullUri;
    }
    public void setFullUri(String fullUri) {
        this.fullUri = fullUri;
    }
    public String getFileName() {
        return fileName;
    }
    public void setFileName(String fileName) {
        this.fileName = fileName;
    }
    public String getFileType() {
        return fileType;
    }
    public void setFileType(String fileType) {
        this.fileType = fileType;
    }
}

+ 35 - 49
guns-main/src/main/java/cn/stylefeng/guns/zjxl/model/ZjxlBanner.java

@ -16,88 +16,74 @@ import javax.persistence.Table;
@Table(name = "zjxl_banner")
public class ZjxlBanner {
    private String id;
    private String bannerId;
    private String name;
    private String bannerName;
    private String image;
    private String bannerImage;
    private Integer type;
    private Integer bannerType;
    private String typeUrl;
    private String bannerTypeUrl;
    private Integer sort;
    private Integer bannerSort;
    private Integer isLine;
    public ZjxlBanner(String id, String name, String image, Integer type, String typeUrl, Integer sort, Integer isLine) {
        this.id = id;
        this.name = name;
        this.image = image;
        this.type = type;
        this.typeUrl = typeUrl;
        this.sort = sort;
        this.isLine = isLine;
    }
    public ZjxlBanner() {
        super();
    }
    private Integer bannerIsLine;
    @Id
    public String getId() {
        return id;
    public String getBannerId() {
        return bannerId;
    }
    public void setId(String id) {
        this.id = id;
    public void setBannerId(String bannerId) {
        this.bannerId = bannerId;
    }
    public String getName() {
        return name;
    public String getBannerName() {
        return bannerName;
    }
    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    public void setBannerName(String bannerName) {
        this.bannerName = bannerName;
    }
    public String getImage() {
        return image;
    public String getBannerImage() {
        return bannerImage;
    }
    public void setImage(String image) {
        this.image = image == null ? null : image.trim();
    public void setBannerImage(String bannerImage) {
        this.bannerImage = bannerImage;
    }
    public Integer getType() {
        return type;
    public Integer getBannerType() {
        return bannerType;
    }
    public void setType(Integer type) {
        this.type = type;
    public void setBannerType(Integer bannerType) {
        this.bannerType = bannerType;
    }
    public String getTypeUrl() {
        return typeUrl;
    public String getBannerTypeUrl() {
        return bannerTypeUrl;
    }
    public void setTypeUrl(String typeUrl) {
        this.typeUrl = typeUrl == null ? null : typeUrl.trim();
    public void setBannerTypeUrl(String bannerTypeUrl) {
        this.bannerTypeUrl = bannerTypeUrl;
    }
    public Integer getSort() {
        return sort;
    public Integer getBannerSort() {
        return bannerSort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    public void setBannerSort(Integer bannerSort) {
        this.bannerSort = bannerSort;
    }
    public Integer getIsLine() {
        return isLine;
    public Integer getBannerIsLine() {
        return bannerIsLine;
    }
    public void setIsLine(Integer isLine) {
        this.isLine = isLine;
    public void setBannerIsLine(Integer bannerIsLine) {
        this.bannerIsLine = bannerIsLine;
    }
}

+ 50 - 50
guns-main/src/main/java/cn/stylefeng/guns/zjxl/model/ZjxlCompanyCase.java

@ -13,104 +13,104 @@ import javax.persistence.Table;
@Entity
@Table(name = "zjxl_company_case")
public class ZjxlCompanyCase {
    private String id;
    private String companyId;
    private String name;
    private String companyName;
    private String describe;
    private String companyDescribe;
    private String defaultImg;
    private String companyDefaultImg;
    private String exchangeImg;
    private String companyExchangeImg;
    private String associatedCase;
    private String companyAssociatedCase;
    private String jumpUrl;
    private String companyJumpUrl;
    private int sort;
    private int companySort;
    private int isLine;
    private int companyIsLine;
    private int testBannerId;
    private int companyTestBannerId;
    @Id
    public String getId() {
        return id;
    public String getCompanyId() {
        return companyId;
    }
    public void setId(String id) {
        this.id = id;
    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }
    public String getName() {
        return name;
    public String getCompanyName() {
        return companyName;
    }
    public void setName(String name) {
        this.name = name;
    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }
    public String getDescribe() {
        return describe;
    public String getCompanyDescribe() {
        return companyDescribe;
    }
    public void setDescribe(String describe) {
        this.describe = describe;
    public void setCompanyDescribe(String companyDescribe) {
        this.companyDescribe = companyDescribe;
    }
    public String getDefaultImg() {
        return defaultImg;
    public String getCompanyDefaultImg() {
        return companyDefaultImg;
    }
    public void setDefaultImg(String defaultImg) {
        this.defaultImg = defaultImg;
    public void setCompanyDefaultImg(String companyDefaultImg) {
        this.companyDefaultImg = companyDefaultImg;
    }
    public String getExchangeImg() {
        return exchangeImg;
    public String getCompanyExchangeImg() {
        return companyExchangeImg;
    }
    public void setExchangeImg(String exchangeImg) {
        this.exchangeImg = exchangeImg;
    public void setCompanyExchangeImg(String companyExchangeImg) {
        this.companyExchangeImg = companyExchangeImg;
    }
    public String getAssociatedCase() {
        return associatedCase;
    public String getCompanyAssociatedCase() {
        return companyAssociatedCase;
    }
    public void setAssociatedCase(String associatedCase) {
        this.associatedCase = associatedCase;
    public void setCompanyAssociatedCase(String companyAssociatedCase) {
        this.companyAssociatedCase = companyAssociatedCase;
    }
    public String getJumpUrl() {
        return jumpUrl;
    public String getCompanyJumpUrl() {
        return companyJumpUrl;
    }
    public void setJumpUrl(String jumpUrl) {
        this.jumpUrl = jumpUrl;
    public void setCompanyJumpUrl(String companyJumpUrl) {
        this.companyJumpUrl = companyJumpUrl;
    }
    public int getSort() {
        return sort;
    public int getCompanySort() {
        return companySort;
    }
    public void setSort(int sort) {
        this.sort = sort;
    public void setCompanySort(int companySort) {
        this.companySort = companySort;
    }
    public int getIsLine() {
        return isLine;
    public int getCompanyIsLine() {
        return companyIsLine;
    }
    public void setIsLine(int isLine) {
        this.isLine = isLine;
    public void setCompanyIsLine(int companyIsLine) {
        this.companyIsLine = companyIsLine;
    }
    public int getTestBannerId() {
        return testBannerId;
    public int getCompanyTestBannerId() {
        return companyTestBannerId;
    }
    public void setTestBannerId(int testBannerId) {
        this.testBannerId = testBannerId;
    public void setCompanyTestBannerId(int companyTestBannerId) {
        this.companyTestBannerId = companyTestBannerId;
    }
}

+ 105 - 65
guns-main/src/main/java/cn/stylefeng/guns/zjxl/model/ret/BannerCompanyCaseRet.java

@ -8,133 +8,173 @@ package cn.stylefeng.guns.zjxl.model.ret;
 */
//查询多张表返回数据,需要考虑返回结果是否有重复参数
public class BannerCompanyCaseRet {
    private String id;
    private String bannerId;
    private String name;
    private String bannerName;
    private String describe;
    private String bannerImage;
    private String defaultImg;
    private Integer bannerType;
    private String exchangeImg;
    private String bannerTypeUrl;
    private String associatedCase;
    private Integer bannerSort;
    private String jumpUrl;
    private Integer bannerIsLine;
    private int sort;
    private String companyId;
    private int isLine;
    private String companyName;
    private int testBannerId;
    private String companyDescribe;
    private String image;
    private String companyDefaultImg;
    private Integer type;
    private String companyExchangeImg;
    private String typeUrl;
    private String companyAssociatedCase;
    public String getId() {
        return id;
    private String companyJumpUrl;
    private int companySort;
    private int companyIsLine;
    private int companyTestBannerId;
    public String getBannerId() {
        return bannerId;
    }
    public void setBannerId(String bannerId) {
        this.bannerId = bannerId;
    }
    public String getBannerName() {
        return bannerName;
    }
    public void setBannerName(String bannerName) {
        this.bannerName = bannerName;
    }
    public String getBannerImage() {
        return bannerImage;
    }
    public void setBannerImage(String bannerImage) {
        this.bannerImage = bannerImage;
    }
    public Integer getBannerType() {
        return bannerType;
    }
    public void setBannerType(Integer bannerType) {
        this.bannerType = bannerType;
    }
    public String getBannerTypeUrl() {
        return bannerTypeUrl;
    }
    public void setId(String id) {
        this.id = id;
    public void setBannerTypeUrl(String bannerTypeUrl) {
        this.bannerTypeUrl = bannerTypeUrl;
    }
    public String getName() {
        return name;
    public Integer getBannerSort() {
        return bannerSort;
    }
    public void setName(String name) {
        this.name = name;
    public void setBannerSort(Integer bannerSort) {
        this.bannerSort = bannerSort;
    }
    public String getDescribe() {
        return describe;
    public Integer getBannerIsLine() {
        return bannerIsLine;
    }
    public void setDescribe(String describe) {
        this.describe = describe;
    public void setBannerIsLine(Integer bannerIsLine) {
        this.bannerIsLine = bannerIsLine;
    }
    public String getDefaultImg() {
        return defaultImg;
    public String getCompanyId() {
        return companyId;
    }
    public void setDefaultImg(String defaultImg) {
        this.defaultImg = defaultImg;
    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }
    public String getExchangeImg() {
        return exchangeImg;
    public String getCompanyName() {
        return companyName;
    }
    public void setExchangeImg(String exchangeImg) {
        this.exchangeImg = exchangeImg;
    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }
    public String getAssociatedCase() {
        return associatedCase;
    public String getCompanyDescribe() {
        return companyDescribe;
    }
    public void setAssociatedCase(String associatedCase) {
        this.associatedCase = associatedCase;
    public void setCompanyDescribe(String companyDescribe) {
        this.companyDescribe = companyDescribe;
    }
    public String getJumpUrl() {
        return jumpUrl;
    public String getCompanyDefaultImg() {
        return companyDefaultImg;
    }
    public void setJumpUrl(String jumpUrl) {
        this.jumpUrl = jumpUrl;
    public void setCompanyDefaultImg(String companyDefaultImg) {
        this.companyDefaultImg = companyDefaultImg;
    }
    public int getSort() {
        return sort;
    public String getCompanyExchangeImg() {
        return companyExchangeImg;
    }
    public void setSort(int sort) {
        this.sort = sort;
    public void setCompanyExchangeImg(String companyExchangeImg) {
        this.companyExchangeImg = companyExchangeImg;
    }
    public int getIsLine() {
        return isLine;
    public String getCompanyAssociatedCase() {
        return companyAssociatedCase;
    }
    public void setIsLine(int isLine) {
        this.isLine = isLine;
    public void setCompanyAssociatedCase(String companyAssociatedCase) {
        this.companyAssociatedCase = companyAssociatedCase;
    }
    public int getTestBannerId() {
        return testBannerId;
    public String getCompanyJumpUrl() {
        return companyJumpUrl;
    }
    public void setTestBannerId(int testBannerId) {
        this.testBannerId = testBannerId;
    public void setCompanyJumpUrl(String companyJumpUrl) {
        this.companyJumpUrl = companyJumpUrl;
    }
    public String getImage() {
        return image;
    public int getCompanySort() {
        return companySort;
    }
    public void setImage(String image) {
        this.image = image;
    public void setCompanySort(int companySort) {
        this.companySort = companySort;
    }
    public Integer getType() {
        return type;
    public int getCompanyIsLine() {
        return companyIsLine;
    }
    public void setType(Integer type) {
        this.type = type;
    public void setCompanyIsLine(int companyIsLine) {
        this.companyIsLine = companyIsLine;
    }
    public String getTypeUrl() {
        return typeUrl;
    public int getCompanyTestBannerId() {
        return companyTestBannerId;
    }
    public void setTypeUrl(String typeUrl) {
        this.typeUrl = typeUrl;
    public void setCompanyTestBannerId(int companyTestBannerId) {
        this.companyTestBannerId = companyTestBannerId;
    }
}

+ 96 - 0
guns-main/src/main/java/cn/stylefeng/guns/zjxl/model/ret/BaseResultModel.java

@ -0,0 +1,96 @@
package cn.stylefeng.guns.zjxl.model.ret;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 * Created by chenweida on 2017/8/17.
 */
@ApiModel("返回实体")
public class BaseResultModel {
    @ApiModelProperty(value = "状态", required = false, access = "response")
    protected Integer status = statusEm.success.getCode();
    @ApiModelProperty(value = "信息", required = false, access = "response")
    protected String message = "成功";
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }
    public enum statusEm {
        success(10000, "请求成功"),//请求成功
        error_Appid(-9000, "appid不存在"),//appid不存在
        error_AppSecret(-9001, "AppSecret不存在"),//AppSecret不存在
        token_out_effect(-9002, "无效的token"),//token无效
        token_no_power(-9003, "用户没权限"),// 没权限 包括未授权 或者uri错误
        token_out_time(-9004, "accesstoken已过期"),//token无效
        token_null(-9005, "accesstoken为空"),// 没权限 包括未授权 或者uri错误
        error_params(-10000, "请求失败 参数错误"),//请求失败 参数错误
        error_no_ip(-10010, "请求失败,获取IP失败"),//请求失败,获取IP失败
        login_system_error(-10020, "系统异常"),
        login_publickey_error(-10030, "获取公钥失败"),
        file_upload_error(-10040, "文件上传失败"),
        find_error(-10050, "查询失败"),
        opera_error(-10060, "操作失败"),
        login_account_error(-20010, "账号不存在"),
        login_password_error(-20020, "密码错误"),
        login_IMEI_error(-20030, "获取imei失败");
        ;
        statusEm(Integer code, String message) {
            this.code = code;
            this.message = message;
        }
        private Integer code;
        private String message;
        public Integer getCode() {
            return code;
        }
        public void setCode(Integer code) {
            this.code = code;
        }
        public String getMessage() {
            return message;
        }
        public void setMessage(String message) {
            this.message = message;
        }
    }
    public BaseResultModel() {
    }
    public BaseResultModel(String message) {
        this.message = message;
    }
    public BaseResultModel(Integer status, String message) {
        this.status = status;
        this.message = message;
    }
}

+ 39 - 0
guns-main/src/main/java/cn/stylefeng/guns/zjxl/model/ret/ResultOneModel.java

@ -0,0 +1,39 @@
package cn.stylefeng.guns.zjxl.model.ret;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 * Created by chenweida on 2017/8/17.
 * 对外放回的实体
 */
@ApiModel("返回的实体类")
public class ResultOneModel<T> extends BaseResultModel {
    @ApiModelProperty(value = "返回数据", required = false, access = "response")
    private T result;
    public T getResult() {
        return result;
    }
    public void setResult(T result) {
        this.result = result;
    }
    public ResultOneModel(T result) {
        this.result = result;
    }
    public ResultOneModel() {
    }
    public ResultOneModel(Integer code, String message) {
        super(code, message);
    }
    public ResultOneModel(Integer status, String message, T result) {
        super(status, message);
        this.result = result;
    }
}

+ 31 - 4
guns-main/src/main/java/cn/stylefeng/guns/zjxl/service/ZjxlBannerService.java

@ -3,8 +3,12 @@ package cn.stylefeng.guns.zjxl.service;
import cn.stylefeng.guns.zjxl.dao.ZjxlBannerDao;
import cn.stylefeng.guns.zjxl.model.ZjxlBanner;
import cn.stylefeng.guns.zjxl.model.ret.BannerCompanyCaseRet;
import cn.stylefeng.guns.zjxlUtil.BaseService;
import io.swagger.models.auth.In;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.Banner;
import org.springframework.context.annotation.Bean;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
@ -21,7 +25,7 @@ import java.util.List;
 */
@Component
@Transactional(rollbackFor = Exception.class)
public class ZjxlBannerService {
public class ZjxlBannerService extends BaseService {
    @Autowired
    private ZjxlBannerDao bannerDao;
@ -29,12 +33,35 @@ public class ZjxlBannerService {
    @Autowired
    JdbcTemplate jdbcTemplate;
    public ZjxlBanner findById(String id){
       return bannerDao.findById(id);
    public List<ZjxlBanner> findById(String id,String name,Integer page,Integer pagesize){
        String sql = "SELECT * FROM `guns-separation`.zjxl_banner WHERE 1=1";
        if (StringUtils.isNotEmpty(id)){
            sql += " AND banner_id = '"+id+"'";
        }
        if (StringUtils.isNotEmpty(name)){
            sql += " AND banner_name LIKE '%"+name+"%'";
        }
        sql += " group by banner_sort desc limit "+page+" , "+pagesize+" ";
        List<ZjxlBanner> bannerList = jdbcTemplate.query(sql,new BeanPropertyRowMapper(ZjxlBanner.class));
       return bannerList;
    }
    public int addBanner(ZjxlBanner banner){
        banner.setBannerId(getCode());
        bannerDao.save(banner);
        return 1;
    }
    public int deleteBannerById(String id){
        return bannerDao.deleteById(id);
    }
    public int updateIsLine(String id, Integer isLine){
        return bannerDao.updateIsLine(id,isLine);
    }
    public List<BannerCompanyCaseRet> finfBannerCompanyCaseById(String id){
        String sql = "SELECT * FROM zjxl_banner b, zjxl_company_case cc WHERE b.id = '"+id+"' AND b.id = cc.test_banner_id";
        String sql = "SELECT * FROM zjxl_banner b, zjxl_company_case cc WHERE b.banner_id = '"+id+"' AND b.banner_id = cc.test_banner_id";
        List<BannerCompanyCaseRet> caseRet = jdbcTemplate.query(sql, new BeanPropertyRowMapper(BannerCompanyCaseRet.class));
        return caseRet;
    }

+ 20 - 0
guns-main/src/main/java/cn/stylefeng/guns/zjxlUtil/BaseService.java

@ -0,0 +1,20 @@
package cn.stylefeng.guns.zjxlUtil;
import org.springframework.stereotype.Service;
import java.util.UUID;
/***
 * @ClassName: BaseService
 * @Description:
 * @Auther: shi kejing
 * @Date: 2020/11/3 9:04
 */
@Service
public class BaseService {
    public String getCode() {
        return UUID.randomUUID().toString().replaceAll("-", "");
    }
}

+ 134 - 0
guns-main/src/main/java/cn/stylefeng/guns/zjxlUtil/FastDFSClientPool.java

@ -0,0 +1,134 @@
package cn.stylefeng.guns.zjxlUtil;
import org.csource.fastdfs.ClientGlobal;
import org.csource.fastdfs.StorageClient;
import org.csource.fastdfs.TrackerClient;
import org.csource.fastdfs.TrackerServer;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
/**
 * Created by szx on 2015/9/19.
 */
public class FastDFSClientPool {
    private static volatile FastDFSClientPool pool;
    private Map<StorageClient, Boolean> map;
    private int maxPoolSize = 20;
    private int waitTime = 500;
    private int initPoolSize = 5;
    static {
        try {
            
            String basePath = FastDFSClientPool.class.getResource("/").getPath();
           
            ClientGlobal.init(FastDFSUtil.class.getResource("/config/fdfs_client.conf").getPath());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    private FastDFSClientPool() {
        init();
    }
    public static FastDFSClientPool getInstance() {
        if (pool == null) {
            synchronized (FastDFSClientPool.class) {
                if(pool == null) {
                    pool = new FastDFSClientPool();
                }
            }
        }
        System.out.println("FastDFSClientPool:"+pool.toString());
        return pool;
    }
    private void init() {
        try {
            map = new HashMap<StorageClient, Boolean>();
            //不做初始缓存
//            for (int i = 0; i < initPoolSize; i++) {
//                map.put(getNewStorageClient(), true);
//            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    public TrackerServer getTrackerServer(){
        try {
            TrackerClient tracker = new TrackerClient();
            return tracker.getConnection();
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
    private StorageClient getNewStorageClient() {
        try {
            TrackerClient tracker = new TrackerClient();
            TrackerServer trackerServer = tracker.getConnection();
            StorageClient client = new StorageClient(trackerServer, null);
            return client;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    public synchronized StorageClient getStorageClient() {
        StorageClient client = null;
        try {
            for (Entry<StorageClient, Boolean> entry : map.entrySet()) {
                if (entry.getValue()) {
                    client = entry.getKey();
                    System.out.println("从缓存中获得fastdfs client");
                    map.put(client, false);
                    break;
                }
            }
            if (client == null) {
                if(map.size()<maxPoolSize) {
                    System.out.println("创建新fastdfs client:");
                    client = getNewStorageClient();
                    map.put(client, false);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return client;
    }
    public void releaseStorageClient(StorageClient client) {
        if (client == null) {
            return;
        }
        try {
            if(map.containsKey(client)) {
                    map.put(client, true);
            } else {
                client =null;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

+ 283 - 0
guns-main/src/main/java/cn/stylefeng/guns/zjxlUtil/FastDFSUtil.java

@ -0,0 +1,283 @@
package cn.stylefeng.guns.zjxlUtil;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.csource.common.MyException;
import org.csource.common.NameValuePair;
import org.csource.fastdfs.*;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetSocketAddress;
/**
 * FastDFS 客户端工具.
 *
 * @author szx
 */
public class FastDFSUtil {
    public final static String GroupField = "groupName";
    public final static String RemoteFileField = "remoteFileName";
    public final static String FileIdField = "fid";
    public final static String FileUrlField = "fileUrl";
//    static TrackerClient tracker;
//    static TrackerServer trackerServer;
//    static StorageServer storageServer;
//    static StorageClient client;
//
//    static {
//        try {
//            XEnvironmentOption environmentOption = ServiceFactory.getService(Services.EnvironmentOption);
//            String basePath = FastDFSUtil.class.getResource("/").getPath();
//            String configFile = basePath + environmentOption.getOption(EnvironmentOptions.FastDFSConfig);
//
//            ClientGlobal.init(configFile);
//
//            tracker = new TrackerClient();
//            trackerServer = tracker.getConnection();
//            storageServer = null;
//            client = new StorageClient(trackerServer, storageServer);
//        } catch (FileNotFoundException e) {
//            LogService.getLogger(FastDFSUtil.class).fatal("FastDFS配置文件打开失败: " + e.getMessage());
//        } catch (IOException e) {
//            LogService.getLogger(FastDFSUtil.class).fatal("FastDFS初始化失败: " + e.getMessage());
//        } catch (MyException e) {
//            LogService.getLogger(FastDFSUtil.class).fatal("FastDFS初始化失败: " + e.getMessage());
//        }
//    }
    final static int BUFFER_SIZE = 4096;
    /**
     * 以输入流的方式上传文件
     * InputStream in = new FileInputStream("C://Desert.jpg");
     * ObjectNode msg = FileUtil.upload(in,"jpg", "沙漠");
     * in.close();
     *
     * @param in                输入流
     * @param fileExtension   文件扩展名,不要带“.”
     * @param description             文件名称(中文)
     * @return 返回值的格式如下:
     * {
     *      "groupName": "healthArchiveGroup",
     *      "remoteFileName": "/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg",
     *      "fid": "group1/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg",
     *      "fileURL": "http://172.19.103.13/healthArchiveGroup/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg"
     * }
     *
     * groupName 及 remoteFileName 可以用于查询在 fastDFS 中文件的信息,如果只是图片显示,可以忽略这两个值。
     * fid 保存了在 fastDFS 上的完整路径,为了避免将来服务器域名发生变更,最好使用本值.服务器的域名另外配置。
     * fileURL 保存了完整的 web 访问路径,为了避免将来服务器域名发生变更,最好不要直接使用本值。
     * 如果需要在下载时,可以显示原始文件名,请在访问file_url时,增加 attname 参数,如:
     *
     * http://host/healthArchiveGroup/M00/00/00/rBFuH1XdIseAUTZZAA1rIuRd3Es062.jpg?attname=a.jpg
     *
     * @throws Exception
     */
    public static ObjectNode upload(InputStream in, String fileExtension,
                                    String description) throws Exception {
        StorageClient client = FastDFSClientPool.getInstance().getStorageClient();
        try {
            NameValuePair[] fileMetaData;
            fileMetaData = new NameValuePair[1];
            fileMetaData[0] = new NameValuePair("description", description == null ? "" : description);
            ObjectMapper objectMapper = new ObjectMapper();
            ObjectNode message = objectMapper.createObjectNode();
            ByteArrayOutputStream swapStream = new ByteArrayOutputStream();
            byte[] buff = new byte[BUFFER_SIZE]; //buff用于存放循环读取的临时数据
            int rc = 0;
            while ((rc = in.read(buff, 0, BUFFER_SIZE)) > 0) {
                swapStream.write(buff, 0, rc);
            }
            byte[] fileBuffer = swapStream.toByteArray(); //in_b为转换之后的结果
            TrackerServer trackerServer = FastDFSClientPool.getInstance().getTrackerServer();
            String[] results = client.upload_file(fileBuffer, fileExtension, fileMetaData);
            if (results != null) {
                String fileId;
                int ts;
                String token;
                String fileURl;
                InetSocketAddress socketAddress;
                String groupName = results[0];
                String remoteFile = results[1];
                message.put(GroupField, groupName);
                message.put(RemoteFileField, remoteFile);
                fileId = groupName + StorageClient1.SPLIT_GROUP_NAME_AND_FILENAME_SEPERATOR + remoteFile;
                message.put(FileIdField, fileId);
                socketAddress = trackerServer.getInetSocketAddress();
                fileURl = "http://" + socketAddress.getAddress().getHostAddress();
                if (ClientGlobal.g_tracker_http_port != 80) {
                    fileURl += ":" + ClientGlobal.g_tracker_http_port;
                }
                fileURl += "/" + fileId;
                if (ClientGlobal.g_anti_steal_token) {
                    ts = (int) (System.currentTimeMillis() / 1000);
                    token = ProtoCommon.getToken(fileId, ts, ClientGlobal.g_secret_key);
                    fileURl += "?token=" + token + "&ts=" + ts;
                }
                message.put(FileUrlField, fileURl);
                
                return message;
            } else {
                return null;
            }
        }finally {
            FastDFSClientPool.getInstance().releaseStorageClient(client);
        }
    }
    /**
     * 上传本地文件
     * ObjectNode  a = FileUtil.upload("C://Desert.jpg", "沙漠");
     * System.out.println(a.toString());
     *
     * @param fileName 本地文件的绝对路径,如 C://Desert.jpg
     * @param description    文件备注, 可以为空
     * @return {"groupName":"group1","remoteFileName":"/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg"
     * {
     *      "groupName": "healthArchiveGroup",
     *      "remoteFileName": "/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg",
     *      "fid": "group1/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg",
     *      "fileURL": "http://172.19.103.13/healthArchiveGroup/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg"
     * }
     *
     * groupName 及 remoteFileName 可以用于查询在 fastDFS 中文件的信息,如果只是图片显示,可以忽略这两个值。
     * fid 保存了在 fastDFS 上的完整路径,为了避免将来服务器域名发生变更,最好使用本值.服务器的域名另外配置。
     * fileURL 保存了完整的 web 访问路径,为了避免将来服务器域名发生变更,最好不要直接使用本值。
     * 如果需要在下载时,可以显示原始文件名,请在访问file_url时,增加 attname 参数,如:
     *
     * http://host/healthArchiveGroup/M00/00/00/rBFuH1XdIseAUTZZAA1rIuRd3Es062.jpg?attname=a.jpg
     *
     * @throws Exception
     */
    public static ObjectNode upload(String fileName, String description) throws Exception {
        StorageClient client = FastDFSClientPool.getInstance().getStorageClient();
        try {
            NameValuePair[] meta_list;
            meta_list = new NameValuePair[1];
            meta_list[0] = new NameValuePair("description", description == null ? "" : description);
            ObjectMapper objectMapper = new ObjectMapper();
            ObjectNode message = objectMapper.createObjectNode();
            String fileExtName = "";
            if (fileName.contains(".")) {
                fileExtName = fileName.substring(fileName.lastIndexOf(".") + 1);
            } else {
                throw new RuntimeException("上传失败, 文件缺失扩展名.");
            }
            TrackerServer trackerServer = FastDFSClientPool.getInstance().getTrackerServer();
            String[] results = client.upload_file(fileName, fileExtName, meta_list);
            if (results != null) {
                String fileId;
                int ts;
                String token;
                String fileUrl;
                InetSocketAddress inetSockAddr;
                String groupName = results[0];
                String remoteFileName = results[1];
                message.put(GroupField, groupName);
                message.put(RemoteFileField, remoteFileName);
                fileId = groupName + StorageClient1.SPLIT_GROUP_NAME_AND_FILENAME_SEPERATOR + remoteFileName;
                message.put(FileIdField, fileId);
                inetSockAddr = trackerServer.getInetSocketAddress();
                fileUrl = "http://" + inetSockAddr.getAddress().getHostAddress();
                if (ClientGlobal.g_tracker_http_port != 80) {
                    fileUrl += ":" + ClientGlobal.g_tracker_http_port;
                }
                fileUrl += "/" + fileId;
                if (ClientGlobal.g_anti_steal_token) {
                    ts = (int) (System.currentTimeMillis() / 1000);
                    token = ProtoCommon.getToken(fileId, ts, ClientGlobal.g_secret_key);
                    fileUrl += "?token=" + token + "&ts=" + ts;
                }
                message.put(FileUrlField, fileUrl);
                
                return message;
            } else {
                return null;
            }
        }finally {
            FastDFSClientPool.getInstance().releaseStorageClient(client);
        }
    }
    /**
     * 下载文件, 返回文件字节数组.
     *
     * @param groupName      在fastdfs上的卷名
     * @param remoteFileName 在fastdfs上的路径
     * @return 文件的字节码
     * @throws Exception
     */
    public static byte[] download(String groupName, String remoteFileName) throws Exception {
        StorageClient client = FastDFSClientPool.getInstance().getStorageClient();
        try {
            byte[] b = client.download_file(groupName, remoteFileName);
            return b;
        }
        finally {
            FastDFSClientPool.getInstance().releaseStorageClient(client);
        }
    }
    /**
     * 下载文件到本地路径上.
     *
     * @param groupName          在 fastDFS 上的卷名
     * @param remoteFileName    在 fastDFS 上的路径
     * @param localPath          本地路径
     *
     * @return 是否下载成功
     */
    public static String download(String groupName, String remoteFileName, String localPath) throws IOException, MyException {
        StorageClient client = FastDFSClientPool.getInstance().getStorageClient();
        try {
            String localFileName = localPath + "\\" + remoteFileName.replaceAll("/", "_");
            client.download_file(groupName, remoteFileName, 0, 0, localFileName);
            return localFileName;
        }finally {
            FastDFSClientPool.getInstance().releaseStorageClient(client);
        }
    }
    /**
     * 删除文件。
     *
     * @param groupName
     * @param remoteFileName
     */
    public static void delete(String groupName, String remoteFileName) throws IOException, MyException {
        StorageClient client = FastDFSClientPool.getInstance().getStorageClient();
        try {
            client.delete_file(groupName, remoteFileName);
        }finally {
            FastDFSClientPool.getInstance().releaseStorageClient(client);
        }
    }
}

+ 4 - 1
guns-main/src/main/resources/application-dev.yml

@ -7,4 +7,7 @@ spring:
    password: ssgg@jkzl2019
    # 连接池大小根据实际情况调整
    max-active: 20
    max-pool-prepared-statement-per-connection-size: 20
    max-pool-prepared-statement-per-connection-size: 20
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/

+ 3 - 3
guns-main/src/main/resources/application-local.yml

@ -2,9 +2,9 @@
spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/guns-separation?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT
    username: root
    password: root
    url: jdbc:mysql://172.26.0.104/guns-separation?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT
    username: ssgg
    password: ssgg@jkzl2019
    # 连接池大小根据实际情况调整
    max-active: 20
    max-pool-prepared-statement-per-connection-size: 20