• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

trydofor / professional-wings / #125

31 Aug 2024 04:46AM UTC coverage: 63.579% (+0.7%) from 62.919%
#125

push

web-flow
Merge pull request #290 from trydofor/develop

3.2.130

1428 of 2191 new or added lines in 106 files covered. (65.18%)

41 existing lines in 24 files now uncovered.

12923 of 20326 relevant lines covered (63.58%)

0.64 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.33
/wings/warlock/src/main/java/pro/fessional/wings/warlock/service/other/TerminalJournalService.java
1
package pro.fessional.wings.warlock.service.other;
2

3
import org.jetbrains.annotations.NotNull;
4
import org.jetbrains.annotations.Nullable;
5
import pro.fessional.mirana.text.JsonTemplate;
6
import pro.fessional.wings.faceless.database.manual.single.modify.commitjournal.CommitJournalModify;
7
import pro.fessional.wings.faceless.service.journal.impl.DefaultJournalService;
8
import pro.fessional.wings.faceless.service.lightid.BlockIdProvider;
9
import pro.fessional.wings.faceless.service.lightid.LightIdService;
10
import pro.fessional.wings.slardar.context.TerminalContext;
11

12
import java.util.function.Function;
13

14
/**
15
 * @author trydofor
16
 * @since 2019-08-15
17
 */
18
public class TerminalJournalService extends DefaultJournalService {
19

20
    public TerminalJournalService(LightIdService ids, BlockIdProvider bid, CommitJournalModify mod) {
21
        super(ids, bid, mod);
1✔
22
    }
1✔
23

24
    @Override
25
    @NotNull
26
    public Journal create(long parentId, @NotNull String eventName, @Nullable String loginInfo, @Nullable String targetKey, @Nullable String otherInfo) {
NEW
27
        return super.create(parentId, eventName, terminal(loginInfo), targetKey, otherInfo);
×
28
    }
29

30
    @Override
31
    @NotNull
32
    public <R> R submit(@NotNull String eventName, @Nullable String loginInfo, @Nullable String targetKey, @Nullable String otherInfo, @NotNull Function<Journal, R> commitSet) {
33
        return super.submit(eventName, terminal(loginInfo), targetKey, otherInfo, commitSet);
1✔
34
    }
35

36
    private String terminal(String loginInfo) {
37
        if (loginInfo == null || loginInfo.isBlank()) {
1✔
38
            final TerminalContext.Context ctx = TerminalContext.get(false);
1✔
39
            if (!ctx.isNull()) {
1✔
40
                loginInfo = JsonTemplate.obj(obj -> {
1✔
41
                    obj.putVal("userId", ctx.getUserId());
1✔
42
                    obj.putVal("locale", ctx.getLocale().toLanguageTag());
1✔
43
                    obj.putVal("zoneid", ctx.getZoneId().getId());
1✔
44
                    obj.putVal("authType", ctx.getAuthType().name());
1✔
45
                    obj.putVal("username", ctx.getUsername());
1✔
46
                });
1✔
47
            }
48
        }
49

50
        return loginInfo;
1✔
51
    }
52
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc