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).

!7

concept PostedLine {
  S globalID = aGlobalIDUnlessLoading();
  S channelID;
  S text;
  bool isImage;
  S context; // not null if post successful
  long posted; // timestamp - not 0 if post successful
}

cm GPostedLines > DynCRUD<PostedLine> {
  // API
  
  // returns ID of entry
  S postingLine(S channelID, S text) {
    ret cnew PostedLine(+channelID, +text).globalID;
  }
  
  S postingImage(S channelID, S imageURL) {
    ret cnew PostedLine(+channelID, text := imageURL, isImage := true).globalID;
  }
  
  void donePosting(S postID, S context) {
    cset(conceptWhere PostedLine(globalID := postID),
      posted := now(),
      +context);
  }
  
  void deleteAll {
    print("Deleting all lines.");
    cdelete PostedLine();
  }
}

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: 273 / 95371
Version history: 2 change(s)
Referenced in: [show references]