Compare commits
5 Commits
68d7e59a34
...
58c5cd258c
Author | SHA1 | Date |
---|---|---|
|
58c5cd258c | 4 months ago |
|
54949890b6 | 4 months ago |
|
e4153bb349 | 4 months ago |
|
c9f0f0b30a | 4 months ago |
|
42257bfc83 | 4 months ago |
@ -0,0 +1,24 @@
|
||||
package com.mashibing.api.adcvice;
|
||||
|
||||
import com.mashibing.common.exception.ApiException;
|
||||
import com.mashibing.common.pojo.JsonResult;
|
||||
import com.mashibing.common.utils.JsonResultUtil;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
|
||||
/**
|
||||
* @author heqijun
|
||||
* @ClassName: ApiExceptionHandler
|
||||
* @Description: TODO(这里用一句话描述这个类的作用)
|
||||
* @date 2025/6/6 16:44
|
||||
*/
|
||||
|
||||
@RestControllerAdvice
|
||||
public class ApiExceptionHandler {
|
||||
|
||||
@ExceptionHandler(ApiException.class)
|
||||
public JsonResult handleApiException(ApiException e) {
|
||||
return JsonResultUtil.error(e.getCode(), e.getMessage());
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
package com.mashibing.api.feignClient;
|
||||
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author heqijun
|
||||
* @ClassName: BeaconCacheClient
|
||||
* @Description: TODO(这里用一句话描述这个类的作用)
|
||||
* @date 2025/6/5 20:13
|
||||
*/
|
||||
|
||||
@FeignClient("beacon-cache")
|
||||
@RequestMapping("cache")
|
||||
public interface BeaconCacheClient {
|
||||
@GetMapping("get/{key}")
|
||||
public String get(@PathVariable String key);
|
||||
|
||||
@GetMapping("set/{key}/{value}")
|
||||
public void set(@PathVariable String key, @PathVariable String value);
|
||||
|
||||
@GetMapping("hget/{key}")
|
||||
public Map hget(@PathVariable String key);
|
||||
|
||||
@PostMapping("hset/{key}")
|
||||
public void hset(@PathVariable String key, @RequestBody Map hash);
|
||||
|
||||
@PostMapping("/sadd/{key}")
|
||||
public void sadd(@PathVariable(value = "key") String key, @RequestBody Map<String, Object>... maps);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.mashibing.api.feignClient;
|
||||
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author heqijun
|
||||
* @ClassName: BeaconCacheClient
|
||||
* @Description: 缓存模块openFeignClient接口
|
||||
* @date 2025/6/5 20:13
|
||||
*/
|
||||
|
||||
@FeignClient("beacon-cache")
|
||||
@RequestMapping("cache")
|
||||
public interface CacheClient {
|
||||
@GetMapping("get/{key}")
|
||||
String get(@PathVariable String key);
|
||||
|
||||
@GetMapping("set/{key}/{value}")
|
||||
void set(@PathVariable String key, @PathVariable String value);
|
||||
|
||||
@GetMapping("hget/{key}")
|
||||
Map hget(@PathVariable String key);
|
||||
|
||||
@GetMapping("/hget/{key}/{field}")
|
||||
Object hget(@PathVariable(value = "key") String key, @PathVariable(value = "field") String field);
|
||||
|
||||
@GetMapping("/hgetString/{key}/{field}")
|
||||
String hgetString(@PathVariable(value = "key") String key, @PathVariable(value = "field") String field);
|
||||
|
||||
@PostMapping("hset/{key}")
|
||||
void hset(@PathVariable String key, @RequestBody Map hash);
|
||||
|
||||
@PostMapping("/sadd/{key}")
|
||||
void sadd(@PathVariable(value = "key") String key, @RequestBody Map<String, Object>... maps);
|
||||
|
||||
@PostMapping("/smember/{key}")
|
||||
Set<Map> smember(@PathVariable(value = "key") String key);
|
||||
}
|
@ -0,0 +1,129 @@
|
||||
package com.mashibing.common.entity;
|
||||
|
||||
import lombok.ToString;
|
||||
|
||||
@ToString
|
||||
public class ClientBalance {
|
||||
|
||||
private long id;
|
||||
private long clientId;
|
||||
private long balance;
|
||||
private java.sql.Timestamp created;
|
||||
private long createId;
|
||||
private java.sql.Timestamp updated;
|
||||
private long updateId;
|
||||
private long isDelete;
|
||||
private String extend1;
|
||||
private String extend2;
|
||||
private String extend3;
|
||||
private String extend4;
|
||||
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public long getClientId() {
|
||||
return clientId;
|
||||
}
|
||||
|
||||
public void setClientId(long clientId) {
|
||||
this.clientId = clientId;
|
||||
}
|
||||
|
||||
|
||||
public long getBalance() {
|
||||
return balance;
|
||||
}
|
||||
|
||||
public void setBalance(long balance) {
|
||||
this.balance = balance;
|
||||
}
|
||||
|
||||
|
||||
public java.sql.Timestamp getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setCreated(java.sql.Timestamp created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
|
||||
public long getCreateId() {
|
||||
return createId;
|
||||
}
|
||||
|
||||
public void setCreateId(long createId) {
|
||||
this.createId = createId;
|
||||
}
|
||||
|
||||
|
||||
public java.sql.Timestamp getUpdated() {
|
||||
return updated;
|
||||
}
|
||||
|
||||
public void setUpdated(java.sql.Timestamp updated) {
|
||||
this.updated = updated;
|
||||
}
|
||||
|
||||
|
||||
public long getUpdateId() {
|
||||
return updateId;
|
||||
}
|
||||
|
||||
public void setUpdateId(long updateId) {
|
||||
this.updateId = updateId;
|
||||
}
|
||||
|
||||
|
||||
public long getIsDelete() {
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(long isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
|
||||
public String getExtend1() {
|
||||
return extend1;
|
||||
}
|
||||
|
||||
public void setExtend1(String extend1) {
|
||||
this.extend1 = extend1;
|
||||
}
|
||||
|
||||
|
||||
public String getExtend2() {
|
||||
return extend2;
|
||||
}
|
||||
|
||||
public void setExtend2(String extend2) {
|
||||
this.extend2 = extend2;
|
||||
}
|
||||
|
||||
|
||||
public String getExtend3() {
|
||||
return extend3;
|
||||
}
|
||||
|
||||
public void setExtend3(String extend3) {
|
||||
this.extend3 = extend3;
|
||||
}
|
||||
|
||||
|
||||
public String getExtend4() {
|
||||
return extend4;
|
||||
}
|
||||
|
||||
public void setExtend4(String extend4) {
|
||||
this.extend4 = extend4;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,188 @@
|
||||
package com.mashibing.common.entity;
|
||||
|
||||
import lombok.ToString;
|
||||
|
||||
@ToString
|
||||
public class ClientBusiness {
|
||||
|
||||
private long id;
|
||||
|
||||
private String corpname;
|
||||
|
||||
private String apikey;
|
||||
|
||||
private String ipAddress;
|
||||
|
||||
private long isCallback;
|
||||
|
||||
private String callbackUrl;
|
||||
|
||||
private String clientLinkname;
|
||||
|
||||
private String clientPhone;
|
||||
|
||||
private String clientFilters;
|
||||
|
||||
private java.sql.Timestamp created;
|
||||
|
||||
private long createId;
|
||||
|
||||
private java.sql.Timestamp updated;
|
||||
|
||||
private long updateId;
|
||||
|
||||
private long isDelete;
|
||||
|
||||
private String extend1;
|
||||
|
||||
private String extend2;
|
||||
|
||||
private String extend3;
|
||||
|
||||
private String extend4;
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getCorpname() {
|
||||
return corpname;
|
||||
}
|
||||
|
||||
public void setCorpname(String corpname) {
|
||||
this.corpname = corpname;
|
||||
}
|
||||
|
||||
public String getApikey() {
|
||||
return apikey;
|
||||
}
|
||||
|
||||
public void setApikey(String apikey) {
|
||||
this.apikey = apikey;
|
||||
}
|
||||
|
||||
public String getIpAddress() {
|
||||
return ipAddress;
|
||||
}
|
||||
|
||||
public void setIpAddress(String ipAddress) {
|
||||
this.ipAddress = ipAddress;
|
||||
}
|
||||
|
||||
public long getIsCallback() {
|
||||
return isCallback;
|
||||
}
|
||||
|
||||
public void setIsCallback(long isCallback) {
|
||||
this.isCallback = isCallback;
|
||||
}
|
||||
|
||||
public String getCallbackUrl() {
|
||||
return callbackUrl;
|
||||
}
|
||||
|
||||
public void setCallbackUrl(String callbackUrl) {
|
||||
this.callbackUrl = callbackUrl;
|
||||
}
|
||||
|
||||
public String getClientLinkname() {
|
||||
return clientLinkname;
|
||||
}
|
||||
|
||||
public void setClientLinkname(String clientLinkname) {
|
||||
this.clientLinkname = clientLinkname;
|
||||
}
|
||||
|
||||
public String getClientPhone() {
|
||||
return clientPhone;
|
||||
}
|
||||
|
||||
public void setClientPhone(String clientPhone) {
|
||||
this.clientPhone = clientPhone;
|
||||
}
|
||||
|
||||
public String getClientFilters() {
|
||||
return clientFilters;
|
||||
}
|
||||
|
||||
public void setClientFilters(String clientFilters) {
|
||||
this.clientFilters = clientFilters;
|
||||
}
|
||||
|
||||
public java.sql.Timestamp getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setCreated(java.sql.Timestamp created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
public long getCreateId() {
|
||||
return createId;
|
||||
}
|
||||
|
||||
public void setCreateId(long createId) {
|
||||
this.createId = createId;
|
||||
}
|
||||
|
||||
public java.sql.Timestamp getUpdated() {
|
||||
return updated;
|
||||
}
|
||||
|
||||
public void setUpdated(java.sql.Timestamp updated) {
|
||||
this.updated = updated;
|
||||
}
|
||||
|
||||
public long getUpdateId() {
|
||||
return updateId;
|
||||
}
|
||||
|
||||
public void setUpdateId(long updateId) {
|
||||
this.updateId = updateId;
|
||||
}
|
||||
|
||||
public long getIsDelete() {
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(long isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public String getExtend1() {
|
||||
return extend1;
|
||||
}
|
||||
|
||||
public void setExtend1(String extend1) {
|
||||
this.extend1 = extend1;
|
||||
}
|
||||
|
||||
public String getExtend2() {
|
||||
return extend2;
|
||||
}
|
||||
|
||||
public void setExtend2(String extend2) {
|
||||
this.extend2 = extend2;
|
||||
}
|
||||
|
||||
public String getExtend3() {
|
||||
return extend3;
|
||||
}
|
||||
|
||||
public void setExtend3(String extend3) {
|
||||
this.extend3 = extend3;
|
||||
}
|
||||
|
||||
public String getExtend4() {
|
||||
return extend4;
|
||||
}
|
||||
|
||||
public void setExtend4(String extend4) {
|
||||
this.extend4 = extend4;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,178 @@
|
||||
package com.mashibing.common.entity;
|
||||
|
||||
import lombok.ToString;
|
||||
|
||||
@ToString
|
||||
public class ClientSign {
|
||||
|
||||
private long id;
|
||||
|
||||
private long clientId;
|
||||
|
||||
private String signInfo;
|
||||
|
||||
private long signState;
|
||||
|
||||
private long signType;
|
||||
|
||||
private String businessWeb;
|
||||
|
||||
private String proveDescr;
|
||||
|
||||
private String proveFile;
|
||||
|
||||
private java.sql.Timestamp created;
|
||||
|
||||
private long createId;
|
||||
|
||||
private java.sql.Timestamp updated;
|
||||
|
||||
private long updateId;
|
||||
|
||||
private long isDelete;
|
||||
|
||||
private String extend1;
|
||||
|
||||
private String extend2;
|
||||
|
||||
private String extend3;
|
||||
|
||||
private String extend4;
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public long getClientId() {
|
||||
return clientId;
|
||||
}
|
||||
|
||||
public void setClientId(long clientId) {
|
||||
this.clientId = clientId;
|
||||
}
|
||||
|
||||
public String getSignInfo() {
|
||||
return signInfo;
|
||||
}
|
||||
|
||||
public void setSignInfo(String signInfo) {
|
||||
this.signInfo = signInfo;
|
||||
}
|
||||
|
||||
public long getSignState() {
|
||||
return signState;
|
||||
}
|
||||
|
||||
public void setSignState(long signState) {
|
||||
this.signState = signState;
|
||||
}
|
||||
|
||||
public long getSignType() {
|
||||
return signType;
|
||||
}
|
||||
|
||||
public void setSignType(long signType) {
|
||||
this.signType = signType;
|
||||
}
|
||||
|
||||
public String getBusinessWeb() {
|
||||
return businessWeb;
|
||||
}
|
||||
|
||||
public void setBusinessWeb(String businessWeb) {
|
||||
this.businessWeb = businessWeb;
|
||||
}
|
||||
|
||||
public String getProveDescr() {
|
||||
return proveDescr;
|
||||
}
|
||||
|
||||
public void setProveDescr(String proveDescr) {
|
||||
this.proveDescr = proveDescr;
|
||||
}
|
||||
|
||||
public String getProveFile() {
|
||||
return proveFile;
|
||||
}
|
||||
|
||||
public void setProveFile(String proveFile) {
|
||||
this.proveFile = proveFile;
|
||||
}
|
||||
|
||||
public java.sql.Timestamp getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setCreated(java.sql.Timestamp created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
public long getCreateId() {
|
||||
return createId;
|
||||
}
|
||||
|
||||
public void setCreateId(long createId) {
|
||||
this.createId = createId;
|
||||
}
|
||||
|
||||
public java.sql.Timestamp getUpdated() {
|
||||
return updated;
|
||||
}
|
||||
|
||||
public void setUpdated(java.sql.Timestamp updated) {
|
||||
this.updated = updated;
|
||||
}
|
||||
|
||||
public long getUpdateId() {
|
||||
return updateId;
|
||||
}
|
||||
|
||||
public void setUpdateId(long updateId) {
|
||||
this.updateId = updateId;
|
||||
}
|
||||
|
||||
public long getIsDelete() {
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(long isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public String getExtend1() {
|
||||
return extend1;
|
||||
}
|
||||
|
||||
public void setExtend1(String extend1) {
|
||||
this.extend1 = extend1;
|
||||
}
|
||||
|
||||
public String getExtend2() {
|
||||
return extend2;
|
||||
}
|
||||
|
||||
public void setExtend2(String extend2) {
|
||||
this.extend2 = extend2;
|
||||
}
|
||||
|
||||
public String getExtend3() {
|
||||
return extend3;
|
||||
}
|
||||
|
||||
public void setExtend3(String extend3) {
|
||||
this.extend3 = extend3;
|
||||
}
|
||||
|
||||
public String getExtend4() {
|
||||
return extend4;
|
||||
}
|
||||
|
||||
public void setExtend4(String extend4) {
|
||||
this.extend4 = extend4;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,169 @@
|
||||
package com.mashibing.common.entity;
|
||||
|
||||
import lombok.ToString;
|
||||
|
||||
@ToString
|
||||
public class ClientTemplate {
|
||||
|
||||
private long id;
|
||||
private long signId;
|
||||
private String templateText;
|
||||
private long templateType;
|
||||
private long templateState;
|
||||
private long useId;
|
||||
private String useWeb;
|
||||
private java.sql.Timestamp created;
|
||||
private long createId;
|
||||
private java.sql.Timestamp updated;
|
||||
private long updateId;
|
||||
private long isDelete;
|
||||
private String extend1;
|
||||
private String extend2;
|
||||
private String extend3;
|
||||
private String extend4;
|
||||
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public long getSignId() {
|
||||
return signId;
|
||||
}
|
||||
|
||||
public void setSignId(long signId) {
|
||||
this.signId = signId;
|
||||
}
|
||||
|
||||
|
||||
public String getTemplateText() {
|
||||
return templateText;
|
||||
}
|
||||
|
||||
public void setTemplateText(String templateText) {
|
||||
this.templateText = templateText;
|
||||
}
|
||||
|
||||
|
||||
public long getTemplateType() {
|
||||
return templateType;
|
||||
}
|
||||
|
||||
public void setTemplateType(long templateType) {
|
||||
this.templateType = templateType;
|
||||
}
|
||||
|
||||
|
||||
public long getTemplateState() {
|
||||
return templateState;
|
||||
}
|
||||
|
||||
public void setTemplateState(long templateState) {
|
||||
this.templateState = templateState;
|
||||
}
|
||||
|
||||
|
||||
public long getUseId() {
|
||||
return useId;
|
||||
}
|
||||
|
||||
public void setUseId(long useId) {
|
||||
this.useId = useId;
|
||||
}
|
||||
|
||||
|
||||
public String getUseWeb() {
|
||||
return useWeb;
|
||||
}
|
||||
|
||||
public void setUseWeb(String useWeb) {
|
||||
this.useWeb = useWeb;
|
||||
}
|
||||
|
||||
|
||||
public java.sql.Timestamp getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setCreated(java.sql.Timestamp created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
|
||||
public long getCreateId() {
|
||||
return createId;
|
||||
}
|
||||
|
||||
public void setCreateId(long createId) {
|
||||
this.createId = createId;
|
||||
}
|
||||
|
||||
|
||||
public java.sql.Timestamp getUpdated() {
|
||||
return updated;
|
||||
}
|
||||
|
||||
public void setUpdated(java.sql.Timestamp updated) {
|
||||
this.updated = updated;
|
||||
}
|
||||
|
||||
|
||||
public long getUpdateId() {
|
||||
return updateId;
|
||||
}
|
||||
|
||||
public void setUpdateId(long updateId) {
|
||||
this.updateId = updateId;
|
||||
}
|
||||
|
||||
|
||||
public long getIsDelete() {
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(long isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
|
||||
public String getExtend1() {
|
||||
return extend1;
|
||||
}
|
||||
|
||||
public void setExtend1(String extend1) {
|
||||
this.extend1 = extend1;
|
||||
}
|
||||
|
||||
|
||||
public String getExtend2() {
|
||||
return extend2;
|
||||
}
|
||||
|
||||
public void setExtend2(String extend2) {
|
||||
this.extend2 = extend2;
|
||||
}
|
||||
|
||||
|
||||
public String getExtend3() {
|
||||
return extend3;
|
||||
}
|
||||
|
||||
public void setExtend3(String extend3) {
|
||||
this.extend3 = extend3;
|
||||
}
|
||||
|
||||
|
||||
public String getExtend4() {
|
||||
return extend4;
|
||||
}
|
||||
|
||||
public void setExtend4(String extend4) {
|
||||
this.extend4 = extend4;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.mashibing.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author heqijun
|
||||
* @ClassName: ExecptionEnums
|
||||
* @Description: TODO(这里用一句话描述这个类的作用)
|
||||
* @date 2025/6/6 16:12
|
||||
*/
|
||||
|
||||
@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, "手客户余额不足"),
|
||||
;
|
||||
|
||||
private int code;
|
||||
|
||||
private String msg;
|
||||
|
||||
ExceptionEnums(int code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.mashibing.common.exception;
|
||||
|
||||
import com.mashibing.common.enums.ExceptionEnums;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author heqijun
|
||||
* @ClassName: APIException
|
||||
* @Description: TODO(这里用一句话描述这个类的作用)
|
||||
* @date 2025/6/6 16:09
|
||||
*/
|
||||
|
||||
@Getter
|
||||
public class ApiException extends RuntimeException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final Integer code;
|
||||
|
||||
public ApiException(Integer code, String message) {
|
||||
super(message);
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public ApiException(ExceptionEnums exceptionEnums) {
|
||||
super(exceptionEnums.getMsg());
|
||||
this.code = exceptionEnums.getCode();
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in new issue