diff --git a/beacon-cache/src/main/java/com/mashibing/cache/contorller/CacheController.java b/beacon-cache/src/main/java/com/mashibing/cache/contorller/CacheController.java index 3472d58..e0477ad 100644 --- a/beacon-cache/src/main/java/com/mashibing/cache/contorller/CacheController.java +++ b/beacon-cache/src/main/java/com/mashibing/cache/contorller/CacheController.java @@ -23,20 +23,27 @@ public class CacheController { @PostMapping(value = "/cache/hmset/{key}") public void hmset(@PathVariable(value = "key") String key, @RequestBody Map map) { log.info("【缓存模块】hmset方法,存储key = {},存储value = {}", key, map); - redisClient.putMap(key,map); + redisClient.putMap(key, map); } @PostMapping(value = "/cache/set/{key}") - public void set(@PathVariable(value = "key") String key, @RequestParam(value = "value") String value){ + public void set(@PathVariable(value = "key") String key, @RequestParam(value = "value") Object value) { log.info("【缓存模块】set方法,存储key = {},存储value = {}", key, value); - redisClient.set(key,value); + redisClient.set(key, value); } @PostMapping(value = "/cache/sadd/{key}") - public void sadd(@PathVariable(value = "key") String key, @RequestBody Map... value){ + public void sadd(@PathVariable(value = "key") String key, @RequestBody Map... value) { log.info("【缓存模块】sadd 方法,存储key = {},存储value = {}", key, value); - redisClient.sAdd(key,value); + redisClient.sAdd(key, value); } -} + @GetMapping("/cache/hgetall/{key}") + public Map hGetAll(@PathVariable(value = "key") String key) { + log.info("【缓存模块】hGetAll 方法,获取key = {} 的数据", key); + Map value = redisClient.getMap(key); + log.info("【缓存模块】hGetAll 方法,获取key = {} 的数据 value = {}", key, value); + return value; + } +} \ No newline at end of file diff --git a/beacon-common/src/main/java/com/mashibing/constant/CacheConstant.java b/beacon-common/src/main/java/com/mashibing/constant/CacheConstant.java new file mode 100644 index 0000000..7de467a --- /dev/null +++ b/beacon-common/src/main/java/com/mashibing/constant/CacheConstant.java @@ -0,0 +1,26 @@ +package com.mashibing.constant; + +/** + * 缓存模块中的各种前缀 + * @author kezhen + * @date 2022/12/29 + * @description + */ +public interface CacheConstant { + /** + * 客户信息 + */ + String CLIENT_BUSINESS = "client_business:"; + /** + * 客户签名 + */ + String CLIENT_SIGN = "client_sign:"; + /** + * 客户签名的模版 + */ + String CLIENT_TEMPLATE = "client_template:"; + /** + * 客户的余额 + */ + String CLIENT_BALANCE = "client_balance:"; +} diff --git a/beacon-common/src/main/java/com/mashibing/enums/ExceptionEnums.java b/beacon-common/src/main/java/com/mashibing/enums/ExceptionEnums.java new file mode 100644 index 0000000..95d7a1b --- /dev/null +++ b/beacon-common/src/main/java/com/mashibing/enums/ExceptionEnums.java @@ -0,0 +1,27 @@ +package com.mashibing.enums; + +import lombok.Getter; + +/** + * @author kezhen + * @date 2022/12/29 + * @description + */ +@Getter +public enum ExceptionEnums { + ERROR_APIKEY(-1, "非法的apikey"), + IP_NOT_WHITE(-2, "请求的ip不在白名单内"), + ERROR_SIGN(-3, "无可用签名"), + ERROR_TEMPLATE(-4, "无可用签名"), + ERROR_MOBILE(-5, "手机号格式不正确"), + BALANCE_NOT_ENOUGH(-6, "余额不足"), + PARAMETER_ERROR(-10,"参数不合法"), + ; + private Integer code; + private String msg; + + ExceptionEnums(Integer code, String msg) { + this.code = code; + this.msg = msg; + } +} diff --git a/beacon-common/src/main/java/com/mashibing/exceptiion/ApiException.java b/beacon-common/src/main/java/com/mashibing/exceptiion/ApiException.java new file mode 100644 index 0000000..7d014db --- /dev/null +++ b/beacon-common/src/main/java/com/mashibing/exceptiion/ApiException.java @@ -0,0 +1,25 @@ +package com.mashibing.exceptiion; + +import com.mashibing.enums.ExceptionEnums; +import lombok.Getter; + +/** + * @author kezhen + * @date 2022/12/29 + * @description + */ +@Getter +public class ApiException extends RuntimeException { + private Integer code; + + public ApiException(String message, Integer code) { + super(message); + this.code = code; + } + + public ApiException(ExceptionEnums enums) { + super(enums.getMsg()); + this.code = enums.getCode(); + } + +} diff --git a/beacon-test/src/main/java/com/mashibing/test/client/CacheClient.java b/beacon-test/src/main/java/com/mashibing/test/client/CacheClient.java index af0d90a..9b6a9b3 100644 --- a/beacon-test/src/main/java/com/mashibing/test/client/CacheClient.java +++ b/beacon-test/src/main/java/com/mashibing/test/client/CacheClient.java @@ -20,7 +20,7 @@ public interface CacheClient { void hmset(@PathVariable(value = "key") String key, @RequestBody Map map); @PostMapping(value = "/cache/set/{key}") - void set(@PathVariable(value = "key") String key, @RequestParam(value = "value") String value); + void set(@PathVariable(value = "key") String key, @RequestParam(value = "value") Object value); @PostMapping(value = "/cache/sadd/{key}") void sadd(@PathVariable(value = "key") String key, @RequestBody Map... maps); diff --git a/beacon-test/src/main/java/com/mashibing/test/entity/ClientBalance.java b/beacon-test/src/main/java/com/mashibing/test/entity/ClientBalance.java index edd4a42..19a74ef 100644 --- a/beacon-test/src/main/java/com/mashibing/test/entity/ClientBalance.java +++ b/beacon-test/src/main/java/com/mashibing/test/entity/ClientBalance.java @@ -8,6 +8,25 @@ public class ClientBalance { private long balance; private java.sql.Timestamp created; private long createId; + + @Override + public String toString() { + return "ClientBalance{" + + "id=" + id + + ", clientId=" + clientId + + ", balance=" + balance + + ", created=" + created + + ", createId=" + createId + + ", updated=" + updated + + ", updateId=" + updateId + + ", isDelete=" + isDelete + + ", extend1='" + extend1 + '\'' + + ", extend2='" + extend2 + '\'' + + ", extend3='" + extend3 + '\'' + + ", extend4='" + extend4 + '\'' + + '}'; + } + private java.sql.Timestamp updated; private long updateId; private long isDelete; diff --git a/beacon-test/src/main/java/com/mashibing/test/mapper/ClientBalanceMapper.java b/beacon-test/src/main/java/com/mashibing/test/mapper/ClientBalanceMapper.java new file mode 100644 index 0000000..3f04939 --- /dev/null +++ b/beacon-test/src/main/java/com/mashibing/test/mapper/ClientBalanceMapper.java @@ -0,0 +1,15 @@ +package com.mashibing.test.mapper; + +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +/** + * @author kezhen + * @date 2022/12/28 + * @description + */ +public interface ClientBalanceMapper { + + @Select("select balance from client_balance where client_id = #{clientId}") + Long findByClientId(@Param("clientId") Integer clientId); +} diff --git a/beacon-test/src/test/java/com/mashibing/test/mapper/ClientBalanceMapperTest.java b/beacon-test/src/test/java/com/mashibing/test/mapper/ClientBalanceMapperTest.java new file mode 100644 index 0000000..e25fe8c --- /dev/null +++ b/beacon-test/src/test/java/com/mashibing/test/mapper/ClientBalanceMapperTest.java @@ -0,0 +1,33 @@ +package com.mashibing.test.mapper; + +import com.mashibing.test.client.CacheClient; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import static org.junit.Assert.*; + +/** + * @author kezhen + * @date 2022/12/28 + * @description + */ +@SpringBootTest +@RunWith(SpringRunner.class) +public class ClientBalanceMapperTest { + + @Autowired + private ClientBalanceMapper clientBalanceMapper; + @Autowired + private CacheClient cacheClient; + + @Test + public void findByClientId() { + Long balance = clientBalanceMapper.findByClientId(1); + System.out.println("balance = " + balance); + cacheClient.set("client_balance:1", balance); + + } +} \ No newline at end of file diff --git a/beancon-api/src/main/java/com/mashibing/advice/ApiExceptionHander.java b/beancon-api/src/main/java/com/mashibing/advice/ApiExceptionHander.java new file mode 100644 index 0000000..1c5b975 --- /dev/null +++ b/beancon-api/src/main/java/com/mashibing/advice/ApiExceptionHander.java @@ -0,0 +1,22 @@ +package com.mashibing.advice; + +import com.mashibing.api.util.R; +import com.mashibing.api.vo.ResultVO; +import com.mashibing.exceptiion.ApiException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +/** + * @author kezhen + * @date 2022/12/29 + * @description + */ +@RestControllerAdvice +public class ApiExceptionHander { + @ExceptionHandler(ApiException.class) + public ResultVO apiException(ApiException ex){ + System.out.println("exception.getCode() = " + ex.getCode()); + return R.error(ex); + } + +} diff --git a/beancon-api/src/main/java/com/mashibing/api/client/BeaconCacheClient.java b/beancon-api/src/main/java/com/mashibing/api/client/BeaconCacheClient.java index ef4e06a..e87e88a 100644 --- a/beancon-api/src/main/java/com/mashibing/api/client/BeaconCacheClient.java +++ b/beancon-api/src/main/java/com/mashibing/api/client/BeaconCacheClient.java @@ -1,6 +1,10 @@ package com.mashibing.api.client; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; + +import java.util.Map; /** * @author kezhen @@ -8,5 +12,8 @@ import org.springframework.cloud.openfeign.FeignClient; * @description */ @FeignClient(value = "beacon-cache") -public class BeaconCacheClient { +public interface BeaconCacheClient { + + @GetMapping("/cache/hgetall/{key}") + Map hGetAll(@PathVariable(value = "key") String key); } diff --git a/beancon-api/src/main/java/com/mashibing/api/controller/SmsController.java b/beancon-api/src/main/java/com/mashibing/api/controller/SmsController.java index cceb329..858eb34 100644 --- a/beancon-api/src/main/java/com/mashibing/api/controller/SmsController.java +++ b/beancon-api/src/main/java/com/mashibing/api/controller/SmsController.java @@ -1,11 +1,13 @@ package com.mashibing.api.controller; -import com.mashibing.api.enums.SmsCodeEnum; +import com.mashibing.api.filter.CheckFilterContext; import com.mashibing.api.from.SingleSendForm; import com.mashibing.api.util.R; import com.mashibing.api.vo.ResultVO; import com.mashibing.common.model.StandardSubmit; +import com.mashibing.enums.ExceptionEnums; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.util.StringUtils; @@ -43,6 +45,9 @@ public class SmsController { */ private final String X_FORWARDED_FOR = "x-forwarded-for"; + @Autowired + private CheckFilterContext checkFilterContext; + /** * @param singleSendForm * @return @@ -54,7 +59,7 @@ public class SmsController { if (bindingResult.hasErrors()) { String message = bindingResult.getFieldError().getDefaultMessage(); log.info("【接口模块-单条短信Contorller】 参数不合法,msg = {}", message); - return R.error(SmsCodeEnum.PARAMETER_ERROR.getCode(), message); + return R.error(ExceptionEnums.PARAMETER_ERROR.getCode(), message); } //===============获取真实的ip================== String ip = this.getRealIP(request); @@ -69,6 +74,9 @@ public class SmsController { standardSubmit.setState(singleSendForm.getState()); standardSubmit.setUid(singleSendForm.getUid()); + //===============调用策略模式的校验链================== + checkFilterContext.check(standardSubmit); + //===============发送到MQ,交给策略模块处理================== return R.ok(); diff --git a/beancon-api/src/main/java/com/mashibing/api/controller/TestController.java b/beancon-api/src/main/java/com/mashibing/api/controller/TestController.java index c65bd9b..a97c20b 100644 --- a/beancon-api/src/main/java/com/mashibing/api/controller/TestController.java +++ b/beancon-api/src/main/java/com/mashibing/api/controller/TestController.java @@ -1,6 +1,7 @@ package com.mashibing.api.controller; import com.mashibing.api.filter.CheckFilterContext; +import com.mashibing.common.model.StandardSubmit; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; @@ -16,6 +17,7 @@ public class TestController { @GetMapping("/api/test") public void test(){ System.out.println("=============================="); - checkFilterContext.check(new Object()); + StandardSubmit standardSubmit = new StandardSubmit(); + checkFilterContext.check(standardSubmit); } } diff --git a/beancon-api/src/main/java/com/mashibing/api/enums/SmsCodeEnum.java b/beancon-api/src/main/java/com/mashibing/api/enums/SmsCodeEnum.java deleted file mode 100644 index 43411a1..0000000 --- a/beancon-api/src/main/java/com/mashibing/api/enums/SmsCodeEnum.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.mashibing.api.enums; - -import lombok.Getter; - -/** - * @author kezhen - * @date 2022/12/24 - * @description 一些相应信息中code和message的对应 - */ -@Getter -public enum SmsCodeEnum { - PARAMETER_ERROR(-10,"参数不合法"); - private Integer code; - private String meg; - - SmsCodeEnum(Integer code, String meg) { - this.code = code; - this.meg = meg; - } -} diff --git a/beancon-api/src/main/java/com/mashibing/api/filter/CheckFilter.java b/beancon-api/src/main/java/com/mashibing/api/filter/CheckFilter.java index 414ac3e..b5af086 100644 --- a/beancon-api/src/main/java/com/mashibing/api/filter/CheckFilter.java +++ b/beancon-api/src/main/java/com/mashibing/api/filter/CheckFilter.java @@ -1,5 +1,7 @@ package com.mashibing.api.filter; +import com.mashibing.common.model.StandardSubmit; + /** * @author kezhen * @description 做策略模式的父接口 @@ -8,7 +10,7 @@ public interface CheckFilter { /** * 校验!!!! - * @param obj + * @param standardSubmit */ - void check(Object obj); + void check(StandardSubmit submit); } diff --git a/beancon-api/src/main/java/com/mashibing/api/filter/CheckFilterContext.java b/beancon-api/src/main/java/com/mashibing/api/filter/CheckFilterContext.java index 53f269c..648cf51 100644 --- a/beancon-api/src/main/java/com/mashibing/api/filter/CheckFilterContext.java +++ b/beancon-api/src/main/java/com/mashibing/api/filter/CheckFilterContext.java @@ -1,5 +1,6 @@ package com.mashibing.api.filter; +import com.mashibing.common.model.StandardSubmit; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.cloud.context.config.annotation.RefreshScope; @@ -24,11 +25,11 @@ public class CheckFilterContext { /** * 当前check方法用于管理校验链的顺序 */ - public void check(Object obj){ + public void check(StandardSubmit standardSubmit){ String[] filterArray = filters.split(","); for (String filter : filterArray) { CheckFilter checkFilter = checkFilterMap.get(filter); - checkFilter.check(obj); + checkFilter.check(standardSubmit); } } } diff --git a/beancon-api/src/main/java/com/mashibing/api/filter/impl/ApiKeyCheckFilter.java b/beancon-api/src/main/java/com/mashibing/api/filter/impl/ApiKeyCheckFilter.java index ad86a6f..54982bc 100644 --- a/beancon-api/src/main/java/com/mashibing/api/filter/impl/ApiKeyCheckFilter.java +++ b/beancon-api/src/main/java/com/mashibing/api/filter/impl/ApiKeyCheckFilter.java @@ -1,9 +1,17 @@ package com.mashibing.api.filter.impl; +import com.mashibing.api.client.BeaconCacheClient; import com.mashibing.api.filter.CheckFilter; +import com.mashibing.common.model.StandardSubmit; +import com.mashibing.constant.CacheConstant; +import com.mashibing.enums.ExceptionEnums; +import com.mashibing.exceptiion.ApiException; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.Map; + /** * @author kezhen * @description @@ -11,8 +19,19 @@ import org.springframework.stereotype.Service; @Service(value = "apikey") @Slf4j public class ApiKeyCheckFilter implements CheckFilter { + + @Autowired + private BeaconCacheClient beaconCacheClient; + @Override - public void check(Object obj) { + public void check(StandardSubmit submit) { log.info("【接口模块-校验apikey】 校验ing…………"); + Map clientBusiness = beaconCacheClient.hGetAll(CacheConstant.CLIENT_BUSINESS + submit.getApikey()); + if (clientBusiness == null || clientBusiness.size() == 0) { + log.info("【接口模块-校验apikey】 非法的apikey = {}", submit.getApikey()); + throw new ApiException(ExceptionEnums.ERROR_APIKEY); + } + submit.setCliendId((Long) clientBusiness.get("id")); + log.info("【接口模块-校验apikey】 查询到客户信息 clientBusiness= {}", clientBusiness); } } diff --git a/beancon-api/src/main/java/com/mashibing/api/filter/impl/FeeCheckFilter.java b/beancon-api/src/main/java/com/mashibing/api/filter/impl/FeeCheckFilter.java index ea054fa..f64df54 100644 --- a/beancon-api/src/main/java/com/mashibing/api/filter/impl/FeeCheckFilter.java +++ b/beancon-api/src/main/java/com/mashibing/api/filter/impl/FeeCheckFilter.java @@ -1,6 +1,7 @@ package com.mashibing.api.filter.impl; import com.mashibing.api.filter.CheckFilter; +import com.mashibing.common.model.StandardSubmit; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -12,7 +13,7 @@ import org.springframework.stereotype.Service; @Slf4j public class FeeCheckFilter implements CheckFilter { @Override - public void check(Object obj) { + public void check(StandardSubmit submit) { log.info("【接口模块-校验客户余额】 校验ing…………"); } } diff --git a/beancon-api/src/main/java/com/mashibing/api/filter/impl/IPCheckFilter.java b/beancon-api/src/main/java/com/mashibing/api/filter/impl/IPCheckFilter.java index 8ca64f0..77b1b57 100644 --- a/beancon-api/src/main/java/com/mashibing/api/filter/impl/IPCheckFilter.java +++ b/beancon-api/src/main/java/com/mashibing/api/filter/impl/IPCheckFilter.java @@ -1,6 +1,7 @@ package com.mashibing.api.filter.impl; import com.mashibing.api.filter.CheckFilter; +import com.mashibing.common.model.StandardSubmit; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -12,7 +13,7 @@ import org.springframework.stereotype.Service; @Slf4j public class IPCheckFilter implements CheckFilter { @Override - public void check(Object obj) { + public void check(StandardSubmit submit) { log.info("【接口模块-校验IP】 校验ing…………"); } } diff --git a/beancon-api/src/main/java/com/mashibing/api/filter/impl/MobileCheckFilter.java b/beancon-api/src/main/java/com/mashibing/api/filter/impl/MobileCheckFilter.java index 3b9a9bd..f25ba07 100644 --- a/beancon-api/src/main/java/com/mashibing/api/filter/impl/MobileCheckFilter.java +++ b/beancon-api/src/main/java/com/mashibing/api/filter/impl/MobileCheckFilter.java @@ -1,6 +1,7 @@ package com.mashibing.api.filter.impl; import com.mashibing.api.filter.CheckFilter; +import com.mashibing.common.model.StandardSubmit; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -12,7 +13,7 @@ import org.springframework.stereotype.Service; @Slf4j public class MobileCheckFilter implements CheckFilter { @Override - public void check(Object obj) { + public void check(StandardSubmit submit) { log.info("【接口模块-校验手机号】 校验ing…………"); } } diff --git a/beancon-api/src/main/java/com/mashibing/api/filter/impl/SignCheckFilter.java b/beancon-api/src/main/java/com/mashibing/api/filter/impl/SignCheckFilter.java index 1d3f70e..d0bbebc 100644 --- a/beancon-api/src/main/java/com/mashibing/api/filter/impl/SignCheckFilter.java +++ b/beancon-api/src/main/java/com/mashibing/api/filter/impl/SignCheckFilter.java @@ -1,6 +1,7 @@ package com.mashibing.api.filter.impl; import com.mashibing.api.filter.CheckFilter; +import com.mashibing.common.model.StandardSubmit; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -12,7 +13,7 @@ import org.springframework.stereotype.Service; @Slf4j public class SignCheckFilter implements CheckFilter { @Override - public void check(Object obj) { + public void check(StandardSubmit submit) { log.info("【接口模块-校验签名】 校验ing…………"); } } diff --git a/beancon-api/src/main/java/com/mashibing/api/filter/impl/TemplateCheckFilter.java b/beancon-api/src/main/java/com/mashibing/api/filter/impl/TemplateCheckFilter.java index 707cb87..38ad3fa 100644 --- a/beancon-api/src/main/java/com/mashibing/api/filter/impl/TemplateCheckFilter.java +++ b/beancon-api/src/main/java/com/mashibing/api/filter/impl/TemplateCheckFilter.java @@ -1,6 +1,7 @@ package com.mashibing.api.filter.impl; import com.mashibing.api.filter.CheckFilter; +import com.mashibing.common.model.StandardSubmit; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -12,7 +13,7 @@ import org.springframework.stereotype.Service; @Slf4j public class TemplateCheckFilter implements CheckFilter { @Override - public void check(Object obj) { + public void check(StandardSubmit submit) { log.info("【接口模块-校验模版】 校验ing…………"); } } diff --git a/beancon-api/src/main/java/com/mashibing/api/util/R.java b/beancon-api/src/main/java/com/mashibing/api/util/R.java index e9db904..0c1fe3a 100644 --- a/beancon-api/src/main/java/com/mashibing/api/util/R.java +++ b/beancon-api/src/main/java/com/mashibing/api/util/R.java @@ -1,6 +1,7 @@ package com.mashibing.api.util; import com.mashibing.api.vo.ResultVO; +import com.mashibing.exceptiion.ApiException; /** * @author kezhen @@ -9,16 +10,23 @@ import com.mashibing.api.vo.ResultVO; */ public class R { public static ResultVO ok() { - ResultVO r = new ResultVO(); - r.setCode(0); - r.setMsg("接收成功"); - return r; + ResultVO resultVO = new ResultVO(); + resultVO.setCode(0); + resultVO.setMsg("接收成功"); + return resultVO; } - public static ResultVO error(Integer code, String message) { - ResultVO r = new ResultVO(); - r.setCode(code); - r.setMsg(message); - return r; + public static ResultVO error(Integer code, String msg) { + ResultVO resultVO = new ResultVO(); + resultVO.setCode(code); + resultVO.setMsg(msg); + return resultVO; + } + + public static ResultVO error(ApiException exception) { + ResultVO resultVO = new ResultVO(); + resultVO.setCode(exception.getCode()); + resultVO.setMsg(exception.getMessage()); + return resultVO; } } diff --git a/beancon-api/src/test/java/com/mashibing/api/filter/CheckFilterContextTest.java b/beancon-api/src/test/java/com/mashibing/api/filter/CheckFilterContextTest.java index c51c18e..8f3940d 100644 --- a/beancon-api/src/test/java/com/mashibing/api/filter/CheckFilterContextTest.java +++ b/beancon-api/src/test/java/com/mashibing/api/filter/CheckFilterContextTest.java @@ -1,5 +1,6 @@ package com.mashibing.api.filter; +import com.mashibing.common.model.StandardSubmit; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; @@ -20,6 +21,6 @@ public class CheckFilterContextTest { @org.junit.Test public void check() { Object obj = new Object(); - checkFilterContext.check(obj); + checkFilterContext.check(new StandardSubmit()); } } \ No newline at end of file