Skip to content

Commit 528022e

Browse files
Thomasrludomikula
Thomasr
authored andcommitted
add gid field to get api response.
1 parent 1360ebe commit 528022e

File tree

7 files changed

+16
-0
lines changed

7 files changed

+16
-0
lines changed

server/api-service/lowcoder-domain/src/main/java/org/lowcoder/domain/group/model/Group.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public class Group extends HasIdAndAuditing implements Comparable<Group> {
4242

4343
@NotNull
4444
private String name;
45+
@Getter
46+
private String gid;
4547

4648
@Getter
4749
@NotNull

server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/bundle/BundleApiServiceImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ public Mono<BundleInfoView> publish(String bundleId) {
295295
.flatMap(permission -> bundleService.publish(bundleId)
296296
.map(bundleUpdated -> BundleInfoView.builder()
297297
.bundleId(bundleUpdated.getId())
298+
.bundleGid(bundleUpdated.getGid())
298299
.name(bundleUpdated.getName())
299300
.editingBundleDSL(bundleUpdated.getEditingBundleDSL())
300301
.publishedBundleDSL(bundleUpdated.getPublishedBundleDSL())
@@ -423,6 +424,7 @@ public Mono<BundleInfoView> getPublishedBundle(String bundleId, BundleRequestTyp
423424
Bundle bundle = tuple.getT2();
424425
return BundleInfoView.builder()
425426
.bundleId(bundle.getId())
427+
.bundleGid(bundle.getGid())
426428
.name(bundle.getName())
427429
.title(bundle.getTitle())
428430
.category(bundle.getCategory())
@@ -448,6 +450,7 @@ public Mono<BundleInfoView> getEditingBundle(String bundleId) {
448450
Bundle bundle = tuple.getT2();
449451
return BundleInfoView.builder()
450452
.bundleId(bundle.getId())
453+
.bundleGid(bundle.getGid())
451454
.name(bundle.getName())
452455
.title(bundle.getTitle())
453456
.category(bundle.getCategory())

server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/bundle/view/MarketplaceBundleInfoView.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public class MarketplaceBundleInfoView {
2525

2626
// Bundle details
2727
private final String bundleId;
28+
private final String bundleGid;
2829
private final String name;
2930
private final long createAt;
3031
private final String createBy;

server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/UserHomeApiServiceImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ public Flux<BundleInfoView> getAllAuthorisedBundles4CurrentOrgMember(@Nullable B
303303

304304
BundleInfoView bundleInfoView = BundleInfoView.builder()
305305
.bundleId(bundle.getId())
306+
.bundleGid(bundle.getGid())
306307
.image(bundle.getImage())
307308
.name(bundle.getName())
308309
.title(bundle.getTitle())
@@ -489,6 +490,7 @@ public Flux<MarketplaceBundleInfoView> getAllMarketplaceBundles() {
489490

490491
return MarketplaceBundleInfoView.builder()
491492
.bundleId(bundle.getId())
493+
.bundleGid(bundle.getGid())
492494
.name(bundle.getName())
493495
.bundleStatus(bundle.getBundleStatus())
494496
.orgId(bundle.getOrganizationId())
@@ -541,6 +543,7 @@ public Flux<MarketplaceBundleInfoView> getAllAgencyProfileBundles() {
541543
Map<String, Organization> orgMap = tuple.getT3();
542544
return MarketplaceBundleInfoView.builder()
543545
.bundleId(bundle.getId())
546+
.bundleGid(bundle.getGid())
544547
.name(bundle.getName())
545548
.bundleStatus(bundle.getBundleStatus())
546549
.orgId(bundle.getOrganizationId())

server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/usermanagement/GroupApiServiceImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import java.util.Map;
1414
import java.util.Objects;
1515

16+
import com.github.f4b6a3.uuid.UuidCreator;
1617
import lombok.RequiredArgsConstructor;
1718
import org.lowcoder.api.bizthreshold.AbstractBizThresholdChecker;
1819
import org.lowcoder.api.home.SessionUserService;
@@ -229,6 +230,7 @@ public Mono<Group> create(CreateGroupRequest createGroupRequest) {
229230
.flatMap(orgMember -> {
230231
String orgId = orgMember.getOrgId();
231232
Group group = new Group();
233+
group.setGid(UuidCreator.getTimeOrderedEpoch().toString());
232234
group.setOrganizationId(orgId);
233235
group.setName(createGroupRequest.getName());
234236
group.setDynamicRule(createGroupRequest.getDynamicRule());

server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/usermanagement/OrganizationController.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
import java.util.List;
44

5+
import com.github.f4b6a3.uuid.UuidCreator;
56
import jakarta.validation.Valid;
67

8+
import org.apache.commons.lang.StringUtils;
79
import org.lowcoder.api.authentication.dto.OrganizationDomainCheckResult;
810
import org.lowcoder.api.framework.view.ResponseView;
911
import org.lowcoder.api.usermanagement.view.OrgMemberListView;
@@ -39,6 +41,7 @@ public class OrganizationController implements OrganizationEndpoints
3941

4042
@Override
4143
public Mono<ResponseView<OrgView>> create(@Valid @RequestBody Organization organization) {
44+
if(StringUtils.isEmpty(organization.getGid())) organization.setGid(UuidCreator.getTimeOrderedEpoch().toString());
4245
return orgApiService.create(organization)
4346
.map(ResponseView::success);
4447
}

server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/usermanagement/view/GroupView.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
public class GroupView {
1515

1616
private String groupId;
17+
private String groupGid;
1718
private String groupName;
1819
private boolean allUsersGroup;
1920
private boolean isDevGroup;
@@ -28,6 +29,7 @@ public static Mono<GroupView> from(Group group, String memberRole) {
2829
Locale locale = LocaleUtils.getLocale(contextView);
2930
GroupView groupView = GroupView.builder()
3031
.groupId(group.getId())
32+
.groupGid(group.getGid())
3133
.groupName(group.getName(locale))
3234
.allUsersGroup(group.isAllUsersGroup())
3335
.isDevGroup(group.isDevGroup())

0 commit comments

Comments
 (0)