Compare commits
No commits in common. '615c0558d905191d5c6f928e6dd6dcd7007a5fc8' and 'b198ad115ca28e53b66586af6dac94f6945047d4' have entirely different histories.
615c0558d9
...
b198ad115c
@ -1,2 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="JAVA_MODULE" version="4" />
|
|
@ -1,10 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="Encoding">
|
<component name="Encoding">
|
||||||
|
<file url="file://$PROJECT_DIR$/beacon-api/beacon-common/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/beacon-api/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/beacon-api/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/beacon-api/src/main/resources" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/beacon-api/src/main/resources" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/beacon-cache/src/main/java" charset="UTF-8" />
|
|
||||||
<file url="file://$PROJECT_DIR$/beacon-common/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/beacon-common/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/beacon-test/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
@ -1,24 +0,0 @@
|
|||||||
package com.mashibing.api.advice;
|
|
||||||
|
|
||||||
import com.mashibing.api.util.R;
|
|
||||||
import com.mashibing.api.vo.ResultVO;
|
|
||||||
import com.mashibing.common.exception.ApiException;
|
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author dch
|
|
||||||
* @create 2024-03-20 17:10
|
|
||||||
*/
|
|
||||||
|
|
||||||
@RestControllerAdvice
|
|
||||||
public class ApiExceptionHandler {
|
|
||||||
|
|
||||||
@ExceptionHandler(ApiException.class)
|
|
||||||
public ResultVO apiException(ApiException ex){
|
|
||||||
return R.error(ex);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,19 +1,12 @@
|
|||||||
package com.mashibing.api.client;
|
package com.mashibing.api.client;
|
||||||
|
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
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 dch
|
* @author dch
|
||||||
* @create 2024-03-20 11:54
|
* @create 2024-03-19 23:56
|
||||||
*/
|
*/
|
||||||
@FeignClient("beacon-cache")
|
@FeignClient(value="beacon-cache")
|
||||||
public interface BeaconCacheClient {
|
public class BeaconCacheClient {
|
||||||
|
|
||||||
@GetMapping("/cache/hgetall/{key}")
|
|
||||||
Map hGetAll(@PathVariable(value = "key")String key);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.mashibing.api.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author dch
|
||||||
|
* @create 2024-03-19 0:24
|
||||||
|
* * 一些响应信息中code和msg的对应
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum SmsCodeEnum {
|
||||||
|
PARAMETER_ERROR(-10, "参数不合法!");
|
||||||
|
|
||||||
|
private Integer code;
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
SmsCodeEnum(Integer code, String msg) {
|
||||||
|
this.code = code;
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
}
|
@ -1,12 +1,10 @@
|
|||||||
package com.mashibing.api.filter;
|
package com.mashibing.api.filter;
|
||||||
|
|
||||||
import com.mashibing.common.model.StandardSubmit;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author dch
|
* @author dch
|
||||||
* @create 2024-03-18 23:18
|
* @create 2024-03-18 23:18
|
||||||
*/
|
*/
|
||||||
public interface CheckFilter {
|
public interface CheckFilter {
|
||||||
|
|
||||||
void check(StandardSubmit submit);
|
void check(Object obj);
|
||||||
}
|
}
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
package com.mashibing.common.constant;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author dch
|
|
||||||
* @create 2024-03-20 12:05
|
|
||||||
*/
|
|
||||||
public interface CacheConstant {
|
|
||||||
|
|
||||||
String CLIENT_BUSINESS = "client_business:";
|
|
||||||
|
|
||||||
String CLIENT_SIGN = "client_sign:";
|
|
||||||
|
|
||||||
String CLIENT_TEMPLATE = "client_template:";
|
|
||||||
|
|
||||||
String CLIENT_BALANCE = "client_balance:";
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
package com.mashibing.common.enums;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author dch
|
|
||||||
* @create 2024-03-20 12:17
|
|
||||||
*/
|
|
||||||
@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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
package com.mashibing.common.exception;
|
|
||||||
|
|
||||||
import com.mashibing.common.enums.ExceptionEnums;
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author dch
|
|
||||||
* @create 2024-03-20 12:15
|
|
||||||
*/
|
|
||||||
@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();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in new issue