Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

34
LINES

< > BotCompany Repo | #1022603 // Gazelle: Posted Lines

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 1113K of libraries. Click here for Pure Java version (13504L/68K).

1  
!7
2  
3  
concept PostedLine {
4  
  S globalID = aGlobalIDUnlessLoading();
5  
  S channelID;
6  
  S text;
7  
  bool isImage;
8  
  S context; // not null if post successful
9  
  long posted; // timestamp - not 0 if post successful
10  
}
11  
12  
cm GPostedLines > DynCRUD<PostedLine> {
13  
  // API
14  
  
15  
  // returns ID of entry
16  
  S postingLine(S channelID, S text) {
17  
    ret cnew PostedLine(+channelID, +text).globalID;
18  
  }
19  
  
20  
  S postingImage(S channelID, S imageURL) {
21  
    ret cnew PostedLine(+channelID, text := imageURL, isImage := true).globalID;
22  
  }
23  
  
24  
  void donePosting(S postID, S context) {
25  
    cset(conceptWhere PostedLine(globalID := postID),
26  
      posted := now(),
27  
      +context);
28  
  }
29  
  
30  
  void deleteAll {
31  
    print("Deleting all lines.");
32  
    cdelete PostedLine();
33  
  }
34  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022603
Snippet name: Gazelle: Posted Lines
Eternal ID of this version: #1022603/3
Text MD5: 11d10f6d8ecbb0dd8da5cab8c56f4bc0
Transpilation MD5: 0669cc4158e947d5c66ff03341cfa1b7
Author: stefan
Category: javax / gazelle
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-05 02:17:09
Source code size: 777 bytes / 34 lines
Pitched / IR pitched: No / No
Views / Downloads: 213 / 94720
Version history: 2 change(s)
Referenced in: [show references]