mirror of
https://gitee.com/270580156/weiyu.git
synced 2025-12-30 10:52:26 +00:00
update
This commit is contained in:
BIN
modules/.DS_Store
vendored
BIN
modules/.DS_Store
vendored
Binary file not shown.
BIN
modules/ai/.DS_Store
vendored
BIN
modules/ai/.DS_Store
vendored
Binary file not shown.
BIN
modules/blog/.DS_Store → modules/ai/src/.DS_Store
vendored
BIN
modules/blog/.DS_Store → modules/ai/src/.DS_Store
vendored
Binary file not shown.
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-03-22 16:21:15
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-03-25 12:49:42
|
||||
* @LastEditTime: 2024-05-04 10:56:47
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -15,14 +15,10 @@
|
||||
package com.bytedesk.ai.doc;
|
||||
|
||||
import com.bytedesk.ai.file.KbFile;
|
||||
import com.bytedesk.core.utils.AuditModel;
|
||||
import jakarta.persistence.Column;
|
||||
import com.bytedesk.core.utils.AbstractEntity;
|
||||
import jakarta.persistence.ConstraintMode;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.ForeignKey;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.Lob;
|
||||
import jakarta.persistence.Table;
|
||||
@@ -45,14 +41,12 @@ import lombok.experimental.Accessors;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Table(name = "ai_kb_doc")
|
||||
public class KbDoc extends AuditModel {
|
||||
public class KbDoc extends AbstractEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column(name = "did", unique = true, nullable = false)
|
||||
private String did;
|
||||
// @Column(name = "did", unique = true, nullable = false)
|
||||
// private String did;
|
||||
|
||||
@Lob
|
||||
private String content;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-03-22 17:00:31
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-03-27 17:32:24
|
||||
* @LastEditTime: 2024-05-04 10:55:22
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -27,7 +27,7 @@ import lombok.experimental.Accessors;
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class KbDocRequest extends BaseRequest {
|
||||
|
||||
private String did;
|
||||
// private String did;
|
||||
|
||||
private String meta;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import lombok.ToString;
|
||||
@ToString
|
||||
public class KbDocResponse {
|
||||
|
||||
private String did;
|
||||
// private String did;
|
||||
|
||||
private String content;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-03-22 17:00:07
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-03-26 17:00:57
|
||||
* @LastEditTime: 2024-05-04 10:55:40
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -33,10 +33,17 @@ public class KbDocService {
|
||||
|
||||
public Page<KbDocResponse> query(KbDocRequest kbDocRequest) {
|
||||
|
||||
Pageable pageable = PageRequest.of(kbDocRequest.getPageNumber(), kbDocRequest.getPageSize(), Sort.Direction.DESC,
|
||||
Pageable pageable = PageRequest.of(kbDocRequest.getPageNumber(), kbDocRequest.getPageSize(),
|
||||
Sort.Direction.DESC,
|
||||
"id");
|
||||
|
||||
return null;
|
||||
Page<KbDoc> kbDocPage = kbDocRepository.findAll(pageable);
|
||||
|
||||
return kbDocPage.map(this::convertToDocResponse);
|
||||
}
|
||||
|
||||
public KbDocResponse convertToDocResponse(KbDoc kbDoc) {
|
||||
return modelMapper.map(kbDoc, KbDocResponse.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-03-22 16:23:35
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-03-26 14:01:15
|
||||
* @LastEditTime: 2024-05-04 10:56:57
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -16,17 +16,13 @@ package com.bytedesk.ai.file;
|
||||
|
||||
import com.bytedesk.ai.kb.Kb;
|
||||
import com.bytedesk.core.upload.Upload;
|
||||
import com.bytedesk.core.utils.AuditModel;
|
||||
import com.bytedesk.core.utils.AbstractEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.ConstraintMode;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.FetchType;
|
||||
import jakarta.persistence.ForeignKey;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.Table;
|
||||
@@ -49,14 +45,12 @@ import lombok.experimental.Accessors;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Table(name = "ai_kb_file")
|
||||
public class KbFile extends AuditModel {
|
||||
public class KbFile extends AbstractEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column(name = "fid", unique = true, nullable = false)
|
||||
private String fid;
|
||||
// @Column(name = "fid", unique = true, nullable = false)
|
||||
// private String fid;
|
||||
|
||||
private String loader;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-03-22 16:59:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-03-27 17:30:47
|
||||
* @LastEditTime: 2024-05-04 10:57:04
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -28,7 +28,7 @@ import lombok.experimental.Accessors;
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class KbFileRequest extends BaseRequest {
|
||||
|
||||
private String fid;
|
||||
// private String fid;
|
||||
|
||||
private String loader;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import lombok.ToString;
|
||||
@ToString
|
||||
public class KbFileResponse {
|
||||
|
||||
private String fid;
|
||||
// private String fid;
|
||||
|
||||
private String loader;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-03-22 16:59:15
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-03-27 17:48:53
|
||||
* @LastEditTime: 2024-05-04 10:57:17
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -32,10 +32,17 @@ public class KbFileService {
|
||||
|
||||
public Page<KbFileResponse> query(KbFileRequest kbFileRequest) {
|
||||
|
||||
Pageable pageable = PageRequest.of(kbFileRequest.getPageNumber(), kbFileRequest.getPageSize(), Sort.Direction.DESC,
|
||||
Pageable pageable = PageRequest.of(kbFileRequest.getPageNumber(), kbFileRequest.getPageSize(),
|
||||
Sort.Direction.DESC,
|
||||
"id");
|
||||
|
||||
return null;
|
||||
Page<KbFile> kbFiles = kbFileRepository.findAll(pageable);
|
||||
|
||||
return kbFiles.map(this::convertToKbFileResponse);
|
||||
}
|
||||
|
||||
public KbFileResponse convertToKbFileResponse(KbFile kbFile) {
|
||||
return modelMapper.map(kbFile, KbFileResponse.class);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-03-22 16:13:38
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-03-25 12:48:33
|
||||
* @LastEditTime: 2024-05-04 10:58:05
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -14,12 +14,8 @@
|
||||
*/
|
||||
package com.bytedesk.ai.kb;
|
||||
|
||||
import com.bytedesk.core.utils.AuditModel;
|
||||
import jakarta.persistence.Column;
|
||||
import com.bytedesk.core.utils.AbstractEntity;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -40,14 +36,12 @@ import lombok.experimental.Accessors;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Table(name = "ai_kb")
|
||||
public class Kb extends AuditModel {
|
||||
public class Kb extends AbstractEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column(name = "kid", unique = true, nullable = false)
|
||||
private String kid;
|
||||
// @Column(name = "kid", unique = true, nullable = false)
|
||||
// private String kid;
|
||||
|
||||
private String name;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-03-22 16:46:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-11 12:08:49
|
||||
* @LastEditTime: 2024-05-04 10:58:11
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -39,14 +39,16 @@ public class KbService {
|
||||
|
||||
Pageable pageable = PageRequest.of(kbRequest.getPageNumber(), kbRequest.getPageSize(), Sort.Direction.DESC,
|
||||
"id");
|
||||
|
||||
Page<Kb> kbList = kbRepository.findAll(pageable);
|
||||
//
|
||||
return null;
|
||||
return kbList.map(this::convertToKbResponse);
|
||||
}
|
||||
|
||||
public JsonResult<?> create(KbRequest kbRequest) {
|
||||
|
||||
Kb kb = modelMapper.map(kbRequest, Kb.class);
|
||||
kb.setKid(uidUtils.getCacheSerialUid());
|
||||
kb.setUid(uidUtils.getCacheSerialUid());
|
||||
|
||||
// kb.setUser(authService.getCurrentUser());
|
||||
|
||||
@@ -55,15 +57,19 @@ public class KbService {
|
||||
return JsonResult.success();
|
||||
}
|
||||
|
||||
public KbResponse convertToKbResponse(Kb kb) {
|
||||
return modelMapper.map(kb, KbResponse.class);
|
||||
}
|
||||
|
||||
public Kb getKb(String name) {
|
||||
|
||||
Kb kb = Kb.builder()
|
||||
.kid(uidUtils.getCacheSerialUid())
|
||||
// .kid(uidUtils.getCacheSerialUid())
|
||||
.name(name)
|
||||
.vectorStore("redis")
|
||||
.embeddings("m3e-base")
|
||||
.build();
|
||||
kb.setUid(uidUtils.getCacheSerialUid());
|
||||
|
||||
return kbRepository.save(kb);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-03-25 11:13:28
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-03-25 12:31:52
|
||||
* @LastEditTime: 2024-05-04 10:59:11
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -14,12 +14,9 @@
|
||||
*/
|
||||
package com.bytedesk.ai.llm;
|
||||
|
||||
import com.bytedesk.core.utils.AuditModel;
|
||||
import com.bytedesk.core.utils.AbstractEntity;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -41,14 +38,12 @@ import lombok.experimental.Accessors;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Table(name = "ai_llm")
|
||||
public class Llm extends AuditModel {
|
||||
public class Llm extends AbstractEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column(name = "lid", unique = true, nullable = false)
|
||||
private String lid;
|
||||
// @Column(name = "lid", unique = true, nullable = false)
|
||||
// private String lid;
|
||||
|
||||
//
|
||||
private String name;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-03-25 12:08:16
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-11 12:09:01
|
||||
* @LastEditTime: 2024-05-04 10:59:23
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -36,7 +36,7 @@ public class LlmService {
|
||||
|
||||
public Llm getLlm(String type) {
|
||||
Llm llm = new Llm();
|
||||
llm.setLid(uidUtils.getCacheSerialUid());
|
||||
llm.setUid(uidUtils.getCacheSerialUid());
|
||||
llm.setName("智谱AI");
|
||||
llm.setDescription("对接智谱API");
|
||||
llm.setType(type);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-03-22 16:16:26
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-03-26 16:02:39
|
||||
* @LastEditTime: 2024-05-04 10:59:40
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -17,7 +17,7 @@ package com.bytedesk.ai.robot;
|
||||
import com.bytedesk.ai.kb.Kb;
|
||||
import com.bytedesk.ai.llm.Llm;
|
||||
import com.bytedesk.core.rbac.user.User;
|
||||
import com.bytedesk.core.utils.AuditModel;
|
||||
import com.bytedesk.core.utils.AbstractEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
@@ -25,9 +25,6 @@ import jakarta.persistence.ConstraintMode;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.FetchType;
|
||||
import jakarta.persistence.ForeignKey;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.Table;
|
||||
@@ -51,14 +48,12 @@ import lombok.experimental.Accessors;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Table(name = "ai_robot")
|
||||
public class Robot extends AuditModel {
|
||||
public class Robot extends AbstractEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column(name = "rid", unique = true, nullable = false)
|
||||
private String rid;
|
||||
// @Column(name = "rid", unique = true, nullable = false)
|
||||
// private String rid;
|
||||
|
||||
private String name;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-03-22 16:45:18
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-03-27 17:00:34
|
||||
* @LastEditTime: 2024-05-04 10:59:48
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -14,18 +14,22 @@
|
||||
*/
|
||||
package com.bytedesk.ai.robot;
|
||||
|
||||
import com.bytedesk.core.utils.BaseResponse;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
public class RobotResponse {
|
||||
public class RobotResponse extends BaseResponse {
|
||||
|
||||
private String rid;
|
||||
// private String rid;
|
||||
|
||||
private String name;
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ public class RobotService {
|
||||
Robot robot = modelMapper.map(robotRequest, Robot.class);
|
||||
//
|
||||
String rid = uidUtils.getCacheSerialUid();
|
||||
robot.setRid(rid);
|
||||
robot.setUid(rid);
|
||||
|
||||
robot.setAvatar(AvatarConsts.DEFAULT_AVATAR_URL);
|
||||
robot.setDescription("default robot description");
|
||||
@@ -105,7 +105,7 @@ public class RobotService {
|
||||
//
|
||||
String rid = uidUtils.getCacheSerialUid();
|
||||
Robot robot = Robot.builder()
|
||||
.rid(rid)
|
||||
// .rid(rid)
|
||||
.name("客服机器人")
|
||||
.avatar(AvatarConsts.DEFAULT_AVATAR_URL)
|
||||
.description("客服机器人")
|
||||
@@ -116,6 +116,7 @@ public class RobotService {
|
||||
.kb(kbService.getKb(rid))
|
||||
.user(adminOptional.get())
|
||||
.build();
|
||||
robot.setUid(rid);
|
||||
robotRepository.save(robot);
|
||||
}
|
||||
|
||||
|
||||
33
modules/blog/.gitignore
vendored
33
modules/blog/.gitignore
vendored
@@ -1,33 +0,0 @@
|
||||
HELP.md
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
BIN
modules/blog/.mvn/wrapper/maven-wrapper.jar
vendored
BIN
modules/blog/.mvn/wrapper/maven-wrapper.jar
vendored
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
|
||||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
|
||||
@@ -1,50 +0,0 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '3.2.0'
|
||||
id 'io.spring.dependency-management' version '1.1.4'
|
||||
}
|
||||
|
||||
group = 'com.bytedesk'
|
||||
version = '0.0.1-SNAPSHOT'
|
||||
|
||||
java {
|
||||
sourceCompatibility = '17'
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
//
|
||||
implementation project(':core')
|
||||
//
|
||||
compileOnly 'org.springframework.boot:spring-boot-starter-web'
|
||||
compileOnly 'org.springframework.boot:spring-boot-starter-thymeleaf'
|
||||
//
|
||||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
||||
// implementation 'com.mysql:mysql-connector-j'
|
||||
//
|
||||
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
|
||||
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-validation
|
||||
implementation 'org.springframework.boot:spring-boot-starter-validation'
|
||||
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-rest
|
||||
// https://spring.io/guides/tutorials/react-and-spring-data-rest/
|
||||
implementation 'org.springframework.boot:spring-boot-starter-data-rest'
|
||||
//
|
||||
// for api docs
|
||||
// https://springdoc.org/
|
||||
// https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-starter-webmvc-ui
|
||||
// http://localhost:9003/swagger-ui/index.html
|
||||
// http://localhost:9003/v3/api-docs
|
||||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0'
|
||||
//
|
||||
compileOnly 'org.projectlombok:lombok'
|
||||
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
||||
annotationProcessor 'org.projectlombok:lombok'
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||
}
|
||||
|
||||
tasks.named('test') {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
BIN
modules/blog/gradle/wrapper/gradle-wrapper.jar
vendored
BIN
modules/blog/gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
@@ -1,7 +0,0 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
249
modules/blog/gradlew
vendored
249
modules/blog/gradlew
vendored
@@ -1,249 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
92
modules/blog/gradlew.bat
vendored
92
modules/blog/gradlew.bat
vendored
@@ -1,92 +0,0 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
308
modules/blog/mvnw
vendored
308
modules/blog/mvnw
vendored
@@ -1,308 +0,0 @@
|
||||
#!/bin/sh
|
||||
# ----------------------------------------------------------------------------
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Apache Maven Wrapper startup batch script, version 3.2.0
|
||||
#
|
||||
# Required ENV vars:
|
||||
# ------------------
|
||||
# JAVA_HOME - location of a JDK home dir
|
||||
#
|
||||
# Optional ENV vars
|
||||
# -----------------
|
||||
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
# e.g. to debug Maven itself, use
|
||||
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
if [ -z "$MAVEN_SKIP_RC" ] ; then
|
||||
|
||||
if [ -f /usr/local/etc/mavenrc ] ; then
|
||||
. /usr/local/etc/mavenrc
|
||||
fi
|
||||
|
||||
if [ -f /etc/mavenrc ] ; then
|
||||
. /etc/mavenrc
|
||||
fi
|
||||
|
||||
if [ -f "$HOME/.mavenrc" ] ; then
|
||||
. "$HOME/.mavenrc"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false;
|
||||
darwin=false;
|
||||
mingw=false
|
||||
case "$(uname)" in
|
||||
CYGWIN*) cygwin=true ;;
|
||||
MINGW*) mingw=true;;
|
||||
Darwin*) darwin=true
|
||||
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
||||
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
if [ -x "/usr/libexec/java_home" ]; then
|
||||
JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME
|
||||
else
|
||||
JAVA_HOME="/Library/Java/Home"; export JAVA_HOME
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
if [ -r /etc/gentoo-release ] ; then
|
||||
JAVA_HOME=$(java-config --jre-home)
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||
if $cygwin ; then
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=$(cygpath --unix "$JAVA_HOME")
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=$(cygpath --path --unix "$CLASSPATH")
|
||||
fi
|
||||
|
||||
# For Mingw, ensure paths are in UNIX format before anything is touched
|
||||
if $mingw ; then
|
||||
[ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] &&
|
||||
JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)"
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
javaExecutable="$(which javac)"
|
||||
if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then
|
||||
# readlink(1) is not available as standard on Solaris 10.
|
||||
readLink=$(which readlink)
|
||||
if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then
|
||||
if $darwin ; then
|
||||
javaHome="$(dirname "\"$javaExecutable\"")"
|
||||
javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac"
|
||||
else
|
||||
javaExecutable="$(readlink -f "\"$javaExecutable\"")"
|
||||
fi
|
||||
javaHome="$(dirname "\"$javaExecutable\"")"
|
||||
javaHome=$(expr "$javaHome" : '\(.*\)/bin')
|
||||
JAVA_HOME="$javaHome"
|
||||
export JAVA_HOME
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$JAVACMD" ] ; then
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
else
|
||||
JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
echo "Error: JAVA_HOME is not defined correctly." >&2
|
||||
echo " We cannot execute $JAVACMD" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
echo "Warning: JAVA_HOME environment variable is not set."
|
||||
fi
|
||||
|
||||
# traverses directory structure from process work directory to filesystem root
|
||||
# first directory with .mvn subdirectory is considered project base directory
|
||||
find_maven_basedir() {
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "Path not specified to find_maven_basedir"
|
||||
return 1
|
||||
fi
|
||||
|
||||
basedir="$1"
|
||||
wdir="$1"
|
||||
while [ "$wdir" != '/' ] ; do
|
||||
if [ -d "$wdir"/.mvn ] ; then
|
||||
basedir=$wdir
|
||||
break
|
||||
fi
|
||||
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
||||
if [ -d "${wdir}" ]; then
|
||||
wdir=$(cd "$wdir/.." || exit 1; pwd)
|
||||
fi
|
||||
# end of workaround
|
||||
done
|
||||
printf '%s' "$(cd "$basedir" || exit 1; pwd)"
|
||||
}
|
||||
|
||||
# concatenates all lines of a file
|
||||
concat_lines() {
|
||||
if [ -f "$1" ]; then
|
||||
# Remove \r in case we run on Windows within Git Bash
|
||||
# and check out the repository with auto CRLF management
|
||||
# enabled. Otherwise, we may read lines that are delimited with
|
||||
# \r\n and produce $'-Xarg\r' rather than -Xarg due to word
|
||||
# splitting rules.
|
||||
tr -s '\r\n' ' ' < "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
log() {
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
printf '%s\n' "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
BASE_DIR=$(find_maven_basedir "$(dirname "$0")")
|
||||
if [ -z "$BASE_DIR" ]; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR
|
||||
log "$MAVEN_PROJECTBASEDIR"
|
||||
|
||||
##########################################################################################
|
||||
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||
# This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||
##########################################################################################
|
||||
wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar"
|
||||
if [ -r "$wrapperJarPath" ]; then
|
||||
log "Found $wrapperJarPath"
|
||||
else
|
||||
log "Couldn't find $wrapperJarPath, downloading it ..."
|
||||
|
||||
if [ -n "$MVNW_REPOURL" ]; then
|
||||
wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
|
||||
else
|
||||
wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
|
||||
fi
|
||||
while IFS="=" read -r key value; do
|
||||
# Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' )
|
||||
safeValue=$(echo "$value" | tr -d '\r')
|
||||
case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;;
|
||||
esac
|
||||
done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
|
||||
log "Downloading from: $wrapperUrl"
|
||||
|
||||
if $cygwin; then
|
||||
wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
|
||||
fi
|
||||
|
||||
if command -v wget > /dev/null; then
|
||||
log "Found wget ... using wget"
|
||||
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet"
|
||||
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||
wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
|
||||
else
|
||||
wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
|
||||
fi
|
||||
elif command -v curl > /dev/null; then
|
||||
log "Found curl ... using curl"
|
||||
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent"
|
||||
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||
curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
|
||||
else
|
||||
curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
|
||||
fi
|
||||
else
|
||||
log "Falling back to using Java to download"
|
||||
javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
||||
javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class"
|
||||
# For Cygwin, switch paths to Windows format before running javac
|
||||
if $cygwin; then
|
||||
javaSource=$(cygpath --path --windows "$javaSource")
|
||||
javaClass=$(cygpath --path --windows "$javaClass")
|
||||
fi
|
||||
if [ -e "$javaSource" ]; then
|
||||
if [ ! -e "$javaClass" ]; then
|
||||
log " - Compiling MavenWrapperDownloader.java ..."
|
||||
("$JAVA_HOME/bin/javac" "$javaSource")
|
||||
fi
|
||||
if [ -e "$javaClass" ]; then
|
||||
log " - Running MavenWrapperDownloader.java ..."
|
||||
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
##########################################################################################
|
||||
# End of extension
|
||||
##########################################################################################
|
||||
|
||||
# If specified, validate the SHA-256 sum of the Maven wrapper jar file
|
||||
wrapperSha256Sum=""
|
||||
while IFS="=" read -r key value; do
|
||||
case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;;
|
||||
esac
|
||||
done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
|
||||
if [ -n "$wrapperSha256Sum" ]; then
|
||||
wrapperSha256Result=false
|
||||
if command -v sha256sum > /dev/null; then
|
||||
if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then
|
||||
wrapperSha256Result=true
|
||||
fi
|
||||
elif command -v shasum > /dev/null; then
|
||||
if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then
|
||||
wrapperSha256Result=true
|
||||
fi
|
||||
else
|
||||
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available."
|
||||
echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties."
|
||||
exit 1
|
||||
fi
|
||||
if [ $wrapperSha256Result = false ]; then
|
||||
echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2
|
||||
echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2
|
||||
echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin; then
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME")
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=$(cygpath --path --windows "$CLASSPATH")
|
||||
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
||||
MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR")
|
||||
fi
|
||||
|
||||
# Provide a "standardized" way to retrieve the CLI args that will
|
||||
# work with both Windows and non-Windows executions.
|
||||
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*"
|
||||
export MAVEN_CMD_LINE_ARGS
|
||||
|
||||
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
# shellcheck disable=SC2086 # safe args
|
||||
exec "$JAVACMD" \
|
||||
$MAVEN_OPTS \
|
||||
$MAVEN_DEBUG_OPTS \
|
||||
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
||||
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
||||
205
modules/blog/mvnw.cmd
vendored
205
modules/blog/mvnw.cmd
vendored
@@ -1,205 +0,0 @@
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||
@REM or more contributor license agreements. See the NOTICE file
|
||||
@REM distributed with this work for additional information
|
||||
@REM regarding copyright ownership. The ASF licenses this file
|
||||
@REM to you under the Apache License, Version 2.0 (the
|
||||
@REM "License"); you may not use this file except in compliance
|
||||
@REM with the License. You may obtain a copy of the License at
|
||||
@REM
|
||||
@REM https://www.apache.org/licenses/LICENSE-2.0
|
||||
@REM
|
||||
@REM Unless required by applicable law or agreed to in writing,
|
||||
@REM software distributed under the License is distributed on an
|
||||
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
@REM KIND, either express or implied. See the License for the
|
||||
@REM specific language governing permissions and limitations
|
||||
@REM under the License.
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Apache Maven Wrapper startup batch script, version 3.2.0
|
||||
@REM
|
||||
@REM Required ENV vars:
|
||||
@REM JAVA_HOME - location of a JDK home dir
|
||||
@REM
|
||||
@REM Optional ENV vars
|
||||
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
||||
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
|
||||
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
@REM e.g. to debug Maven itself, use
|
||||
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
||||
@echo off
|
||||
@REM set title of command window
|
||||
title %0
|
||||
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
|
||||
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
||||
|
||||
@REM set %HOME% to equivalent of $HOME
|
||||
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
||||
|
||||
@REM Execute a user defined script before this one
|
||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
||||
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
|
||||
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
|
||||
:skipRcPre
|
||||
|
||||
@setlocal
|
||||
|
||||
set ERROR_CODE=0
|
||||
|
||||
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
||||
@setlocal
|
||||
|
||||
@REM ==== START VALIDATION ====
|
||||
if not "%JAVA_HOME%" == "" goto OkJHome
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME not found in your environment. >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
:OkJHome
|
||||
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
@REM ==== END VALIDATION ====
|
||||
|
||||
:init
|
||||
|
||||
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
||||
@REM Fallback to current working directory if not found.
|
||||
|
||||
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
||||
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
||||
|
||||
set EXEC_DIR=%CD%
|
||||
set WDIR=%EXEC_DIR%
|
||||
:findBaseDir
|
||||
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
||||
cd ..
|
||||
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
||||
set WDIR=%CD%
|
||||
goto findBaseDir
|
||||
|
||||
:baseDirFound
|
||||
set MAVEN_PROJECTBASEDIR=%WDIR%
|
||||
cd "%EXEC_DIR%"
|
||||
goto endDetectBaseDir
|
||||
|
||||
:baseDirNotFound
|
||||
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
||||
cd "%EXEC_DIR%"
|
||||
|
||||
:endDetectBaseDir
|
||||
|
||||
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
||||
|
||||
@setlocal EnableExtensions EnableDelayedExpansion
|
||||
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
||||
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
||||
|
||||
:endReadAdditionalConfig
|
||||
|
||||
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
||||
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
|
||||
|
||||
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
|
||||
IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B
|
||||
)
|
||||
|
||||
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||
if exist %WRAPPER_JAR% (
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Found %WRAPPER_JAR%
|
||||
)
|
||||
) else (
|
||||
if not "%MVNW_REPOURL%" == "" (
|
||||
SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
|
||||
)
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Couldn't find %WRAPPER_JAR%, downloading it ...
|
||||
echo Downloading from: %WRAPPER_URL%
|
||||
)
|
||||
|
||||
powershell -Command "&{"^
|
||||
"$webclient = new-object System.Net.WebClient;"^
|
||||
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
|
||||
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
|
||||
"}"^
|
||||
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^
|
||||
"}"
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Finished downloading %WRAPPER_JAR%
|
||||
)
|
||||
)
|
||||
@REM End of extension
|
||||
|
||||
@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file
|
||||
SET WRAPPER_SHA_256_SUM=""
|
||||
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
|
||||
IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B
|
||||
)
|
||||
IF NOT %WRAPPER_SHA_256_SUM%=="" (
|
||||
powershell -Command "&{"^
|
||||
"$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^
|
||||
"If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^
|
||||
" Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^
|
||||
" Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^
|
||||
" Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^
|
||||
" exit 1;"^
|
||||
"}"^
|
||||
"}"
|
||||
if ERRORLEVEL 1 goto error
|
||||
)
|
||||
|
||||
@REM Provide a "standardized" way to retrieve the CLI args that will
|
||||
@REM work with both Windows and non-Windows executions.
|
||||
set MAVEN_CMD_LINE_ARGS=%*
|
||||
|
||||
%MAVEN_JAVA_EXE% ^
|
||||
%JVM_CONFIG_MAVEN_PROPS% ^
|
||||
%MAVEN_OPTS% ^
|
||||
%MAVEN_DEBUG_OPTS% ^
|
||||
-classpath %WRAPPER_JAR% ^
|
||||
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
|
||||
%WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
||||
if ERRORLEVEL 1 goto error
|
||||
goto end
|
||||
|
||||
:error
|
||||
set ERROR_CODE=1
|
||||
|
||||
:end
|
||||
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
||||
|
||||
if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
|
||||
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
|
||||
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
|
||||
:skipRcPost
|
||||
|
||||
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
||||
if "%MAVEN_BATCH_PAUSE%"=="on" pause
|
||||
|
||||
if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
|
||||
|
||||
cmd /C exit /B %ERROR_CODE%
|
||||
@@ -1,36 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.bytedesk</groupId>
|
||||
<artifactId>modules</artifactId>
|
||||
<!-- <version>${im.version}</version> -->
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>im-blog</artifactId>
|
||||
|
||||
<name>blog</name>
|
||||
<description>Demo project for Spring Boot</description>
|
||||
|
||||
<properties>
|
||||
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- <plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin> -->
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -1,3 +0,0 @@
|
||||
rootProject.name = 'blog'
|
||||
include ':core'
|
||||
project(':core').projectDir = new File('../core')
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.bytedesk.blog;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class BlogApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(BlogApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
spring.application.name=blog
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.bytedesk.blog;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
class BlogApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
||||
BIN
modules/core/.DS_Store
vendored
BIN
modules/core/.DS_Store
vendored
Binary file not shown.
BIN
modules/core/src/.DS_Store
vendored
BIN
modules/core/src/.DS_Store
vendored
Binary file not shown.
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-25 15:31:38
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-25 15:36:07
|
||||
* @LastEditTime: 2024-05-04 11:37:26
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -14,13 +14,9 @@
|
||||
*/
|
||||
package com.bytedesk.core.action;
|
||||
|
||||
import com.bytedesk.core.utils.AuditModel;
|
||||
import com.bytedesk.core.utils.AbstractEntity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -40,14 +36,13 @@ import lombok.experimental.Accessors;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Table(name = "core_action")
|
||||
public class Action extends AuditModel {
|
||||
public class Action extends AbstractEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@Column(unique = true, nullable = false)
|
||||
private String aid;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// @NotBlank
|
||||
// @Column(unique = true, nullable = false)
|
||||
// private String aid;
|
||||
|
||||
private String title;
|
||||
|
||||
@@ -55,4 +50,9 @@ public class Action extends AuditModel {
|
||||
|
||||
private String description;
|
||||
|
||||
//
|
||||
private String userUid;
|
||||
|
||||
private String orgUid;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-17 16:53:05
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-25 15:38:58
|
||||
* @LastEditTime: 2024-05-04 12:53:51
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -12,7 +12,7 @@
|
||||
* 联系:270580156@qq.com
|
||||
* Copyright (c) 2024 by bytedesk.com, All Rights Reserved.
|
||||
*/
|
||||
package com.bytedesk.core.annotation;
|
||||
package com.bytedesk.core.action;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
@@ -29,7 +29,7 @@ import java.lang.annotation.Target;
|
||||
@Target({ ElementType.PARAMETER, ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface ActionLog {
|
||||
public @interface ActionLogAnnotation {
|
||||
|
||||
public String title() default "";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-17 16:53:12
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-25 23:41:33
|
||||
* @LastEditTime: 2024-05-04 12:33:32
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -21,7 +21,6 @@ import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Before;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.bytedesk.core.annotation.ActionLog;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -44,7 +43,7 @@ public class ActionLogAspect {
|
||||
* 处理请求前执行
|
||||
*/
|
||||
@Before(value = "@annotation(controllerLog)")
|
||||
public void doBefore(JoinPoint joinPoint, ActionLog controllerLog) {
|
||||
public void doBefore(JoinPoint joinPoint, ActionLogAnnotation controllerLog) {
|
||||
log.debug("actionLog before: model {}, action {}", controllerLog.title(), controllerLog.action());
|
||||
}
|
||||
|
||||
@@ -54,11 +53,11 @@ public class ActionLogAspect {
|
||||
* @param joinPoint 切点
|
||||
*/
|
||||
@AfterReturning(pointcut = "@annotation(controllerLog)", returning = "jsonResult")
|
||||
public void doAfterReturning(JoinPoint joinPoint, ActionLog controllerLog, Object jsonResult) {
|
||||
public void doAfterReturning(JoinPoint joinPoint, ActionLogAnnotation controllerLog, Object jsonResult) {
|
||||
log.debug("actionLog after returning: model {}, action {}, jsonResult {}", controllerLog.title(),
|
||||
controllerLog.action(), jsonResult);
|
||||
// handleLog(joinPoint, controllerLog, null, jsonResult);
|
||||
//
|
||||
// TODO: 记录具体用户
|
||||
ActionRequest actionRequest = ActionRequest.builder()
|
||||
.title(controllerLog.title())
|
||||
.action(controllerLog.action())
|
||||
@@ -74,7 +73,7 @@ public class ActionLogAspect {
|
||||
* @param e 异常
|
||||
*/
|
||||
@AfterThrowing(value = "@annotation(controllerLog)", throwing = "e")
|
||||
public void doAfterThrowing(JoinPoint joinPoint, ActionLog controllerLog, Exception e) {
|
||||
public void doAfterThrowing(JoinPoint joinPoint, ActionLogAnnotation controllerLog, Exception e) {
|
||||
log.info("actionLog after throwing: model {}, action {}", controllerLog.title(), controllerLog.action());
|
||||
// handleLog(joinPoint, controllerLog, e, null);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-25 15:40:29
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-25 23:41:25
|
||||
* @LastEditTime: 2024-05-04 11:49:01
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -29,9 +29,9 @@ import lombok.experimental.Accessors;
|
||||
@AllArgsConstructor
|
||||
public class ActionRequest extends BaseRequest {
|
||||
|
||||
private static final long serialVersionUID = 2108168382L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String aid;
|
||||
// private String aid;
|
||||
|
||||
private String title;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-25 15:40:39
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-25 15:46:33
|
||||
* @LastEditTime: 2024-05-04 11:49:07
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -27,9 +27,9 @@ import lombok.experimental.Accessors;
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ActionResponse extends BaseResponse {
|
||||
|
||||
private static final long serialVersionUID = -4636716962L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String aid;
|
||||
// private String aid;
|
||||
|
||||
private String title;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-25 15:41:47
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-25 15:52:51
|
||||
* @LastEditTime: 2024-05-04 11:37:38
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -34,7 +34,7 @@ public class ActionService {
|
||||
public Action create(ActionRequest actionRequest) {
|
||||
|
||||
Action action = modelMapper.map(actionRequest, Action.class);
|
||||
action.setAid(uidUtils.getCacheSerialUid());
|
||||
action.setUid(uidUtils.getCacheSerialUid());
|
||||
|
||||
return save(action);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-09 11:58:06
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-09 11:58:12
|
||||
* @LastEditTime: 2024-05-04 12:54:59
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -12,7 +12,7 @@
|
||||
* 联系:270580156@qq.com
|
||||
* Copyright (c) 2024 by bytedesk.com, All Rights Reserved.
|
||||
*/
|
||||
package com.bytedesk.core.annotation;
|
||||
package com.bytedesk.core.apilimit;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-09 11:59:04
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-09 12:49:23
|
||||
* @LastEditTime: 2024-05-04 13:02:47
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -12,7 +12,7 @@
|
||||
* 联系:270580156@qq.com
|
||||
* Copyright (c) 2024 by bytedesk.com, All Rights Reserved.
|
||||
*/
|
||||
package com.bytedesk.core.aop;
|
||||
package com.bytedesk.core.apilimit;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@@ -26,7 +26,6 @@ import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.springframework.core.annotation.AnnotationUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.bytedesk.core.annotation.ApiRateLimiter;
|
||||
import com.bytedesk.core.utils.JsonResult;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -34,6 +33,7 @@ import com.google.common.util.concurrent.RateLimiter;
|
||||
|
||||
|
||||
/**
|
||||
* https://springdoc.cn/spring/core.html#aop
|
||||
* https://blog.csdn.net/MICHAELKING1/article/details/106058874
|
||||
*/
|
||||
@Slf4j
|
||||
@@ -43,7 +43,7 @@ public class ApiRateLimiterAspect {
|
||||
|
||||
private static final ConcurrentMap<String, RateLimiter> RATE_LIMITER_CACHE = new ConcurrentHashMap<>();
|
||||
|
||||
@Pointcut("@annotation(com.bytedesk.core.annotation.ApiRateLimiter)")
|
||||
@Pointcut("@annotation(com.bytedesk.core.apilimit.ApiRateLimiter)")
|
||||
public void apiRateLimit() {}
|
||||
|
||||
@Around("apiRateLimit()")
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-26 20:32:23
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-28 10:55:02
|
||||
* @LastEditTime: 2024-05-04 10:46:28
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -14,14 +14,11 @@
|
||||
*/
|
||||
package com.bytedesk.core.asistant;
|
||||
|
||||
import com.bytedesk.core.utils.AuditModel;
|
||||
import com.bytedesk.core.utils.AbstractEntity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.EntityListeners;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -42,14 +39,13 @@ import lombok.experimental.Accessors;
|
||||
@NoArgsConstructor
|
||||
@EntityListeners({ AsistantListener.class })
|
||||
@Table(name = "core_asistant")
|
||||
public class Asistant extends AuditModel {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
public class Asistant extends AbstractEntity {
|
||||
|
||||
@Column(unique = true, nullable = false, length = 127)
|
||||
private String aid;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// @NotBlank
|
||||
// @Column(unique = true, nullable = false, length = 127)
|
||||
// private String aid;
|
||||
|
||||
private String topic;
|
||||
|
||||
@@ -63,5 +59,5 @@ public class Asistant extends AuditModel {
|
||||
private String description;
|
||||
|
||||
/** belong to org */
|
||||
private String orgOid;
|
||||
private String orgUid;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-26 21:05:09
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-27 12:51:21
|
||||
* @LastEditTime: 2024-05-04 10:45:56
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -27,7 +27,7 @@ import lombok.experimental.Accessors;
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class AsistantRequest extends BaseRequest {
|
||||
|
||||
private String aid;
|
||||
// private String aid;
|
||||
|
||||
private String topic;
|
||||
|
||||
@@ -38,5 +38,5 @@ public class AsistantRequest extends BaseRequest {
|
||||
private String description;
|
||||
|
||||
/** belong to org */
|
||||
private String orgOid;
|
||||
private String orgUid;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-26 21:05:21
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-28 10:55:31
|
||||
* @LastEditTime: 2024-05-04 10:42:21
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -27,7 +27,7 @@ import lombok.experimental.Accessors;
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class AsistantResponse extends BaseResponse {
|
||||
|
||||
private String aid;
|
||||
// private String aid;
|
||||
|
||||
private String topic;
|
||||
|
||||
@@ -40,5 +40,5 @@ public class AsistantResponse extends BaseResponse {
|
||||
private String description;
|
||||
|
||||
/** belong to org */
|
||||
private String orgOid;
|
||||
private String orgUid;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-26 21:04:54
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-28 11:14:48
|
||||
* @LastEditTime: 2024-05-04 10:41:58
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -67,7 +67,7 @@ public class AsistantService {
|
||||
public Asistant create(AsistantRequest asistantRequest) {
|
||||
|
||||
Asistant asistant = modelMapper.map(asistantRequest, Asistant.class);
|
||||
asistant.setAid(uidUtils.getCacheSerialUid());
|
||||
asistant.setUid(uidUtils.getCacheSerialUid());
|
||||
|
||||
return save(asistant);
|
||||
}
|
||||
@@ -95,7 +95,7 @@ public class AsistantService {
|
||||
.name(I18Consts.I18_FILE_ASISTANT_NAME)
|
||||
.avatar(AvatarConsts.DEFAULT_FILE_ASISTANT_AVATAR_URL)
|
||||
.description(I18Consts.I18_FILE_ASISTANT_DESCRIPTION)
|
||||
.orgOid(adminOptional.get().getOrgOid())
|
||||
.orgUid(adminOptional.get().getOrgUid())
|
||||
.build();
|
||||
asistantRequest.setType(TypeConsts.TYPE_SYSTEM);
|
||||
create(asistantRequest);
|
||||
@@ -109,21 +109,23 @@ public class AsistantService {
|
||||
userPage.forEach(user -> {
|
||||
//
|
||||
UserResponseSimple userSimple = UserResponseSimple.builder()
|
||||
.uid(asistantRequest.getAid())
|
||||
// .uid(asistantRequest.getAid())
|
||||
.nickname(asistantRequest.getName())
|
||||
.avatar(asistantRequest.getAvatar())
|
||||
.build();
|
||||
userSimple.setUid(asistantRequest.getUid());
|
||||
//
|
||||
Thread thread = Thread.builder()
|
||||
.tid(uidUtils.getCacheSerialUid())
|
||||
// .tid(uidUtils.getCacheSerialUid())
|
||||
.type(ThreadTypeConsts.ASISTANT)
|
||||
.topic(TopicConsts.TOPIC_FILE_ASISTANT + "/" + user.getUid())
|
||||
.status(StatusConsts.THREAD_STATUS_INIT)
|
||||
.client(TypeConsts.TYPE_SYSTEM)
|
||||
.user(JSON.toJSONString(userSimple))
|
||||
.owner(user)
|
||||
.orgOid(asistantRequest.getOrgOid())
|
||||
.orgUid(asistantRequest.getOrgUid())
|
||||
.build();
|
||||
thread.setUid(uidUtils.getCacheSerialUid());
|
||||
|
||||
threadService.save(thread);
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-26 20:34:52
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-28 11:20:53
|
||||
* @LastEditTime: 2024-05-04 10:47:12
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -14,14 +14,11 @@
|
||||
*/
|
||||
package com.bytedesk.core.channel;
|
||||
|
||||
import com.bytedesk.core.utils.AuditModel;
|
||||
import com.bytedesk.core.utils.AbstractEntity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.EntityListeners;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -42,14 +39,12 @@ import lombok.experimental.Accessors;
|
||||
@NoArgsConstructor
|
||||
@EntityListeners({ChannelListener.class})
|
||||
@Table(name = "core_channel")
|
||||
public class Channel extends AuditModel {
|
||||
public class Channel extends AbstractEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column(unique = true, nullable = false, length = 127)
|
||||
private String cid;
|
||||
// @Column(unique = true, nullable = false, length = 127)
|
||||
// private String cid;
|
||||
|
||||
private String topic;
|
||||
|
||||
@@ -63,7 +58,7 @@ public class Channel extends AuditModel {
|
||||
private String description;
|
||||
|
||||
/** belong to org */
|
||||
private String orgOid;
|
||||
private String orgUid;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-26 21:07:10
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-26 21:44:27
|
||||
* @LastEditTime: 2024-05-04 10:47:25
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -27,7 +27,7 @@ import lombok.experimental.Accessors;
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ChannelRequest extends BaseRequest {
|
||||
|
||||
private String cid;
|
||||
// private String cid;
|
||||
|
||||
private String topic;
|
||||
|
||||
@@ -38,5 +38,5 @@ public class ChannelRequest extends BaseRequest {
|
||||
private String description;
|
||||
|
||||
/** belong to org */
|
||||
private String orgOid;
|
||||
private String orgUid;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import lombok.experimental.Accessors;
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ChannelResponse extends BaseResponse {
|
||||
|
||||
private String cid;
|
||||
// private String cid;
|
||||
|
||||
private String topic;
|
||||
|
||||
@@ -40,5 +40,5 @@ public class ChannelResponse extends BaseResponse {
|
||||
private String description;
|
||||
|
||||
/** belong to org */
|
||||
private String orgOid;
|
||||
private String orgUid;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-26 21:06:12
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-28 11:40:10
|
||||
* @LastEditTime: 2024-05-04 10:47:33
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -58,7 +58,7 @@ public class ChannelService {
|
||||
public Channel create(ChannelRequest channelRequest) {
|
||||
|
||||
Channel channel = modelMapper.map(channelRequest, Channel.class);
|
||||
channel.setCid(uidUtils.getCacheSerialUid());
|
||||
channel.setUid(uidUtils.getCacheSerialUid());
|
||||
|
||||
return save(channel);
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class ChannelService {
|
||||
.name(I18Consts.I18_SYSTEM_NOTIFICATION_NAME)
|
||||
.avatar(AvatarConsts.DEFAULT_SYSTEM_NOTIFICATION_AVATAR_URL)
|
||||
.description(I18Consts.I18_SYSTEM_NOTIFICATION_DESCRIPTION)
|
||||
.orgOid(adminOptional.get().getOrgOid())
|
||||
.orgUid(adminOptional.get().getOrgUid())
|
||||
.build();
|
||||
channelRequest.setType(TypeConsts.TYPE_SYSTEM);
|
||||
create(channelRequest);
|
||||
|
||||
@@ -26,12 +26,12 @@ public class I18Consts {
|
||||
// public static final String ZH_CN = "zh-cn";
|
||||
|
||||
// "文件助手"
|
||||
public static final String I18_FILE_ASISTANT_NAME = "file_asistant";
|
||||
public static final String I18_FILE_ASISTANT_NAME = "i18_file_asistant";
|
||||
// "手机、电脑文件互传"
|
||||
public static final String I18_FILE_ASISTANT_DESCRIPTION = "file_asistant_description";
|
||||
public static final String I18_FILE_ASISTANT_DESCRIPTION = "i18_file_asistant_description";
|
||||
// 系统通知
|
||||
public static final String I18_SYSTEM_NOTIFICATION_NAME = "system_notification";
|
||||
public static final String I18_SYSTEM_NOTIFICATION_DESCRIPTION = "system_notification_description";
|
||||
public static final String I18_SYSTEM_NOTIFICATION_NAME = "i18_system_notification";
|
||||
public static final String I18_SYSTEM_NOTIFICATION_DESCRIPTION = "i18_system_notification_description";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-02-22 16:01:14
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-27 12:37:31
|
||||
* @LastEditTime: 2024-04-30 14:43:37
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -31,4 +31,5 @@ public class ThreadTypeConsts {
|
||||
public static final String FEEDBACK = "feedback";
|
||||
public static final String ASISTANT = "assistant";
|
||||
public static final String CHANNEL = "channel";
|
||||
public static final String LOCAL = "local";
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-22 22:21:00
|
||||
* @LastEditTime: 2024-05-04 10:36:46
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -22,7 +22,7 @@ import org.hibernate.type.SqlTypes;
|
||||
|
||||
import com.bytedesk.core.constant.BdConstants;
|
||||
import com.bytedesk.core.thread.Thread;
|
||||
import com.bytedesk.core.utils.AuditModel;
|
||||
import com.bytedesk.core.utils.AbstractEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
@@ -41,16 +41,13 @@ import lombok.experimental.Accessors;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Table(name = "core_message")
|
||||
public class Message extends AuditModel {
|
||||
public class Message extends AbstractEntity {
|
||||
|
||||
private static final long serialVersionUID = 6816837318L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@Column(unique = true, nullable = false)
|
||||
private String mid;
|
||||
// @NotBlank
|
||||
// @Column(unique = true, nullable = false)
|
||||
// private String mid;
|
||||
|
||||
@Column(name = "by_type")
|
||||
private String type;
|
||||
@@ -91,6 +88,6 @@ public class Message extends AuditModel {
|
||||
|
||||
// TODO:
|
||||
/** belong to org */
|
||||
private String orgOid;
|
||||
private String orgUid;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-17 09:43:34
|
||||
* @LastEditTime: 2024-05-04 11:29:27
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -31,14 +31,14 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@Tag(name = "message - 消息")
|
||||
public interface MessageRepository extends JpaRepository<Message, Long>, JpaSpecificationExecutor<Message> {
|
||||
|
||||
Optional<Message> findByMid(String mid);
|
||||
Optional<Message> findByUid(String mid);
|
||||
|
||||
Long deleteByMid(String mid);
|
||||
Long deleteByUid(String mid);
|
||||
|
||||
Page<Message> findByThreadsTidIn(String[] threadTids, Pageable pageable);
|
||||
Page<Message> findByThreadsUidIn(String[] threadTids, Pageable pageable);
|
||||
|
||||
Optional<Message> findFirstByThreadsTidInOrderByCreatedAtDesc(String[] threadTids);
|
||||
Optional<Message> findFirstByThreadsUidInOrderByCreatedAtDesc(String[] threadTids);
|
||||
|
||||
boolean existsByMid(String mid);
|
||||
boolean existsByUid(String mid);
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-02-21 10:00:32
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-03-01 16:11:47
|
||||
* @LastEditTime: 2024-05-04 10:47:53
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -23,7 +23,7 @@ import lombok.EqualsAndHashCode;
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class MessageRequest extends BaseRequest {
|
||||
|
||||
private String mid;
|
||||
// private String mid;
|
||||
|
||||
private String[] threads;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-02-21 10:00:55
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-22 20:51:15
|
||||
* @LastEditTime: 2024-05-04 10:48:05
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -42,7 +42,7 @@ public class MessageResponse extends BaseResponse {
|
||||
private static final long serialVersionUID = 9911390153L;
|
||||
|
||||
/** message */
|
||||
private String mid;
|
||||
// private String mid;
|
||||
|
||||
private String type;
|
||||
|
||||
|
||||
@@ -45,14 +45,14 @@ public class MessageService {
|
||||
Pageable pageable = PageRequest.of(request.getPageNumber(), request.getPageSize(), Sort.Direction.DESC,
|
||||
"id");
|
||||
|
||||
Page<Message> messagePage = messageRepository.findByThreadsTidIn(request.getThreads(), pageable);
|
||||
Page<Message> messagePage = messageRepository.findByThreadsUidIn(request.getThreads(), pageable);
|
||||
|
||||
return messagePage.map(BdConvertUtils::convertToMessageResponse);
|
||||
}
|
||||
|
||||
@Cacheable(value = "message", key = "#mid", unless="#result == null")
|
||||
public Optional<Message> findByMid(String mid) {
|
||||
return messageRepository.findByMid(mid);
|
||||
return messageRepository.findByUid(mid);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,8 +60,8 @@ public class MessageService {
|
||||
* 找到当前会话中最新一条聊天记录
|
||||
*/
|
||||
@Cacheable(value = "message", key = "#threadTid", unless="#result == null")
|
||||
public Optional<Message> findByThreadsTidInOrderByCreatedAtDesc(String threadTid) {
|
||||
return messageRepository.findFirstByThreadsTidInOrderByCreatedAtDesc(new String[]{threadTid});
|
||||
public Optional<Message> findByThreadsUidInOrderByCreatedAtDesc(String threadTid) {
|
||||
return messageRepository.findFirstByThreadsUidInOrderByCreatedAtDesc(new String[]{threadTid});
|
||||
}
|
||||
|
||||
@Caching(put = {
|
||||
@@ -82,11 +82,11 @@ public class MessageService {
|
||||
@CacheEvict(value = "message", key = "#mid"),
|
||||
})
|
||||
public void deleteByMid(String mid) {
|
||||
messageRepository.deleteByMid(mid);
|
||||
messageRepository.deleteByUid(mid);
|
||||
}
|
||||
|
||||
public boolean existsByMid(String mid) {
|
||||
return messageRepository.existsByMid(mid);
|
||||
return messageRepository.existsByUid(mid);
|
||||
}
|
||||
|
||||
// public MessageResponse convertToMessageResponse(Message message) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-25 15:30:11
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-25 20:23:47
|
||||
* @LastEditTime: 2024-05-03 23:36:01
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -15,14 +15,12 @@
|
||||
package com.bytedesk.core.push;
|
||||
|
||||
import com.bytedesk.core.constant.StatusConsts;
|
||||
import com.bytedesk.core.utils.AuditModel;
|
||||
import com.bytedesk.core.utils.AbstractEntity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -41,12 +39,11 @@ import lombok.experimental.Accessors;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Table(name = "core_push")
|
||||
public class Push extends AuditModel {
|
||||
public class Push extends AbstractEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@NotBlank
|
||||
@Column(unique = true, nullable = false)
|
||||
private String pid;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-03-31 15:30:19
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-26 12:55:58
|
||||
* @LastEditTime: 2024-05-03 20:30:04
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -21,6 +21,11 @@ import com.bytedesk.core.message.Message;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* https://springdoc.cn/spring-boot-email/
|
||||
* https://springdoc.cn/spring/integration.html#mail
|
||||
* https://mailtrap.io/blog/spring-send-email/
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class PushServiceImplEmail extends Notifier {
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.bytedesk.core.annotation.ActionLog;
|
||||
import com.bytedesk.core.action.ActionLogAnnotation;
|
||||
import com.bytedesk.core.push.PushService;
|
||||
import com.bytedesk.core.rbac.user.UserRequest;
|
||||
import com.bytedesk.core.rbac.user.UserResponse;
|
||||
@@ -72,7 +72,7 @@ public class AuthController {
|
||||
return ResponseEntity.ok(JsonResult.success("register success", userResponse));
|
||||
}
|
||||
|
||||
@ActionLog(title = "Auth", action = "loginWithUsernamePassword", description = "Login With Username & Password")
|
||||
@ActionLogAnnotation(title = "Auth", action = "loginWithUsernamePassword", description = "Login With Username & Password")
|
||||
@PostMapping("/login")
|
||||
public ResponseEntity<?> loginWithUsernamePassword(@RequestBody AuthRequest authRequest) {
|
||||
log.debug("login {}", authRequest.toString());
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-24 11:13:15
|
||||
* @LastEditTime: 2024-05-04 10:39:34
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -22,7 +22,7 @@ import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import jakarta.persistence.*;
|
||||
|
||||
import com.bytedesk.core.utils.AuditModel;
|
||||
import com.bytedesk.core.utils.AbstractEntity;
|
||||
|
||||
/**
|
||||
* @author im.bytedesk.com
|
||||
@@ -35,16 +35,13 @@ import com.bytedesk.core.utils.AuditModel;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Table(name = "core_authority")
|
||||
public class Authority extends AuditModel {
|
||||
public class Authority extends AbstractEntity {
|
||||
|
||||
private static final long serialVersionUID = -3232924689L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@Column(unique = true, nullable = false, length = 127)
|
||||
private String aid;
|
||||
// @NotBlank
|
||||
// @Column(unique = true, nullable = false, length = 127)
|
||||
// private String aid;
|
||||
|
||||
private String name;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-24 11:04:52
|
||||
* @LastEditTime: 2024-05-04 11:25:14
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk@
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -31,7 +31,7 @@ import java.util.Optional;
|
||||
@Tag(name = "authoritys - 权限")
|
||||
public interface AuthorityRepository extends JpaRepository<Authority, Long>, JpaSpecificationExecutor<Authority> {
|
||||
|
||||
Optional<Authority> findByAid(String aid);
|
||||
Optional<Authority> findByUid(String uid);
|
||||
|
||||
Optional<Authority> findByValue(String value);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-24 10:41:37
|
||||
* @LastEditTime: 2024-05-04 11:45:13
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -27,7 +27,7 @@ import com.bytedesk.core.utils.BaseRequest;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AuthorityRequest extends BaseRequest {
|
||||
|
||||
private String aid;
|
||||
// private String aid;
|
||||
|
||||
private String name;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-24 11:19:54
|
||||
* @LastEditTime: 2024-05-04 11:45:10
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -23,7 +23,7 @@ import com.bytedesk.core.utils.BaseResponse;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AuthorityResponse extends BaseResponse {
|
||||
|
||||
private String aid;
|
||||
// private String aid;
|
||||
|
||||
private String name;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-24 10:54:51
|
||||
* @LastEditTime: 2024-05-04 10:39:41
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -38,14 +38,14 @@ public class AuthorityService {
|
||||
public Authority create(AuthorityRequest authorityRequest) {
|
||||
//
|
||||
Authority authority = modelMapper.map(authorityRequest, Authority.class);
|
||||
authority.setAid(uidUtils.getCacheSerialUid());
|
||||
authority.setUid(uidUtils.getCacheSerialUid());
|
||||
|
||||
return save(authority);
|
||||
}
|
||||
|
||||
@Cacheable(value = "authority", key = "#aid", unless = "#result == null")
|
||||
public Optional<Authority> findByAid(String aid) {
|
||||
return authorityRepository.findByAid(aid);
|
||||
return authorityRepository.findByUid(aid);
|
||||
}
|
||||
|
||||
@Cacheable(value = "authority", key = "#value", unless = "#result == null")
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-24 11:06:52
|
||||
* @LastEditTime: 2024-05-04 10:39:48
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -15,6 +15,7 @@
|
||||
package com.bytedesk.core.rbac.role;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -26,7 +27,7 @@ import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
|
||||
import com.bytedesk.core.rbac.authority.Authority;
|
||||
import com.bytedesk.core.utils.AuditModel;
|
||||
import com.bytedesk.core.utils.AbstractEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
/**
|
||||
@@ -42,17 +43,16 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Table(name = "core_role")
|
||||
public class Role extends AuditModel {
|
||||
public class Role extends AbstractEntity {
|
||||
|
||||
private static final long serialVersionUID = -1470818087L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@Column(unique = true, nullable = false, length = 127)
|
||||
private String rid;
|
||||
// @NotBlank
|
||||
// @Column(unique = true, nullable = false, length = 127)
|
||||
// private String rid;
|
||||
|
||||
@NotBlank
|
||||
@Column(unique = true, nullable = false)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
@@ -80,7 +80,7 @@ public class Role extends AuditModel {
|
||||
// @JsonBackReference("user-roles") // 避免无限递归
|
||||
// private User user;
|
||||
|
||||
private String orgOid;
|
||||
private String orgUid;
|
||||
|
||||
|
||||
public void addAuthority(Authority authority) {
|
||||
|
||||
@@ -41,7 +41,7 @@ public interface RoleRepository extends JpaRepository<Role, Long>, JpaSpecificat
|
||||
List<Role> findByType(String type);
|
||||
|
||||
// Page<Role> findByUser(User user, Pageable pageable);
|
||||
Page<Role> findByOrgOid(String orgOid, Pageable pageable);
|
||||
Page<Role> findByOrgUid(String orgUid, Pageable pageable);
|
||||
|
||||
Boolean existsByName(String name);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-24 11:10:01
|
||||
* @LastEditTime: 2024-05-04 10:40:03
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -30,7 +30,7 @@ import com.bytedesk.core.utils.BaseRequest;
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class RoleRequest extends BaseRequest {
|
||||
|
||||
private String rid;
|
||||
// private String rid;
|
||||
|
||||
private String name;
|
||||
|
||||
@@ -42,7 +42,7 @@ public class RoleRequest extends BaseRequest {
|
||||
private Set<String> authorityAids = new HashSet<>();
|
||||
|
||||
// organization oid
|
||||
private String orgOid;
|
||||
private String orgUid;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-24 11:16:29
|
||||
* @LastEditTime: 2024-05-04 10:40:07
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -40,7 +40,7 @@ public class RoleResponse extends BaseResponse {
|
||||
|
||||
private static final long serialVersionUID = 4082434575L;
|
||||
|
||||
private String rid;
|
||||
// private String rid;
|
||||
|
||||
private String name;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-27 12:55:37
|
||||
* @LastEditTime: 2024-05-04 10:39:53
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -64,7 +64,7 @@ public class RoleService {
|
||||
}
|
||||
|
||||
Role role = modelMapper.map(rolerRequest, Role.class);
|
||||
role.setRid(uidUtils.getCacheSerialUid());
|
||||
role.setUid(uidUtils.getCacheSerialUid());
|
||||
//
|
||||
Iterator<String> iterator = rolerRequest.getAuthorityAids().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -84,7 +84,7 @@ public class RoleService {
|
||||
Sort.Direction.DESC,
|
||||
"id");
|
||||
|
||||
Page<Role> rolePage = roleRepository.findByOrgOid(roleRequest.getOrgOid(), pageable);
|
||||
Page<Role> rolePage = roleRepository.findByOrgUid(roleRequest.getOrgUid(), pageable);
|
||||
|
||||
return rolePage.map(BdConvertUtils::convertToRoleResponse);
|
||||
}
|
||||
@@ -145,7 +145,7 @@ public class RoleService {
|
||||
//
|
||||
Optional<Authority> authorityOptional = authorityService.findByValue(authority);
|
||||
if (authorityOptional.isPresent()) {
|
||||
roleRequest.getAuthorityAids().add(authorityOptional.get().getAid());
|
||||
roleRequest.getAuthorityAids().add(authorityOptional.get().getUid());
|
||||
}
|
||||
//
|
||||
create(roleRequest);
|
||||
@@ -161,7 +161,7 @@ public class RoleService {
|
||||
String roleName = TypeConsts.ROLE_ + authority;
|
||||
Optional<Role> roleOptional = findByName(roleName);
|
||||
roleOptional.ifPresent(role -> {
|
||||
role.setOrgOid(adminOptional.get().getOrgOid());
|
||||
role.setOrgUid(adminOptional.get().getOrgUid());
|
||||
roleRepository.save(role);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.util.Set;
|
||||
import com.bytedesk.core.constant.AvatarConsts;
|
||||
import com.bytedesk.core.constant.BdConstants;
|
||||
import com.bytedesk.core.rbac.role.Role;
|
||||
import com.bytedesk.core.utils.AuditModel;
|
||||
import com.bytedesk.core.utils.AbstractEntity;
|
||||
import com.bytedesk.core.utils.StringSetConverter;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import jakarta.persistence.Column;
|
||||
@@ -14,14 +14,12 @@ import jakarta.persistence.Convert;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.EntityListeners;
|
||||
import jakarta.persistence.FetchType;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.ManyToMany;
|
||||
import jakarta.persistence.Table;
|
||||
// import jakarta.persistence.UniqueConstraint;
|
||||
// import jakarta.validation.constraints.Digits;
|
||||
import jakarta.validation.constraints.Email;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -41,21 +39,15 @@ import lombok.experimental.Accessors;
|
||||
// @UniqueConstraint(columnNames = "username"),
|
||||
// @UniqueConstraint(columnNames = "email")
|
||||
})
|
||||
public class User extends AuditModel {
|
||||
public class User extends AbstractEntity {
|
||||
|
||||
private static final long serialVersionUID = 3817197261L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@Column(name = "uuid", unique = true, nullable = false)
|
||||
private String uid;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column(unique = true)
|
||||
private String num;
|
||||
|
||||
// used in authjwtToken, should not be null
|
||||
@NotBlank(message = "username is required")
|
||||
@Column(unique = true, nullable = false)
|
||||
private String username;
|
||||
|
||||
@@ -104,7 +96,7 @@ public class User extends AuditModel {
|
||||
private Set<String> organizations = new HashSet<>();
|
||||
|
||||
// return the first organization oid
|
||||
public String getOrgOid() {
|
||||
public String getOrgUid() {
|
||||
return this.organizations.isEmpty() ? null : this.organizations.iterator().next();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-26 10:53:19
|
||||
* @LastEditTime: 2024-05-03 23:11:39
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -32,8 +32,6 @@ import lombok.NoArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
public class UserRequest extends BaseRequest {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String uid;
|
||||
|
||||
private String num;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-25 22:52:53
|
||||
* @LastEditTime: 2024-05-04 10:43:08
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -35,9 +35,9 @@ import com.bytedesk.core.utils.BaseResponse;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UserResponse extends BaseResponse {
|
||||
|
||||
private static final long serialVersionUID = -2015147462L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String uid;
|
||||
// private String uid;
|
||||
private String username;
|
||||
private String nickname;
|
||||
private String email;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-16 17:04:38
|
||||
* @LastEditTime: 2024-05-04 10:43:13
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -33,7 +33,7 @@ public class UserResponseSimple extends BaseResponse {
|
||||
|
||||
private static final long serialVersionUID = 4684010695L;
|
||||
|
||||
private String uid;
|
||||
// private String uid;
|
||||
private String nickname;
|
||||
private String avatar;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-27 12:24:01
|
||||
* @LastEditTime: 2024-05-04 10:22:24
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -170,10 +170,10 @@ public class UserService {
|
||||
|
||||
@Transactional
|
||||
public User createUser(String nickname, String avatar, String password, String mobile, String email, boolean isVerified,
|
||||
String orgOid) {
|
||||
String orgUid) {
|
||||
|
||||
User user = User.builder()
|
||||
.uid(uidUtils.getCacheSerialUid())
|
||||
// .uid(uidUtils.getCacheSerialUid())
|
||||
.avatar(avatar)
|
||||
// use email as default username
|
||||
.username(email)
|
||||
@@ -184,7 +184,8 @@ public class UserService {
|
||||
.superUser(false)
|
||||
.emailVerified(isVerified)
|
||||
.mobileVerified(isVerified)
|
||||
.build();
|
||||
.build();
|
||||
user.setUid(uidUtils.getCacheSerialUid());
|
||||
|
||||
if (StringUtils.hasLength(password)) {
|
||||
user.setPassword(passwordEncoder.encode(password));
|
||||
@@ -192,7 +193,7 @@ public class UserService {
|
||||
user.setPassword(passwordEncoder.encode("123456"));
|
||||
}
|
||||
|
||||
user.getOrganizations().add(orgOid);
|
||||
user.getOrganizations().add(orgUid);
|
||||
|
||||
return save(user);
|
||||
// return user;
|
||||
@@ -300,7 +301,7 @@ public class UserService {
|
||||
}
|
||||
|
||||
User admin = User.builder()
|
||||
.uid(uidUtils.getCacheSerialUid())
|
||||
// .uid(uidUtils.getCacheSerialUid())
|
||||
.email(properties.getEmail())
|
||||
.username(properties.getUsername())
|
||||
.password(new BCryptPasswordEncoder().encode(properties.getPassword()))
|
||||
@@ -312,6 +313,7 @@ public class UserService {
|
||||
.emailVerified(true)
|
||||
.mobileVerified(true)
|
||||
.build();
|
||||
admin.setUid(uidUtils.getCacheSerialUid());
|
||||
//
|
||||
Optional<Role> roleOptional = roleService.findByName(TypeConsts.ROLE_SUPER);
|
||||
Set<Role> roles = new HashSet<>();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-23 09:55:39
|
||||
* @LastEditTime: 2024-05-04 10:40:42
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -21,10 +21,11 @@ import com.bytedesk.core.constant.BdConstants;
|
||||
import com.bytedesk.core.constant.StatusConsts;
|
||||
import com.bytedesk.core.constant.ThreadTypeConsts;
|
||||
import com.bytedesk.core.rbac.user.User;
|
||||
import com.bytedesk.core.utils.AuditModel;
|
||||
import com.bytedesk.core.utils.AbstractEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -45,14 +46,13 @@ import lombok.experimental.Accessors;
|
||||
@NoArgsConstructor
|
||||
@EntityListeners({ ThreadListener.class })
|
||||
@Table(name = "core_thread")
|
||||
public class Thread extends AuditModel {
|
||||
public class Thread extends AbstractEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column(unique = true, nullable = false)
|
||||
private String tid;
|
||||
// @NotBlank
|
||||
// @Column(unique = true, nullable = false)
|
||||
// private String tid;
|
||||
|
||||
/**
|
||||
* used to push message
|
||||
@@ -61,6 +61,7 @@ public class Thread extends AuditModel {
|
||||
* agent_aid + '/' + visitor_vid
|
||||
* such as: wid/vid or aid/vid
|
||||
*/
|
||||
@NotBlank
|
||||
private String topic;
|
||||
|
||||
@Builder.Default
|
||||
@@ -105,6 +106,6 @@ public class Thread extends AuditModel {
|
||||
|
||||
// TODO:
|
||||
/** belong to org */
|
||||
private String orgOid;
|
||||
private String orgUid;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-15 09:30:56
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-27 12:12:59
|
||||
* @LastEditTime: 2024-05-04 10:40:48
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -35,7 +35,7 @@ public class ThreadListener {
|
||||
|
||||
@PostPersist
|
||||
public void postPersist(Thread thread) {
|
||||
log.info("thread postPersist {}", thread.getTid());
|
||||
log.info("thread postPersist {}", thread.getUid());
|
||||
// 这里可以记录日志
|
||||
// create thread topic
|
||||
TopicService topicService = ApplicationContextHolder.getBean(TopicService.class);
|
||||
@@ -52,7 +52,7 @@ public class ThreadListener {
|
||||
|
||||
@PostUpdate
|
||||
public void postUpdate(Thread thread) {
|
||||
log.info("postUpdate {}", thread.getTid());
|
||||
log.info("postUpdate {}", thread.getUid());
|
||||
//
|
||||
BytedeskEventPublisher bytedeskEventPublisher = ApplicationContextHolder.getBean(BytedeskEventPublisher.class);
|
||||
bytedeskEventPublisher.publishThreadUpdateEvent(thread);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-22 22:30:34
|
||||
* @LastEditTime: 2024-05-04 11:28:48
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -34,7 +34,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@Repository
|
||||
@Tag(name = "thread - 会话")
|
||||
public interface ThreadRepository extends JpaRepository<Thread, Long>, JpaSpecificationExecutor<Thread> {
|
||||
Optional<Thread> findByTid(String tid);
|
||||
Optional<Thread> findByUid(String uid);
|
||||
/** used for member thread type */
|
||||
Optional<Thread> findFirstByTopicAndOwner(String topic, User owner);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-27 12:29:48
|
||||
* @LastEditTime: 2024-05-04 10:41:00
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -86,7 +86,7 @@ public class ThreadService {
|
||||
}
|
||||
//
|
||||
Thread thread = modelMapper.map(threadRequest, Thread.class);
|
||||
thread.setTid(uidUtils.getCacheSerialUid());
|
||||
thread.setUid(uidUtils.getCacheSerialUid());
|
||||
thread.setStatus(StatusConsts.THREAD_STATUS_INIT);
|
||||
//
|
||||
String user = JSON.toJSONString(threadRequest.getUser());
|
||||
@@ -102,7 +102,7 @@ public class ThreadService {
|
||||
/** */
|
||||
public Thread getReverse(Thread thread) {
|
||||
|
||||
String reverseTid = new StringBuffer(thread.getTid()).reverse().toString();
|
||||
String reverseTid = new StringBuffer(thread.getUid()).reverse().toString();
|
||||
Optional<Thread> reverseThreadOptional = findByTid(reverseTid);
|
||||
if (reverseThreadOptional.isPresent()) {
|
||||
reverseThreadOptional.get().setContent(thread.getContent());
|
||||
@@ -113,7 +113,7 @@ public class ThreadService {
|
||||
return null;
|
||||
}
|
||||
Thread reverseThread = new Thread();
|
||||
reverseThread.setTid(reverseTid);
|
||||
reverseThread.setUid(reverseTid);
|
||||
reverseThread.setTopic(thread.getOwner().getUid());
|
||||
//
|
||||
UserResponseSimple user = userService.convertToUserResponseSimple(thread.getOwner());
|
||||
@@ -139,9 +139,9 @@ public class ThreadService {
|
||||
}
|
||||
|
||||
|
||||
@Cacheable(value = "thread", key = "#tid", unless = "#result == null")
|
||||
public Optional<Thread> findByTid(String tid) {
|
||||
return threadRepository.findByTid(tid);
|
||||
@Cacheable(value = "thread", key = "#uid", unless = "#result == null")
|
||||
public Optional<Thread> findByTid(String uid) {
|
||||
return threadRepository.findByUid(uid);
|
||||
}
|
||||
|
||||
// TODO: how to cacheput or cacheevict?
|
||||
@@ -187,7 +187,7 @@ public class ThreadService {
|
||||
}
|
||||
|
||||
@Caching(put = {
|
||||
@CachePut(value = "thread", key = "#thread.tid"),
|
||||
@CachePut(value = "thread", key = "#thread.uid"),
|
||||
@CachePut(value = "thread", key = "#thread.topic")
|
||||
})
|
||||
public Thread save(@NonNull Thread thread) {
|
||||
@@ -195,7 +195,7 @@ public class ThreadService {
|
||||
}
|
||||
|
||||
@Caching(evict = {
|
||||
@CacheEvict(value = "thread", key = "#thread.tid"),
|
||||
@CacheEvict(value = "thread", key = "#thread.uid"),
|
||||
@CacheEvict(value = "thread", key = "#thread.topic")
|
||||
})
|
||||
public void delete(@NonNull Thread thread) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-13 16:03:44
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-23 16:09:01
|
||||
* @LastEditTime: 2024-05-04 10:18:59
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -17,16 +17,14 @@ package com.bytedesk.core.topic;
|
||||
import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
|
||||
import com.bytedesk.core.utils.AuditModel;
|
||||
import com.bytedesk.core.utils.AbstractEntity;
|
||||
import com.bytedesk.core.utils.StringSetConverter;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Convert;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -44,14 +42,13 @@ import lombok.experimental.Accessors;
|
||||
@Table(name = "core_topic", uniqueConstraints = {
|
||||
// @UniqueConstraint(columnNames = {"topic", "uuid"}),
|
||||
})
|
||||
public class Topic extends AuditModel {
|
||||
public class Topic extends AbstractEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@Column(unique = true, nullable = false)
|
||||
private String tid;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// @NotBlank
|
||||
// @Column(unique = true, nullable = false)
|
||||
// private String tid;
|
||||
|
||||
// @Column(nullable = false)
|
||||
// private String topic;
|
||||
@@ -63,8 +60,9 @@ public class Topic extends AuditModel {
|
||||
// private String topic;
|
||||
|
||||
// user, no need map, just uid
|
||||
@Column(name = "uuid", nullable = false)
|
||||
private String uid;
|
||||
@NotBlank
|
||||
@Column(nullable = false)
|
||||
private String userUid;
|
||||
|
||||
/** AT_MOST_ONCE(0),AT_LEAST_ONCE(1), EXACTLY_ONCE(2), */
|
||||
// @Builder.Default
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-13 16:14:47
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-23 16:16:14
|
||||
* @LastEditTime: 2024-05-04 10:20:26
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -25,9 +25,9 @@ import org.springframework.stereotype.Repository;
|
||||
@Repository
|
||||
public interface TopicRepository extends JpaRepository<Topic, Long> {
|
||||
|
||||
Optional<Topic> findByTid(String tid);
|
||||
Optional<Topic> findByUid(String uid);
|
||||
|
||||
Optional<Topic> findFirstByUid(String uid);
|
||||
Optional<Topic> findFirstByUserUid(String userUid);
|
||||
|
||||
// boolean existsByTopicAndUid(String topic, String uid);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-13 16:15:11
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-22 14:23:43
|
||||
* @LastEditTime: 2024-05-04 10:37:19
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -34,11 +34,11 @@ import lombok.experimental.Accessors;
|
||||
@AllArgsConstructor
|
||||
public class TopicRequest extends BaseRequest {
|
||||
|
||||
private String tid;
|
||||
// private String uid;
|
||||
|
||||
private String topic;
|
||||
|
||||
private String uid;
|
||||
private String userUid;
|
||||
|
||||
/** AT_MOST_ONCE(0),AT_LEAST_ONCE(1), EXACTLY_ONCE(2), */
|
||||
// @Builder.Default
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-13 16:15:22
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-16 09:41:32
|
||||
* @LastEditTime: 2024-05-04 10:42:57
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -35,11 +35,11 @@ import lombok.experimental.Accessors;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class TopicResponse extends BaseResponse {
|
||||
|
||||
private String tid;
|
||||
// private String uid;
|
||||
|
||||
private String topic;
|
||||
|
||||
private String uid;
|
||||
private String userUid;
|
||||
|
||||
/** AT_MOST_ONCE(0),AT_LEAST_ONCE(1), EXACTLY_ONCE(2), */
|
||||
private int qos;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-13 16:14:36
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-27 12:06:52
|
||||
* @LastEditTime: 2024-05-04 10:26:15
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -46,7 +46,7 @@ public class TopicService {
|
||||
public void create(String topic, String uid) {
|
||||
TopicRequest topicRequest = TopicRequest.builder()
|
||||
.topic(topic)
|
||||
.uid(uid)
|
||||
.userUid(uid)
|
||||
// .qos(1)
|
||||
.build();
|
||||
create(topicRequest);
|
||||
@@ -59,7 +59,7 @@ public class TopicService {
|
||||
// return;
|
||||
// }
|
||||
|
||||
Optional<Topic> topicOptional = findByUid(topicRequest.getUid());
|
||||
Optional<Topic> topicOptional = findByUserUid(topicRequest.getUserUid());
|
||||
if (topicOptional.isPresent()) {
|
||||
Topic topicElement = topicOptional.get();
|
||||
if (topicElement.getTopics().contains(topicRequest.getTopic())) {
|
||||
@@ -73,7 +73,7 @@ public class TopicService {
|
||||
return;
|
||||
}
|
||||
//
|
||||
topicRequest.setTid(uidUtils.getCacheSerialUid());
|
||||
topicRequest.setUid(uidUtils.getCacheSerialUid());
|
||||
//
|
||||
Topic topic = modelMapper.map(topicRequest, Topic.class);
|
||||
topic.getTopics().add(topicRequest.getTopic());
|
||||
@@ -103,7 +103,7 @@ public class TopicService {
|
||||
final String uid = clientId.split("/")[0];
|
||||
TopicRequest topicRequest = TopicRequest.builder()
|
||||
.topic(topic)
|
||||
.uid(uid)
|
||||
.userUid(uid)
|
||||
// .qos(qos)
|
||||
.build();
|
||||
topicRequest.getClientIds().add(clientId);
|
||||
@@ -155,21 +155,21 @@ public class TopicService {
|
||||
}
|
||||
}
|
||||
|
||||
@Cacheable(value = "topic", key = "#tid")
|
||||
public Optional<Topic> findByTid(String tid) {
|
||||
return topicRepository.findByTid(tid);
|
||||
@Cacheable(value = "topic", key = "#uid")
|
||||
public Optional<Topic> findByUid(String uid) {
|
||||
return topicRepository.findByUid(uid);
|
||||
}
|
||||
|
||||
@Cacheable(value = "topic", key = "#clientId", unless = "#result == null")
|
||||
public Optional<Topic> findByClientId(String clientId) {
|
||||
// 用户clientId格式: uid/client
|
||||
final String uid = clientId.split("/")[0];
|
||||
return findByUid(uid);
|
||||
return findByUserUid(uid);
|
||||
}
|
||||
|
||||
@Cacheable(value = "topic", key = "#uid", unless = "#result == null")
|
||||
public Optional<Topic> findByUid(String uid) {
|
||||
return topicRepository.findFirstByUid(uid);
|
||||
public Optional<Topic> findByUserUid(String uid) {
|
||||
return topicRepository.findFirstByUserUid(uid);
|
||||
}
|
||||
|
||||
@Cacheable(value = "topic", key = "#topic", unless="#result == null")
|
||||
@@ -181,7 +181,7 @@ public class TopicService {
|
||||
}
|
||||
|
||||
@Caching(put = {
|
||||
@CachePut(value = "topic", key = "#topic.uid")
|
||||
@CachePut(value = "topic", key = "#topic.userUid")
|
||||
})
|
||||
public Topic save(Topic topic) {
|
||||
return topicRepository.save(topic);
|
||||
@@ -189,15 +189,15 @@ public class TopicService {
|
||||
|
||||
// TODO: 需要从原先uid的缓存列表中删除,然后添加到新的uid的换成列表中
|
||||
// @CachePut(value = "topic", key = "#uid")
|
||||
public void update(String tid, String uid) {
|
||||
Optional<Topic> optionalTopic = findByTid(tid);
|
||||
public void update(String uid, String userUid) {
|
||||
Optional<Topic> optionalTopic = findByUid(uid);
|
||||
optionalTopic.ifPresent(topic -> {
|
||||
topic.setUid(uid);
|
||||
topic.setUserUid(userUid);
|
||||
topicRepository.save(topic);
|
||||
});
|
||||
}
|
||||
|
||||
@CacheEvict(value = "topic", key = "#topic.uid")
|
||||
@CacheEvict(value = "topic", key = "#topic.userUid")
|
||||
public void delete(Topic topic) {
|
||||
topicRepository.delete(topic);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2021-02-24 15:52:39
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-13 11:37:17
|
||||
* @LastEditTime: 2024-05-04 11:20:03
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -17,12 +17,10 @@ package com.bytedesk.core.uid;
|
||||
import java.util.Date;
|
||||
|
||||
import com.bytedesk.core.uid.worker.WorkerNodeType;
|
||||
import com.bytedesk.core.utils.AuditModel;
|
||||
import com.bytedesk.core.utils.AbstractEntity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -44,15 +42,10 @@ import lombok.experimental.Accessors;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Table(name = "core_uid_generator")
|
||||
public class UidGenerator extends AuditModel {
|
||||
|
||||
/**
|
||||
* Entity unique id (table unique)
|
||||
*/
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
public class UidGenerator extends AbstractEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Type of CONTAINER: HostName, ACTUAL : IP.
|
||||
*/
|
||||
@@ -66,6 +59,7 @@ public class UidGenerator extends AuditModel {
|
||||
/**
|
||||
* type of {@link WorkerNodeType}
|
||||
*/
|
||||
@Column(name = "by_type")
|
||||
private int type;
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2021-02-24 15:52:39
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-09 16:59:02
|
||||
* @LastEditTime: 2024-05-04 11:24:01
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -34,6 +34,7 @@ import com.bytedesk.core.uid.UidGenerator;
|
||||
import com.bytedesk.core.uid.UidGereratorRepository;
|
||||
// import com.bytedesk.core.uid.utils.DockerUtils;
|
||||
import com.bytedesk.core.uid.utils.NetUtils;
|
||||
import com.bytedesk.core.utils.Utils;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -97,6 +98,7 @@ public class DisposableWorkerIdAssigner implements WorkerIdAssigner {
|
||||
*/
|
||||
private UidGenerator buildWorkerNode() {
|
||||
UidGenerator workerNodeEntity = new UidGenerator();
|
||||
workerNodeEntity.setUid(Utils.getUid());
|
||||
|
||||
workerNodeEntity.setType(WorkerNodeType.ACTUAL.value());
|
||||
workerNodeEntity.setHost(NetUtils.getLocalAddress());
|
||||
@@ -109,6 +111,8 @@ public class DisposableWorkerIdAssigner implements WorkerIdAssigner {
|
||||
|
||||
private UidGenerator buildFakeWorkerNode() {
|
||||
UidGenerator workerNodeEntity = new UidGenerator();
|
||||
workerNodeEntity.setUid(Utils.getUid());
|
||||
|
||||
workerNodeEntity.setType(WorkerNodeType.FAKE.value());
|
||||
workerNodeEntity.setHost(NetUtils.getLocalAddress());
|
||||
// workerNodeEntity.setPort(System.currentTimeMillis() + "-" + new Random().nextInt(100000));
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-03-16 10:46:55
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-03-25 12:36:50
|
||||
* @LastEditTime: 2024-05-04 10:10:02
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -15,18 +15,12 @@
|
||||
package com.bytedesk.core.upload;
|
||||
|
||||
import com.bytedesk.core.rbac.user.User;
|
||||
import com.bytedesk.core.utils.AuditModel;
|
||||
import com.bytedesk.core.utils.AbstractEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.ConstraintMode;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.FetchType;
|
||||
import jakarta.persistence.ForeignKey;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -48,17 +42,13 @@ import lombok.experimental.Accessors;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Table(name = "core_upload")
|
||||
public class Upload extends AuditModel {
|
||||
public class Upload extends AbstractEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 唯一数字id,保证唯一性 替代id
|
||||
*/
|
||||
@Column(name = "uid", unique = true, nullable = false)
|
||||
private String uid;
|
||||
// @NotBlank
|
||||
// @Column(name = "uuid", unique = true, nullable = false)
|
||||
// private String uid;
|
||||
|
||||
/**
|
||||
* 文件名
|
||||
@@ -96,7 +86,7 @@ public class Upload extends AuditModel {
|
||||
*/
|
||||
@JsonIgnore
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "user_id", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
|
||||
// @JoinColumn(name = "user_id", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
|
||||
private User user;
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-18 12:35:49
|
||||
* @LastEditTime: 2024-05-04 10:18:33
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesa
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -16,9 +16,14 @@ package com.bytedesk.core.utils;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.EntityListeners;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.MappedSuperclass;
|
||||
import jakarta.persistence.Temporal;
|
||||
import jakarta.persistence.TemporalType;
|
||||
import jakarta.persistence.Version;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
|
||||
// import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
@@ -44,10 +49,23 @@ import java.util.Date;
|
||||
@Data
|
||||
@MappedSuperclass
|
||||
@EntityListeners(AuditingEntityListener.class)
|
||||
public class AuditModel implements Serializable {
|
||||
public abstract class AbstractEntity implements Serializable {
|
||||
|
||||
// @Value("${bytedesk.timezone}")
|
||||
// private static final String timezone = "GMT+8";
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
|
||||
// @NotBlank 在应用层(业务逻辑或表单验证)确保uid字段在提交时必须是非空且去除空格后有实际内容的。
|
||||
// nullable = false 通过@Column注解告知JPA,数据库中的uuid列不允许NULL值,这是一个数据库级别的约束
|
||||
@NotBlank(message = "uid is required")
|
||||
@Column(name = "uuid", unique = true, nullable = false)
|
||||
private String uid;
|
||||
|
||||
@Version
|
||||
private int version;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "created_at", updatable = false)
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-03-27 16:09:47
|
||||
* @LastEditTime: 2024-05-04 11:37:04
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -21,9 +21,11 @@ import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class BaseRequest implements Serializable {
|
||||
public abstract class BaseRequest implements Serializable {
|
||||
|
||||
public Long id;
|
||||
// public Long id;
|
||||
|
||||
private String uid;
|
||||
|
||||
public int pageNumber;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-11 16:32:08
|
||||
* @LastEditTime: 2024-05-04 10:42:31
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -16,7 +16,11 @@ package com.bytedesk.core.utils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
public class BaseResponse implements Serializable {
|
||||
|
||||
@Data
|
||||
public abstract class BaseResponse implements Serializable {
|
||||
|
||||
private String uid;
|
||||
}
|
||||
|
||||
BIN
modules/local/.DS_Store
vendored
BIN
modules/local/.DS_Store
vendored
Binary file not shown.
BIN
modules/local/src/.DS_Store
vendored
Normal file
BIN
modules/local/src/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -17,7 +17,6 @@
|
||||
|
||||
<modules>
|
||||
<module>ai</module>
|
||||
<module>blog</module>
|
||||
<module>core</module>
|
||||
<module>local</module>
|
||||
<module>service</module>
|
||||
@@ -82,7 +81,6 @@
|
||||
<artifactId>spring-boot-starter-cache</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
@@ -103,6 +101,12 @@
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-mail</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-configuration-processor -->
|
||||
<dependency>
|
||||
@@ -197,11 +201,11 @@
|
||||
|
||||
<!-- 生成随机用户:用户名、邮箱、地址等,方便测试 https://github.com/DiUS/java-faker?tab=readme-ov-file -->
|
||||
<!-- https://mvnrepository.com/artifact/com.github.javafaker/javafaker -->
|
||||
<dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>com.github.javafaker</groupId>
|
||||
<artifactId>javafaker</artifactId>
|
||||
<version>1.0.2</version>
|
||||
</dependency>
|
||||
</dependency> -->
|
||||
|
||||
<!-- -->
|
||||
<dependency>
|
||||
|
||||
BIN
modules/service/.DS_Store
vendored
BIN
modules/service/.DS_Store
vendored
Binary file not shown.
BIN
modules/service/src/.DS_Store
vendored
BIN
modules/service/src/.DS_Store
vendored
Binary file not shown.
Binary file not shown.
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:19:51
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-24 15:14:35
|
||||
* @LastEditTime: 2024-05-04 10:29:33
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -19,10 +19,15 @@ import org.hibernate.type.SqlTypes;
|
||||
|
||||
import com.bytedesk.core.constant.BdConstants;
|
||||
import com.bytedesk.core.rbac.user.User;
|
||||
import com.bytedesk.core.utils.AuditModel;
|
||||
import com.bytedesk.core.utils.AbstractEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.EntityListeners;
|
||||
import jakarta.persistence.FetchType;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -44,14 +49,12 @@ import lombok.experimental.Accessors;
|
||||
@NoArgsConstructor
|
||||
@EntityListeners({ AgentListener.class })
|
||||
@Table(name = "service_agent")
|
||||
public class Agent extends AuditModel {
|
||||
public class Agent extends AbstractEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column(name = "uuid", unique = true, nullable = false)
|
||||
private String uid;
|
||||
// @Column(name = "uuid", unique = true, nullable = false)
|
||||
// private String uid;
|
||||
|
||||
/**
|
||||
* visible to visitors
|
||||
@@ -110,7 +113,7 @@ public class Agent extends AuditModel {
|
||||
// @JsonIgnore
|
||||
// @ManyToOne(fetch = FetchType.LAZY)
|
||||
// private Organization organization;
|
||||
private String orgOid;
|
||||
private String orgUid;
|
||||
|
||||
/**
|
||||
* belongs to user
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:19:51
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-04-22 12:17:20
|
||||
* @LastEditTime: 2024-05-04 10:33:16
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -42,5 +42,5 @@ public interface AgentRepository extends JpaRepository<Agent, Long>, JpaSpecific
|
||||
Optional<Agent> findByUser_Uid(String uid);
|
||||
|
||||
// Page<Agent> findByOrganization_Oid(String oid, Pageable pageable);
|
||||
Page<Agent> findByOrgOid(String oid, Pageable pageable);
|
||||
Page<Agent> findByOrgUid(String oid, Pageable pageable);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user