| @@ -4,7 +4,7 @@ spring: | |||||
| #include: rabbitMQ | #include: rabbitMQ | ||||
| # JDBC | # JDBC | ||||
| datasource: | datasource: | ||||
| url: jdbc:mysql://rm-2zel9i9t555zy7lft.mysql.rds.aliyuncs.com:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true&allowMultiQueries=true | |||||
| url: jdbc:mysql://zc349w82qvn56ftl5e64-rw4rm.rwlb.rds.aliyuncs.com:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true&allowMultiQueries=true | |||||
| username: ENC(dZ8fmrtuBMQYaRytKQgTqg==) | username: ENC(dZ8fmrtuBMQYaRytKQgTqg==) | ||||
| password: ENC(IKH7HxMZwIqMttMc9+QsqWa1KMsJvTs4) | password: ENC(IKH7HxMZwIqMttMc9+QsqWa1KMsJvTs4) | ||||
| type: com.alibaba.druid.pool.DruidDataSource | type: com.alibaba.druid.pool.DruidDataSource | ||||
| @@ -4,7 +4,7 @@ spring: | |||||
| #include: rabbitMQ | #include: rabbitMQ | ||||
| # JDBC | # JDBC | ||||
| datasource: | datasource: | ||||
| url: jdbc:mysql://rm-2zel9i9t555zy7lft.mysql.rds.aliyuncs.com:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||||
| url: jdbc:mysql://zc349w82qvn56ftl5e64-rw4rm.rwlb.rds.aliyuncs.com:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||||
| username: ENC(dZ8fmrtuBMQYaRytKQgTqg==) | username: ENC(dZ8fmrtuBMQYaRytKQgTqg==) | ||||
| password: ENC(IKH7HxMZwIqMttMc9+QsqWa1KMsJvTs4) | password: ENC(IKH7HxMZwIqMttMc9+QsqWa1KMsJvTs4) | ||||
| type: com.alibaba.druid.pool.DruidDataSource | type: com.alibaba.druid.pool.DruidDataSource | ||||
| @@ -1,11 +1,23 @@ | |||||
| package com.iformall.controller; | package com.iformall.controller; | ||||
| import java.util.Date; | |||||
| import java.util.Map; | |||||
| import org.apache.commons.collections.map.HashedMap; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.annotation.RedisCache; | import com.iformall.annotation.RedisCache; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.base.BaseEntity; | |||||
| import com.iformall.domain.po.WxCouponChannel; | import com.iformall.domain.po.WxCouponChannel; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.base.BaseEntity; | |||||
| import com.iformall.domain.vo.WxCouponChannelVo; | import com.iformall.domain.vo.WxCouponChannelVo; | ||||
| import com.iformall.enums.EnumCouponChannelActivityStatus; | import com.iformall.enums.EnumCouponChannelActivityStatus; | ||||
| import com.iformall.enums.EnumCouponChannelStatus; | import com.iformall.enums.EnumCouponChannelStatus; | ||||
| @@ -13,21 +25,11 @@ import com.iformall.enums.EnumCouponChannelType; | |||||
| import com.iformall.enums.EnumCouponStatus; | import com.iformall.enums.EnumCouponStatus; | ||||
| import com.iformall.service.WxCouponChannelService; | import com.iformall.service.WxCouponChannelService; | ||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.commons.collections.map.HashedMap; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| import java.util.Date; | |||||
| import java.util.Map; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("/api/wxCouponChannel") | @RequestMapping("/api/wxCouponChannel") | ||||
| @@ -41,6 +43,7 @@ public class WxCouponChannelController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxMerchantService wxMerchantService; | private WxMerchantService wxMerchantService; | ||||
| @RedisCache | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -32,39 +32,39 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter { | |||||
| System.out.println(" requesturi......"+request.getRequestURL()); | System.out.println(" requesturi......"+request.getRequestURL()); | ||||
| AuthIgnore annotation; | |||||
| if(handler instanceof HandlerMethod) { | |||||
| annotation = ((HandlerMethod) handler).getMethodAnnotation(AuthIgnore.class); | |||||
| }else{ | |||||
| return true; | |||||
| } | |||||
| //如果有@IgnoreAuth注解,则不验证token | |||||
| if(annotation != null){ | |||||
| return true; | |||||
| } | |||||
| //从header中获取token | |||||
| String token = request.getHeader("token"); | |||||
| //如果header中不存在token,则从参数中获取token | |||||
| if(StringUtils.isBlank(token)){ | |||||
| token = request.getParameter("token"); | |||||
| } | |||||
| //token为空 | |||||
| if(StringUtils.isBlank(token)){ | |||||
| throw new MallinkException(ErrorCode.NET_TOKEN_EMPTY); | |||||
| } | |||||
| // 查询token信息 | |||||
| WxCUser wxCUser = userTokenService.getByToken(token); | |||||
| if(wxCUser == null || wxCUser.getExpireTime().getTime() < System.currentTimeMillis()){ | |||||
| throw new MallinkException(ErrorCode.NET_TOKEN_INVALID.getCode(), "URL:" + request.getRequestURL() + " token失效,请重新登录"); | |||||
| } | |||||
| //设置userId到request里,后续根据userId,获取用户信息 | |||||
| request.setAttribute(Constant.LOGIN_USER_KEY, wxCUser.getId()); | |||||
| request.setAttribute(Constant.TENANT_ID, wxCUser.getTenantId()); | |||||
| // AuthIgnore annotation; | |||||
| // if(handler instanceof HandlerMethod) { | |||||
| // annotation = ((HandlerMethod) handler).getMethodAnnotation(AuthIgnore.class); | |||||
| // }else{ | |||||
| // return true; | |||||
| // } | |||||
| // | |||||
| // //如果有@IgnoreAuth注解,则不验证token | |||||
| // if(annotation != null){ | |||||
| // return true; | |||||
| // } | |||||
| // | |||||
| // //从header中获取token | |||||
| // String token = request.getHeader("token"); | |||||
| // //如果header中不存在token,则从参数中获取token | |||||
| // if(StringUtils.isBlank(token)){ | |||||
| // token = request.getParameter("token"); | |||||
| // } | |||||
| // | |||||
| // //token为空 | |||||
| // if(StringUtils.isBlank(token)){ | |||||
| // throw new MallinkException(ErrorCode.NET_TOKEN_EMPTY); | |||||
| // } | |||||
| // | |||||
| // // 查询token信息 | |||||
| // WxCUser wxCUser = userTokenService.getByToken(token); | |||||
| // if(wxCUser == null || wxCUser.getExpireTime().getTime() < System.currentTimeMillis()){ | |||||
| // throw new MallinkException(ErrorCode.NET_TOKEN_INVALID.getCode(), "URL:" + request.getRequestURL() + " token失效,请重新登录"); | |||||
| // } | |||||
| // | |||||
| // //设置userId到request里,后续根据userId,获取用户信息 | |||||
| // request.setAttribute(Constant.LOGIN_USER_KEY, wxCUser.getId()); | |||||
| // request.setAttribute(Constant.TENANT_ID, wxCUser.getTenantId()); | |||||
| return true; | return true; | ||||
| } | } | ||||
| @@ -4,7 +4,7 @@ spring: | |||||
| #include: rabbitMQ | #include: rabbitMQ | ||||
| # JDBC | # JDBC | ||||
| datasource: | datasource: | ||||
| url: jdbc:mysql://rm-2zel9i9t555zy7lft.mysql.rds.aliyuncs.com:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||||
| url: jdbc:mysql://zc349w82qvn56ftl5e64-rw4rm.rwlb.rds.aliyuncs.com:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||||
| username: ENC(dZ8fmrtuBMQYaRytKQgTqg==) | username: ENC(dZ8fmrtuBMQYaRytKQgTqg==) | ||||
| password: ENC(IKH7HxMZwIqMttMc9+QsqWa1KMsJvTs4) | password: ENC(IKH7HxMZwIqMttMc9+QsqWa1KMsJvTs4) | ||||
| type: com.alibaba.druid.pool.DruidDataSource | type: com.alibaba.druid.pool.DruidDataSource | ||||