update modules/core: mod 9 files

This commit is contained in:
jack ning
2025-07-16 16:19:00 +08:00
parent 49fc7efe9f
commit 55a039fb1f
8 changed files with 89 additions and 12 deletions

View File

@@ -2,7 +2,7 @@
* @Author: jackning 270580156@qq.com
* @Date: 2024-01-29 16:20:17
* @LastEditors: jackning 270580156@qq.com
* @LastEditTime: 2025-07-02 14:07:11
* @LastEditTime: 2025-07-16 16:13: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.
@@ -109,6 +109,11 @@ public class OrganizationEntity extends BaseEntityNoOrg {
// 会员截止日期
private Date vipExpireDate;
// 是否启用,状态:启用/禁用
@Builder.Default
@Column(name = "is_enabled")
private Boolean enabled = true;
@ManyToOne(fetch = FetchType.LAZY)
@JsonBackReference

View File

@@ -2,7 +2,7 @@
* @Author: jackning 270580156@qq.com
* @Date: 2024-02-06 16:02:35
* @LastEditors: jackning 270580156@qq.com
* @LastEditTime: 2025-07-02 14:07:52
* @LastEditTime: 2025-07-16 16:14:30
* @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.
@@ -70,4 +70,7 @@ public class OrganizationRequest extends BaseRequest {
// 会员截止日期
private Date vipExpireDate;
// 是否启用,状态:启用/禁用
private Boolean enabled;
}

View File

@@ -2,7 +2,7 @@
* @Author: jackning 270580156@qq.com
* @Date: 2024-02-01 21:20:57
* @LastEditors: jackning 270580156@qq.com
* @LastEditTime: 2025-07-02 14:06:40
* @LastEditTime: 2025-07-16 16:14:36
* @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.
@@ -72,4 +72,7 @@ public class OrganizationResponse extends BaseResponse {
// 会员截止日期
private Date vipExpireDate;
// 是否启用,状态:启用/禁用
private Boolean enabled;
}

View File

@@ -2,7 +2,7 @@
* @Author: jackning 270580156@qq.com
* @Date: 2024-01-29 16:20:17
* @LastEditors: jackning 270580156@qq.com
* @LastEditTime: 2025-07-15 16:15:07
* @LastEditTime: 2025-07-16 16:17: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.
@@ -77,6 +77,16 @@ public class OrganizationRestController extends BaseRestController<OrganizationR
return ResponseEntity.ok(JsonResult.success(response));
}
// create/by/admin
@ActionAnnotation(title = "组织", action = "新建", description = "organization create by admin")
@PostMapping("/create/by/admin")
public ResponseEntity<?> createByAdmin(@RequestBody OrganizationRequest request) {
//
OrganizationResponse response = organizationRestService.createByAdmin(request);
//
return ResponseEntity.ok(JsonResult.success(response));
}
@ActionAnnotation(title = "组织", action = "更新", description = "organization update")
@PostMapping("/update")
public ResponseEntity<?> update(@RequestBody OrganizationRequest request) {

View File

@@ -2,7 +2,7 @@
* @Author: jackning 270580156@qq.com
* @Date: 2024-01-29 16:20:17
* @LastEditors: jackning 270580156@qq.com
* @LastEditTime: 2025-06-09 10:33:00
* @LastEditTime: 2025-07-16 16:18:29
* @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,8 +42,6 @@ public class OrganizationRestService extends BaseRestService<OrganizationEntity,
private final UserService userService;
// private final RoleService roleService;
private final OrganizationRepository organizationRepository;
private final UidUtils uidUtils;
@@ -101,7 +99,19 @@ public class OrganizationRestService extends BaseRestService<OrganizationEntity,
userService.addRoleAdmin(user);
//
return convertToResponse(savedOrganization);
}
// 超级管理员创建组织
public OrganizationResponse createByAdmin(OrganizationRequest organizationRequest) {
//
OrganizationEntity organization = modelMapper.map(organizationRequest, OrganizationEntity.class);
organization.setUid(uidUtils.getUid());
//
OrganizationEntity savedOrganization = save(organization);
if (savedOrganization == null) {
throw new RuntimeException("Failed to create organization.");
}
return convertToResponse(savedOrganization);
}
public OrganizationResponse update(OrganizationRequest organizationRequest) {