新疆后端项目

This commit is contained in:
DESKTOP-BLB5287\FP
2025-06-30 14:31:09 +08:00
commit 0e52aff1f1
2596 changed files with 261030 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>health-im</artifactId>
<groupId>com.renkang</groupId>
<version>2.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>health-im-api</artifactId>
<dependencies>
<!-- feign -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<!-- 控制openfeign中bcpkix依赖的版本 -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk18on</artifactId>
</dependency>
<!-- sentinel限流熔断降级-->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<dependency>
<groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-boot-base-core</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,34 @@
package com.renkang.im;
public enum ImSendEnum {
TIMTextElem("1", "TIMTextElem", "文本消息元素"),
TIMLocationElem("2", "TIMLocationElem", "地理位置消息元素"),
TIMFaceElem("3", "TIMFaceElem", "表情消息元素"),
TIMCustomElem("4", "TIMCustomElem", "自定义消息元素"),
TIMSoundElem("5", "TIMSoundElem", "语音消息元素"),
TIMImageElem("6", "TIMImageElem", "图像消息元素"),
TIMFileElem("7", "TIMFileElem", "文件消息元素"),
TIMVideoFileElem("8", "TIMVideoFileElem", "视频消息元素");
private String type;
private String value;
private String desc;
ImSendEnum(String type, String value, String desc) {
this.type = type;
this.value = value;
this.desc = desc;
}
public String getType() {
return type;
}
public String getValue() {
return value;
}
public String getDesc() {
return desc;
}
}
@@ -0,0 +1,70 @@
package com.renkang.im.api;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.renkang.im.api.fallback.IMHelloFallback;
import com.renkang.im.entity.*;
import org.jeecg.common.api.vo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
@FeignClient(
value = "health-im",
url = "${renkang.service-url.im:}",
fallbackFactory = IMHelloFallback.class
)
public interface IMHelloApi {
/**
* im hello 微服务接口
*
* @param
* @return
*/
@GetMapping(value = "/im/hello")
String callHello();
@GetMapping(value = "/wnapp/getMessageAndroid")
Result<List> getMessageAndroid(@RequestParam("groupId") String groupId);
@GetMapping(value = "/imMsgRecordAll/queryTimeDifferenz")
Result<List<Map<Object, Object>>> queryTimeDifferenz(@RequestParam(name = "groupId") String groupId);
@GetMapping(value = "/wnapp/sendSysMsg")
IMBaseDO sendSysMsg(@RequestParam("groupId") String groupId, @RequestParam("msgContent") String msgContent);
@PostMapping(value = "/wnapp/sendGroupMsg")
IMGroupMsgResDO sendGroupMsg(@RequestBody @Validated ImGroupMsgTextReqDO imGroupMsgTextReqDO);
@PostMapping(value = "/wnapp/sendGroupMsgTextNew")
IMGroupMsgResDO sendGroupMsgTextNew(@RequestBody @Validated ImGroupMsgTextReqDO imGroupMsgTextReqDO);
@PostMapping(value = "/wnapp/accountReg")
Result<String> accountReg(@RequestBody ConSessionRequestDO conSessionRequestDO);
@GetMapping(value = "/wnapp/sendGroupNotifyToUser")
IMBaseDO sendGroupNotifyToUser(@RequestParam("groupId") String groupId, @RequestParam("userIds") List<String> userIds, @RequestParam("msgContent") String msgContent);
@PostMapping(value = "/wnapp/creatGroupMagNew")
Result<Map<String, Object>> creatGroupMagNew(@RequestBody ConSessionRequestDO conSessionRequestDO);
@PostMapping(value = "/wnapp/creatGroupMagNewHelper")
Result<Map<String, Object>> creatGroupMagNewHelper(@RequestBody ConSessionRequestDO conSessionRequestDO);
@GetMapping(value = "/txImMessage/selectImMessageList")
Result<List<ImMsgRecordAll>> selectImMessageList(@RequestParam("sessionId") String sessionId);
@GetMapping(value = "/txImMessage/selectImMessagePageList")
Result<Page<ImMsgRecordAll>> selectImMessagePageList(@RequestParam("groupId") String groupId,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);
}
@@ -0,0 +1,24 @@
package com.renkang.im.api.fallback;
import com.renkang.im.api.IMHelloApi;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
/**
* @author JeecgBoot
*/
@Slf4j
@Component
public class IMHelloFallback implements FallbackFactory<IMHelloApi> {
@Setter
private Throwable cause;
@Override
public IMHelloApi create(Throwable throwable) {
log.error("微服务接口调用失败: {}", cause);
return null;
}
}
@@ -0,0 +1,14 @@
package com.renkang.im.entity;
import lombok.Data;
import org.jeecg.common.system.vo.LoginUserNew;
import java.util.List;
@Data
public class ConSessionRequestDO {
private String name;
private String userId;
private List<LoginUserNew> accountList;
}
@@ -0,0 +1,23 @@
package com.renkang.im.entity;
import lombok.Data;
import java.io.Serializable;
@Data
public class IMBaseDO implements Serializable {
/**
* 请求处理的结果,OK 表示处理成功,FAIL 表示失败
*/
private String ActionStatus;//
/**
* 错误码,0表示成功,非0表示失败
*/
private Integer ErrorCode; //
/**
* 错误信息
*/
private String ErrorInfo;
}
@@ -0,0 +1,25 @@
package com.renkang.im.entity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
/**
* 接收IM消息响应 DO
*
* @author SiZhanXiang
* @date 2021/06/09
*/
@Data
@ToString
@EqualsAndHashCode(callSuper = false)
public class IMGroupMsgResDO extends IMBaseDO {
//消息发送的时间戳,对应后台 server 时间
private Integer MsgTime;
//消息序列号,唯一标示一条消息
private Integer MsgSeq;
private String MsgKey;
}
@@ -0,0 +1,17 @@
package com.renkang.im.entity;
import lombok.Data;
/**
* @Description: IM 测试demo
* @Author: JeecgBoot
* @Date: 2022-04-25
* @Version:V1.0
*/
@Data
public class IMHelloEntity {
}
@@ -0,0 +1,28 @@
package com.renkang.im.entity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* 发送IM消息请求 DO
*
* @author SiZhanXiang
* @date 2021/06/09
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ImGroupMsgTextReqDO implements Serializable {
@Schema(title = "群组id")
private String groupId;
@Schema(title = "发送方用户id")
private String fromUserId;
@Schema(title = "发送的数据")
private String content;
}
@@ -0,0 +1,91 @@
package com.renkang.im.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @author Jiang Shunzhi
*/
/**
* 群组消息同步表
*/
@Schema(description = "群组消息同步表")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "im_group_sync_record")
public class ImGroupSyncRecord implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(value = "id", type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
/**
* 群组ID
*/
@TableField(value = "group_id")
@Schema(description = "群组ID")
private String groupId;
/**
* 获取到消息数量
*/
@TableField(value = "fetch_msg_count")
@Schema(description = "获取到消息数量")
private Integer fetchMsgCount;
/**
* 已存在消息数量
*/
@TableField(value = "exist_msg_count")
@Schema(description = "已存在消息数量")
private Integer existMsgCount;
/**
* 新同步消息数量
*/
@TableField(value = "sync_msg_count")
@Schema(description = "新同步消息数量")
private Integer syncMsgCount;
/**
* 同步状态 0-未开始 1-正在同步 2-同步结束 3-同步错误
*/
@TableField(value = "sync_status")
@Schema(description = "同步状态 0-未开始 1-正在同步 2-同步结束 3-同步错误")
private Integer syncStatus;
/**
* 错误信息
*/
@TableField(value = "error_msg")
@Schema(description = "错误信息")
private String errorMsg;
/**
* 开始时间
*/
@TableField(value = "start_time")
@Schema(description = "开始时间")
private Date startTime;
/**
* 结束时间
*/
@TableField(value = "end_time")
@Schema(description = "结束时间")
private Date endTime;
/**
* 创建时间
*/
@TableField(value = "create_time")
@Schema(description = "创建时间")
private Date createTime;
}
@@ -0,0 +1,118 @@
package com.renkang.im.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @Description: im_msg_record_all
* @Author: jeecg-boot
* @Date: 2023-05-15
* @Version: V1.0
*/
@Data
@TableName("im_msg_record_all")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(title = "im_msg_record_all对象", description = "im_msg_record_all")
@JsonIgnoreProperties(ignoreUnknown = true)
public class ImMsgRecordAll implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(title = "id")
private String id;
/**
* 群组ID
*/
@Excel(name = "群组ID", width = 15)
@Schema(title = "群组ID")
private String groupid;
/**
* 发送者账号
*/
@Excel(name = "发送者账号", width = 15)
@Schema(title = "发送者账号")
private String fromAccount;
/**
* 接受者账号
*/
@Excel(name = "接受者账号", width = 15)
@Schema(title = "接受者账号")
private String toAccount;
/**
* 发送时间
*/
@Excel(name = "发送时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(title = "发送时间")
private Date sendtime;
/**
* 消息类型 1单聊 2群聊
*/
@Excel(name = "消息类型 1单聊 2群聊", width = 15)
@Schema(title = "消息类型 1单聊 2群聊")
private String msgtype;
/**
* 消息内容
*/
@Excel(name = "消息内容", width = 15)
@Schema(title = "消息内容")
private String msgcontent;
/**
* 消息元素类别;目前支持的消息对象包括:TIMTextElem(文本消息)TIMLocationElem(位置消息)TIMFaceElem(表情消息)TIMCustomElem(自定义消息)TIMSoundElem(语音消息)TIMImageElem(图像消息)TIMFileElem(文件消息)TIMVideoFileElem(视频消息)
*/
@Excel(name = "消息元素类别;目前支持的消息对象包括:TIMTextElem(文本消息)TIMLocationElem(位置消息)TIMFaceElem(表情消息)TIMCustomElem(自定义消息)TIMSoundElem(语音消息)TIMImageElem(图像消息)TIMFileElem(文件消息)TIMVideoFileElem(视频消息)", width = 15)
@Schema(title = "消息元素类别;目前支持的消息对象包括:TIMTextElem(文本消息)TIMLocationElem(位置消息)TIMFaceElem(表情消息)TIMCustomElem(自定义消息)TIMSoundElem(语音消息)TIMImageElem(图像消息)TIMFileElem(文件消息)TIMVideoFileElem(视频消息)")
private String contenttype;
/**
* 消息序列
*/
@Excel(name = "消息序列", width = 15)
@Schema(title = "消息序列")
private Integer msgseq;
/**
* 结束时间
*/
@Excel(name = "通话结束时间", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(title = "通话结束时间")
private Date endTime;
@Schema(title = "通话结束时间")
private Date createTime;
@TableField(exist = false)
@Schema(title = "通话结束时间")
private String fromAccountName;
@TableField(exist = false)
@Schema(title = "通话结束时间")
private String toAccountName;
@TableField(exist = false)
@Schema(title = "状态")
private String contentStatus;
@TableField(exist = false)
@Schema(title = "头像")
private String fromAccountHead;
}
@@ -0,0 +1,12 @@
package com.renkang.im.entity;
import lombok.Data;
@Data
public class SystemMessageD0 {
private String GroupId;
private String Content;
}
@@ -0,0 +1,8 @@
package com.renkang.im.vo;
import lombok.Data;
@Data
public class IMHelloPage {
}