短信服务集成

This commit is contained in:
xy
2026-04-21 16:10:01 +08:00
parent 353a4cc83b
commit fed766bca4
39 changed files with 1325 additions and 37 deletions

View File

@@ -0,0 +1,24 @@
package com.njcn.cssystem.api;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.cssystem.api.fallback.AppMsgSetFeignClientFallbackFactory;
import com.njcn.cssystem.api.fallback.FeedBackFeignClientFallbackFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* @author xy
*/
@FeignClient(value = ServerInfo.CS_SYSTEM_BOOT, path = "/appMsgSet", fallbackFactory = AppMsgSetFeignClientFallbackFactory.class,contextId = "appMsgSet")
public interface AppMsgSetFeignClient {
@PostMapping("/queryUserIdsByDeviceId")
@ApiOperation("根据设备ID查询用户列表")
HttpResult<List<String>> queryUserIdsByDeviceId(@RequestParam("deviceId") @Validated String deviceId);
}

View File

@@ -0,0 +1,36 @@
package com.njcn.cssystem.api.fallback;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.cssystem.api.AppMsgSetFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @author xy
*/
@Slf4j
@Component
public class AppMsgSetFeignClientFallbackFactory implements FallbackFactory<AppMsgSetFeignClient> {
@Override
public AppMsgSetFeignClient create(Throwable cause) {
//判断抛出异常是否为解码器抛出的业务异常
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
if (cause.getCause() instanceof BusinessException) {
BusinessException businessException = (BusinessException) cause.getCause();
}
Enum<?> finalExceptionEnum = exceptionEnum;
return new AppMsgSetFeignClient() {
@Override
public HttpResult<List<String>> queryUserIdsByDeviceId(String deviceId) {
log.error("{}异常,降级处理,异常为:{}","根据设备ID查询用户列表数据异常",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -0,0 +1,17 @@
package com.njcn.cssystem.pojo.param;
import lombok.Data;
import java.util.List;
/**
* @author xy
*/
@Data
public class AppMsgSetParam {
private String userId;
private List<String> deviceIds;
}

View File

@@ -28,4 +28,13 @@ public class AppVersionParam implements Serializable {
@NotNull(message = "版本类型不能为空")
private String versionType;
@ApiModelProperty("安卓更新地址")
private String androidPath;
@ApiModelProperty("ios更新地址")
private String iosPath;
@ApiModelProperty("版本ID")
private String id;
}

View File

@@ -0,0 +1,40 @@
package com.njcn.cssystem.pojo.po;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import java.io.Serializable;
import lombok.Getter;
import lombok.Setter;
/**
* <p>
* 设备发送短信配置表
* </p>
*
* @author xy
* @since 2026-04-21
*/
@Getter
@Setter
@TableName("app_msg_set")
public class AppMsgSet implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
private String id;
/**
* 用户ID
*/
private String userId;
/**
* 设备ID
*/
private String deviceId;
}

View File

@@ -53,5 +53,14 @@ public class AppVersion extends BaseEntity implements Serializable {
*/
private String content;
/**
* 安卓更新地址
*/
private String androidPath;
/**
* ios更新地址
*/
private String iosPath;
}

View File

@@ -22,4 +22,10 @@ public class AppVersionVo implements Serializable {
@ApiModelProperty("严重度(0:优化 1:bug调整)")
private Integer sev;
@ApiModelProperty("安卓更新地址")
private String androidPath;
@ApiModelProperty("ios更新地址")
private String iosPath;
}

View File

@@ -30,6 +30,9 @@ public class WlUserVo implements Serializable {
@ApiModelProperty(value = "工程名称")
private String name;
@ApiModelProperty(value = "设备集合")
private List<portableDevVo> devList;
}
@Data