Przeglądaj źródła

Merge branch 'master' of http://192.168.1.220:10080/Amoy2/guns-separation

chenyue 4 lat temu
rodzic
commit
5a9cd24ad9

+ 14 - 0
guns-base-support/guns-system/src/main/java/cn/stylefeng/guns/sys/config/SpringSecurityConfig.java

@ -34,6 +34,8 @@ import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.firewall.HttpFirewall;
import org.springframework.security.web.firewall.StrictHttpFirewall;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
@ -76,6 +78,18 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
        return new CorsFilter(source);
    }
    /**
     * 配置地址栏不能识别 // 的情况
     * @return
     */
    @Bean
    public HttpFirewall allowUrlEncodedSlashHttpFirewall() {
        StrictHttpFirewall firewall = new StrictHttpFirewall();
        //此处可添加别的规则,目前只设置 允许双 //
        firewall.setAllowUrlEncodedDoubleSlash(true);
        return firewall;
    }
    @Override
    protected void configure(HttpSecurity httpSecurity) throws Exception {

+ 12 - 0
guns-main/src/main/java/cn/stylefeng/guns/zjxl/cnotroller/ZjxlArticleContentController.java

@ -7,6 +7,8 @@ import cn.stylefeng.guns.zjxlUtil.PageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@ -26,6 +28,8 @@ import java.util.List;
@RequestMapping(value = "/zjxl/zjxlArticleContent")
public class ZjxlArticleContentController extends BaseController {
    private Logger logger = (Logger) LoggerFactory.getLogger(ZjxlArticleContentController.class);
    @Autowired
    private ZjxlArticleContentService articleContentService;
@ -77,6 +81,10 @@ public class ZjxlArticleContentController extends BaseController {
    @ApiOperation(value = "删除文章管理")
    public String deleteArticleContent(@ApiParam(name = "id", value = "文章id") @RequestParam(value = "id") String id){
        try {
            if (id == null){
                logger.info("修改是否上线:id====="+id);
                return write(-1,"获取参数失败");
            }
            return write(200,"删除成功","data",articleContentService.deleteArticleContent(id));
        }catch (Exception e){
            e.printStackTrace();
@ -89,6 +97,10 @@ public class ZjxlArticleContentController extends BaseController {
    public String updateArticleContent(@ApiParam(name = "id", value = "文章id") @RequestParam(value = "id") String id,
                                       @ApiParam(name = "isLine", value = "是否上线") @RequestParam(value = "isLine") Integer isLine){
        try {
            if (id == null || isLine == null){
                logger.info("修改是否上线:id====="+id+",isLine===="+isLine);
                return write(-1,"获取参数失败");
            }
            return write(200,"修改上线成功","data",articleContentService.updateArticleContent(id,isLine));
        }catch (Exception e){
            e.printStackTrace();

+ 14 - 0
guns-main/src/main/java/cn/stylefeng/guns/zjxl/cnotroller/ZjxlBannerCnotroller.java

@ -15,6 +15,8 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
@ -28,6 +30,7 @@ import java.io.IOException;
import java.util.Collections;
import java.util.List;
/***
 * @ClassName: ZjxlBannerCnotroller
 * @Description:
@ -39,6 +42,8 @@ import java.util.List;
@RequestMapping(value = "/zjxl/banner")
public class ZjxlBannerCnotroller extends BaseController {
    private Logger logger = (Logger) LoggerFactory.getLogger(ZjxlBannerCnotroller.class);
    @Autowired
    private ZjxlBannerService bannerService;
@ -80,6 +85,7 @@ public class ZjxlBannerCnotroller extends BaseController {
        banner.setBannerType(bannerType);
        banner.setBannerTypeUrl(bannerTypeUrl);
        try {
            logger.info("执行banner添加,参数:"+banner);
            return write(200,"添加成功","data",bannerService.addBanner(banner));
        }catch (Exception e){
            return write(-1,"添加失败");
@ -90,6 +96,10 @@ public class ZjxlBannerCnotroller extends BaseController {
    @ApiOperation(value = "删除banner")
    public String deleteBannerById(String id){
        try {
            logger.info("删除banner,参数"+id);
            if(id == null){
                return write(-1,"参数获取失败:null");
            }
            return write(200,"删除成功","data",bannerService.deleteBannerById(id));
        }catch (Exception e){
            e.printStackTrace();
@ -101,6 +111,10 @@ public class ZjxlBannerCnotroller extends BaseController {
    @ApiOperation(value = "修改是否上线")
    public String updateIsLine(String id,Integer isLine){
        try {
            logger.info("修改是否上线:id====="+id+",isLine===="+isLine);
            if (id == null || isLine == null){
                return write(-1,"获取参数失败");
            }
            return write(200,"修改成功","data",bannerService.updateIsLine(id,isLine));
        }catch (Exception e){
            e.printStackTrace();

+ 12 - 0
guns-main/src/main/java/cn/stylefeng/guns/zjxl/cnotroller/ZjxlCompanyCaseController.java

@ -7,6 +7,8 @@ import cn.stylefeng.guns.zjxlUtil.PageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@ -26,6 +28,8 @@ import java.util.List;
@RequestMapping(value = "/zjxl/CompanyCase")
public class ZjxlCompanyCaseController extends BaseController {
    private Logger logger = (Logger) LoggerFactory.getLogger(ZjxlCompanyCaseController.class);
    @Autowired
    private ZjxlCompanyCaseService companyCaseService;
@ -78,6 +82,10 @@ public class ZjxlCompanyCaseController extends BaseController {
    @ApiOperation(value = "根据id删除案例")
    public String deleteCompanyCase(String id){
        try{
            if (id == null){
                logger.info("删除合作伙伴 id===== "+id);
                return write(-1,"获取参数失败");
            }
            return write(200,"删除成功","data",companyCaseService.deleteCompanyCase(id));
        }catch (Exception e){
            e.printStackTrace();
@ -89,6 +97,10 @@ public class ZjxlCompanyCaseController extends BaseController {
    @ApiOperation(value = "根据id修改案例是否上线")
    public String updateIsLine(String id, Integer isLine){
        try{
            if (id == null || isLine == null){
                logger.info("修改是否上线:id====="+id+",isLine===="+isLine);
                return write(-1,"获取参数失败");
                }
            return write(200,"修改成功","data",companyCaseService.updateIsLine(id, isLine));
        }catch (Exception e){
            e.printStackTrace();

+ 12 - 0
guns-main/src/main/java/cn/stylefeng/guns/zjxl/cnotroller/ZjxlPartnerController.java

@ -7,6 +7,8 @@ import cn.stylefeng.guns.zjxlUtil.PageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@ -26,6 +28,8 @@ import java.util.List;
@RequestMapping(value = "/zjxl/partner")
public class ZjxlPartnerController extends BaseController {
    private Logger logger = (Logger) LoggerFactory.getLogger(ZjxlPartnerController.class);
    @Autowired
    private ZjxlPartnerService partnerService;
@ -68,6 +72,10 @@ public class ZjxlPartnerController extends BaseController {
    @ApiOperation(value = "合作伙伴修改上线")
    public String updatePartner(String id, Integer isLine){
        try {
            if (id == null || isLine == null){
                logger.info("修改是否上线:id====="+id+",isLine===="+isLine);
                return write(-1,"获取参数失败");
            }
            return write(200,"修改上线成功","data",partnerService.updatePartner(id,isLine));
        }catch (Exception e){
            e.printStackTrace();
@ -79,6 +87,10 @@ public class ZjxlPartnerController extends BaseController {
    @ApiOperation(value = "删除合作伙伴")
    public String deletePartner(String id){
        try {
            if (id == null){
                logger.info("删除合作伙伴:id====="+id);
                return write(-1,"获取参数失败");
            }
            return write(200,"删除成功","data",partnerService.deletePartner(id));
        }catch (Exception e){
            e.printStackTrace();

+ 12 - 0
guns-main/src/main/java/cn/stylefeng/guns/zjxl/cnotroller/ZjxlSystemDictController.java

@ -7,6 +7,8 @@ import cn.stylefeng.guns.zjxlUtil.PageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@ -26,6 +28,8 @@ import java.util.List;
@Api(description = "系统管理字典")
public class ZjxlSystemDictController extends BaseController {
    private Logger logger = (Logger) LoggerFactory.getLogger(ZjxlSystemDictController.class);
    @Autowired
    private ZjxlSystemDictService systemDictService;
@ -71,6 +75,10 @@ public class ZjxlSystemDictController extends BaseController {
    @ApiOperation(value = "删除字典")
    public String deleteSystemDict(@ApiParam(name = "id", value = "systemDictId", required = false) @RequestParam(value = "id", required = false)String id){
        try {
            if (id == null) {
                logger.info("删除合作伙伴:id====="+id);
                return write(-1,"获取参数失败");
            }
            return write(200,"删除成功","data",systemDictService.deleteSystemDict(id));
        }catch (Exception e){
            e.printStackTrace();
@ -83,6 +91,10 @@ public class ZjxlSystemDictController extends BaseController {
    public String updateSystemDict(@ApiParam(name = "id", value = "systemDictId", required = false) @RequestParam(value = "id", required = false)String id,
                                   @ApiParam(name = "isLine", value = "是否上线", required = false) @RequestParam(value = "isLine", required = false)Integer isLine){
        try {
            if (id == null || isLine == null){
                logger.info("修改是否上线:id====="+id+",isLine===="+isLine);
                return write(-1,"获取参数失败");
            }
            return write(200,"修改上线成功","data",systemDictService.updateSystemDict(id,isLine));
        }catch (Exception e){
            e.printStackTrace();

+ 4 - 3
guns-main/src/main/resources/application-prod.yml

@ -2,11 +2,12 @@
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: 123456
    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
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/