fix: bindings for excel module

This commit is contained in:
2025-03-13 14:24:38 +07:00
parent 7ae38ccd78
commit a475be9cb2
14 changed files with 360 additions and 550 deletions

View File

@@ -1,4 +1,3 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT

View File

@@ -1,4 +1,3 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
@@ -7,37 +6,23 @@
import {Create as $Create} from "@wailsio/runtime";
export class Author {
/**
* Creates a new Author instance.
* @param {Partial<Author>} [$$source = {}] - The source object to create the Author.
*/
constructor($$source = {}) {
"Id": number;
"Name": string;
"Posts": Post[];
"Comments": Comment[];
/** Creates a new Author instance. */
constructor($$source: Partial<Author> = {}) {
if (!("Id" in $$source)) {
/**
* @member
* @type {number}
*/
this["Id"] = 0;
}
if (!("Name" in $$source)) {
/**
* @member
* @type {string}
*/
this["Name"] = "";
}
if (!("Posts" in $$source)) {
/**
* @member
* @type {Post[]}
*/
this["Posts"] = [];
}
if (!("Comments" in $$source)) {
/**
* @member
* @type {Comment[]}
*/
this["Comments"] = [];
}
@@ -46,10 +31,8 @@ export class Author {
/**
* Creates a new Author instance from a string or object.
* @param {any} [$$source = {}]
* @returns {Author}
*/
static createFrom($$source = {}) {
static createFrom($$source: any = {}): Author {
const $$createField2_0 = $$createType1;
const $$createField3_0 = $$createType3;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
@@ -59,49 +42,32 @@ export class Author {
if ("Comments" in $$parsedSource) {
$$parsedSource["Comments"] = $$createField3_0($$parsedSource["Comments"]);
}
return new Author(/** @type {Partial<Author>} */($$parsedSource));
return new Author($$parsedSource as Partial<Author>);
}
}
export class Comment {
/**
* Creates a new Comment instance.
* @param {Partial<Comment>} [$$source = {}] - The source object to create the Comment.
*/
constructor($$source = {}) {
"Id": number;
"Text": string;
"AuthorId": number;
"Author": Author;
"Posts": Post[];
/** Creates a new Comment instance. */
constructor($$source: Partial<Comment> = {}) {
if (!("Id" in $$source)) {
/**
* @member
* @type {number}
*/
this["Id"] = 0;
}
if (!("Text" in $$source)) {
/**
* @member
* @type {string}
*/
this["Text"] = "";
}
if (!("AuthorId" in $$source)) {
/**
* @member
* @type {number}
*/
this["AuthorId"] = 0;
}
if (!("Author" in $$source)) {
/**
* @member
* @type {Author}
*/
this["Author"] = (new Author());
}
if (!("Posts" in $$source)) {
/**
* @member
* @type {Post[]}
*/
this["Posts"] = [];
}
@@ -110,10 +76,8 @@ export class Comment {
/**
* Creates a new Comment instance from a string or object.
* @param {any} [$$source = {}]
* @returns {Comment}
*/
static createFrom($$source = {}) {
static createFrom($$source: any = {}): Comment {
const $$createField3_0 = $$createType4;
const $$createField4_0 = $$createType1;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
@@ -123,77 +87,48 @@ export class Comment {
if ("Posts" in $$parsedSource) {
$$parsedSource["Posts"] = $$createField4_0($$parsedSource["Posts"]);
}
return new Comment(/** @type {Partial<Comment>} */($$parsedSource));
return new Comment($$parsedSource as Partial<Comment>);
}
}
export class Post {
/**
* Creates a new Post instance.
* @param {Partial<Post>} [$$source = {}] - The source object to create the Post.
*/
constructor($$source = {}) {
"Id": number;
"Text": string;
"Deadline": number;
"CreatedAt": number;
"AuthorId": number;
"Author": Author;
"PostTypeId": number;
"PostType": PostType;
"Comments": Comment[];
/** Creates a new Post instance. */
constructor($$source: Partial<Post> = {}) {
if (!("Id" in $$source)) {
/**
* @member
* @type {number}
*/
this["Id"] = 0;
}
if (!("Text" in $$source)) {
/**
* @member
* @type {string}
*/
this["Text"] = "";
}
if (!("Deadline" in $$source)) {
/**
* @member
* @type {number}
*/
this["Deadline"] = 0;
}
if (!("CreatedAt" in $$source)) {
/**
* @member
* @type {number}
*/
this["CreatedAt"] = 0;
}
if (!("AuthorId" in $$source)) {
/**
* @member
* @type {number}
*/
this["AuthorId"] = 0;
}
if (!("Author" in $$source)) {
/**
* @member
* @type {Author}
*/
this["Author"] = (new Author());
}
if (!("PostTypeId" in $$source)) {
/**
* @member
* @type {number}
*/
this["PostTypeId"] = 0;
}
if (!("PostType" in $$source)) {
/**
* @member
* @type {PostType}
*/
this["PostType"] = (new PostType());
}
if (!("Comments" in $$source)) {
/**
* @member
* @type {Comment[]}
*/
this["Comments"] = [];
}
@@ -202,10 +137,8 @@ export class Post {
/**
* Creates a new Post instance from a string or object.
* @param {any} [$$source = {}]
* @returns {Post}
*/
static createFrom($$source = {}) {
static createFrom($$source: any = {}): Post {
const $$createField5_0 = $$createType4;
const $$createField7_0 = $$createType5;
const $$createField8_0 = $$createType3;
@@ -219,28 +152,20 @@ export class Post {
if ("Comments" in $$parsedSource) {
$$parsedSource["Comments"] = $$createField8_0($$parsedSource["Comments"]);
}
return new Post(/** @type {Partial<Post>} */($$parsedSource));
return new Post($$parsedSource as Partial<Post>);
}
}
export class PostType {
/**
* Creates a new PostType instance.
* @param {Partial<PostType>} [$$source = {}] - The source object to create the PostType.
*/
constructor($$source = {}) {
"Id": number;
"Name": string;
/** Creates a new PostType instance. */
constructor($$source: Partial<PostType> = {}) {
if (!("Id" in $$source)) {
/**
* @member
* @type {number}
*/
this["Id"] = 0;
}
if (!("Name" in $$source)) {
/**
* @member
* @type {string}
*/
this["Name"] = "";
}
@@ -249,12 +174,10 @@ export class PostType {
/**
* Creates a new PostType instance from a string or object.
* @param {any} [$$source = {}]
* @returns {PostType}
*/
static createFrom($$source = {}) {
static createFrom($$source: any = {}): PostType {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new PostType(/** @type {Partial<PostType>} */($$parsedSource));
return new PostType($$parsedSource as Partial<PostType>);
}
}

View File

@@ -1,101 +0,0 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as models$0 from "../models/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";
/**
* @returns {Promise<number> & { cancel(): void }}
*/
export function Count() {
let $resultPromise = /** @type {any} */($Call.ByID(3969879864));
return $resultPromise;
}
/**
* @param {$models.Author} item
* @returns {Promise<$models.Author> & { cancel(): void }}
*/
export function Create(item) {
let $resultPromise = /** @type {any} */($Call.ByID(3684602449, item));
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
return $$createType0($result);
}));
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
/**
* @param {number} id
* @returns {Promise<void> & { cancel(): void }}
*/
export function Delete(id) {
let $resultPromise = /** @type {any} */($Call.ByID(2096845974, id));
return $resultPromise;
}
/**
* @returns {Promise<($models.Author | null)[]> & { cancel(): void }}
*/
export function GetAll() {
let $resultPromise = /** @type {any} */($Call.ByID(3248293926));
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
return $$createType2($result);
}));
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
/**
* @param {number} id
* @returns {Promise<$models.Author | null> & { cancel(): void }}
*/
export function GetById(id) {
let $resultPromise = /** @type {any} */($Call.ByID(1703016211, id));
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
return $$createType1($result);
}));
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
/**
* @param {{ [_: string]: string }} fieldsSortOrder
* @returns {Promise<($models.Author | null)[]> & { cancel(): void }}
*/
export function SortedByOrder(fieldsSortOrder) {
let $resultPromise = /** @type {any} */($Call.ByID(3046628691, fieldsSortOrder));
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
return $$createType2($result);
}));
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
/**
* @param {$models.Author} item
* @returns {Promise<$models.Author> & { cancel(): void }}
*/
export function Update(item) {
let $resultPromise = /** @type {any} */($Call.ByID(2240704960, item));
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
return $$createType0($result);
}));
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
// Private type creation functions
const $$createType0 = models$0.Author.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $Create.Array($$createType1);

View File

@@ -0,0 +1,74 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as models$0 from "../models/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";
export function Count(): Promise<number> & { cancel(): void } {
let $resultPromise = $Call.ByID(3969879864) as any;
return $resultPromise;
}
export function Create(item: $models.Author): Promise<$models.Author> & { cancel(): void } {
let $resultPromise = $Call.ByID(3684602449, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Delete(id: number): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(2096845974, id) as any;
return $resultPromise;
}
export function GetAll(): Promise<($models.Author | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(3248293926) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function GetById(id: number): Promise<$models.Author | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(1703016211, id) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType1($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function SortedByOrder(fieldsSortOrder: { [_: string]: string }): Promise<($models.Author | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(3046628691, fieldsSortOrder) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Update(item: $models.Author): Promise<$models.Author> & { cancel(): void } {
let $resultPromise = $Call.ByID(2240704960, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
// Private type creation functions
const $$createType0 = models$0.Author.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $Create.Array($$createType1);

View File

@@ -1,101 +0,0 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as models$0 from "../models/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";
/**
* @returns {Promise<number> & { cancel(): void }}
*/
export function Count() {
let $resultPromise = /** @type {any} */($Call.ByID(3225397984));
return $resultPromise;
}
/**
* @param {$models.Comment} item
* @returns {Promise<$models.Comment> & { cancel(): void }}
*/
export function Create(item) {
let $resultPromise = /** @type {any} */($Call.ByID(4239106089, item));
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
return $$createType0($result);
}));
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
/**
* @param {number} id
* @returns {Promise<void> & { cancel(): void }}
*/
export function Delete(id) {
let $resultPromise = /** @type {any} */($Call.ByID(2553503582, id));
return $resultPromise;
}
/**
* @returns {Promise<($models.Comment | null)[]> & { cancel(): void }}
*/
export function GetAll() {
let $resultPromise = /** @type {any} */($Call.ByID(1805763390));
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
return $$createType2($result);
}));
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
/**
* @param {number} id
* @returns {Promise<$models.Comment | null> & { cancel(): void }}
*/
export function GetById(id) {
let $resultPromise = /** @type {any} */($Call.ByID(3217823099, id));
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
return $$createType1($result);
}));
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
/**
* @param {{ [_: string]: string }} fieldsSortOrder
* @returns {Promise<($models.Comment | null)[]> & { cancel(): void }}
*/
export function SortedByOrder(fieldsSortOrder) {
let $resultPromise = /** @type {any} */($Call.ByID(4244533291, fieldsSortOrder));
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
return $$createType2($result);
}));
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
/**
* @param {$models.Comment} item
* @returns {Promise<$models.Comment> & { cancel(): void }}
*/
export function Update(item) {
let $resultPromise = /** @type {any} */($Call.ByID(3080970936, item));
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
return $$createType0($result);
}));
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
// Private type creation functions
const $$createType0 = models$0.Comment.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $Create.Array($$createType1);

View File

@@ -0,0 +1,74 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as models$0 from "../models/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";
export function Count(): Promise<number> & { cancel(): void } {
let $resultPromise = $Call.ByID(3225397984) as any;
return $resultPromise;
}
export function Create(item: $models.Comment): Promise<$models.Comment> & { cancel(): void } {
let $resultPromise = $Call.ByID(4239106089, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Delete(id: number): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(2553503582, id) as any;
return $resultPromise;
}
export function GetAll(): Promise<($models.Comment | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(1805763390) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function GetById(id: number): Promise<$models.Comment | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(3217823099, id) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType1($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function SortedByOrder(fieldsSortOrder: { [_: string]: string }): Promise<($models.Comment | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(4244533291, fieldsSortOrder) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Update(item: $models.Comment): Promise<$models.Comment> & { cancel(): void } {
let $resultPromise = $Call.ByID(3080970936, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
// Private type creation functions
const $$createType0 = models$0.Comment.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $Create.Array($$createType1);

View File

@@ -0,0 +1,16 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
export function ExportAllEntities(): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(794946560) as any;
return $resultPromise;
}
export function ImportAllEntities(): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(2992267629) as any;
return $resultPromise;
}

View File

@@ -1,14 +1,15 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import * as AuthorService from "./authorservice.js";
import * as CommentService from "./commentservice.js";
import * as ExcelModule from "./excelmodule.js";
import * as PostService from "./postservice.js";
import * as PostTypeService from "./posttypeservice.js";
export {
AuthorService,
CommentService,
ExcelModule,
PostService,
PostTypeService
};

View File

@@ -1,4 +1,3 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
@@ -11,25 +10,13 @@ import {Create as $Create} from "@wailsio/runtime";
import * as models$0 from "../models/models.js";
export const Author = models$0.Author;
/**
* @typedef {models$0.Author} Author
*/
export type Author = models$0.Author;
export const Comment = models$0.Comment;
/**
* @typedef {models$0.Comment} Comment
*/
export type Comment = models$0.Comment;
export const Post = models$0.Post;
/**
* @typedef {models$0.Post} Post
*/
export type Post = models$0.Post;
export const PostType = models$0.PostType;
/**
* @typedef {models$0.PostType} PostType
*/
export type PostType = models$0.PostType;

View File

@@ -1,109 +0,0 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as models$0 from "../models/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";
/**
* @returns {Promise<number> & { cancel(): void }}
*/
export function Count() {
let $resultPromise = /** @type {any} */($Call.ByID(3109924027));
return $resultPromise;
}
/**
* @param {$models.Post} item
* @returns {Promise<$models.Post> & { cancel(): void }}
*/
export function Create(item) {
let $resultPromise = /** @type {any} */($Call.ByID(1443399856, item));
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
return $$createType0($result);
}));
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
/**
* @param {number} id
* @returns {Promise<void> & { cancel(): void }}
*/
export function Delete(id) {
let $resultPromise = /** @type {any} */($Call.ByID(2924549135, id));
return $resultPromise;
}
/**
* @returns {Promise<void> & { cancel(): void }}
*/
export function ExportToExcel() {
let $resultPromise = /** @type {any} */($Call.ByID(75322242));
return $resultPromise;
}
/**
* @returns {Promise<($models.Post | null)[]> & { cancel(): void }}
*/
export function GetAll() {
let $resultPromise = /** @type {any} */($Call.ByID(65691059));
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
return $$createType2($result);
}));
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
/**
* @param {number} id
* @returns {Promise<$models.Post | null> & { cancel(): void }}
*/
export function GetById(id) {
let $resultPromise = /** @type {any} */($Call.ByID(4074736792, id));
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
return $$createType1($result);
}));
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
/**
* @param {{ [_: string]: string }} fieldsSortOrder
* @returns {Promise<($models.Post | null)[]> & { cancel(): void }}
*/
export function SortedByOrder(fieldsSortOrder) {
let $resultPromise = /** @type {any} */($Call.ByID(471862744, fieldsSortOrder));
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
return $$createType2($result);
}));
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
/**
* @param {$models.Post} item
* @returns {Promise<$models.Post> & { cancel(): void }}
*/
export function Update(item) {
let $resultPromise = /** @type {any} */($Call.ByID(137798821, item));
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
return $$createType0($result);
}));
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
// Private type creation functions
const $$createType0 = models$0.Post.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $Create.Array($$createType1);

View File

@@ -0,0 +1,74 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as models$0 from "../models/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";
export function Count(): Promise<number> & { cancel(): void } {
let $resultPromise = $Call.ByID(3109924027) as any;
return $resultPromise;
}
export function Create(item: $models.Post): Promise<$models.Post> & { cancel(): void } {
let $resultPromise = $Call.ByID(1443399856, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Delete(id: number): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(2924549135, id) as any;
return $resultPromise;
}
export function GetAll(): Promise<($models.Post | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(65691059) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function GetById(id: number): Promise<$models.Post | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(4074736792, id) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType1($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function SortedByOrder(fieldsSortOrder: { [_: string]: string }): Promise<($models.Post | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(471862744, fieldsSortOrder) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Update(item: $models.Post): Promise<$models.Post> & { cancel(): void } {
let $resultPromise = $Call.ByID(137798821, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
// Private type creation functions
const $$createType0 = models$0.Post.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $Create.Array($$createType1);

View File

@@ -1,101 +0,0 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as models$0 from "../models/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";
/**
* @returns {Promise<number> & { cancel(): void }}
*/
export function Count() {
let $resultPromise = /** @type {any} */($Call.ByID(554487955));
return $resultPromise;
}
/**
* @param {$models.PostType} item
* @returns {Promise<$models.PostType> & { cancel(): void }}
*/
export function Create(item) {
let $resultPromise = /** @type {any} */($Call.ByID(1092898136, item));
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
return $$createType0($result);
}));
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
/**
* @param {number} id
* @returns {Promise<void> & { cancel(): void }}
*/
export function Delete(id) {
let $resultPromise = /** @type {any} */($Call.ByID(2114913543, id));
return $resultPromise;
}
/**
* @returns {Promise<($models.PostType | null)[]> & { cancel(): void }}
*/
export function GetAll() {
let $resultPromise = /** @type {any} */($Call.ByID(416231387));
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
return $$createType2($result);
}));
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
/**
* @param {number} id
* @returns {Promise<$models.PostType | null> & { cancel(): void }}
*/
export function GetById(id) {
let $resultPromise = /** @type {any} */($Call.ByID(3237123344, id));
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
return $$createType1($result);
}));
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
/**
* @param {{ [_: string]: string }} fieldsSortOrder
* @returns {Promise<($models.PostType | null)[]> & { cancel(): void }}
*/
export function SortedByOrder(fieldsSortOrder) {
let $resultPromise = /** @type {any} */($Call.ByID(1097313920, fieldsSortOrder));
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
return $$createType2($result);
}));
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
/**
* @param {$models.PostType} item
* @returns {Promise<$models.PostType> & { cancel(): void }}
*/
export function Update(item) {
let $resultPromise = /** @type {any} */($Call.ByID(2773888269, item));
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
return $$createType0($result);
}));
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
// Private type creation functions
const $$createType0 = models$0.PostType.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $Create.Array($$createType1);

View File

@@ -0,0 +1,74 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as models$0 from "../models/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";
export function Count(): Promise<number> & { cancel(): void } {
let $resultPromise = $Call.ByID(554487955) as any;
return $resultPromise;
}
export function Create(item: $models.PostType): Promise<$models.PostType> & { cancel(): void } {
let $resultPromise = $Call.ByID(1092898136, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Delete(id: number): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(2114913543, id) as any;
return $resultPromise;
}
export function GetAll(): Promise<($models.PostType | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(416231387) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function GetById(id: number): Promise<$models.PostType | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(3237123344, id) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType1($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function SortedByOrder(fieldsSortOrder: { [_: string]: string }): Promise<($models.PostType | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(1097313920, fieldsSortOrder) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Update(item: $models.PostType): Promise<$models.PostType> & { cancel(): void } {
let $resultPromise = $Call.ByID(2773888269, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
// Private type creation functions
const $$createType0 = models$0.PostType.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $Create.Array($$createType1);

View File

@@ -11,7 +11,7 @@ type ExcelModule struct{}
var ExcelService = application.NewService(&ExcelModule{})
func ImportAllEntities() error {
func (s *ExcelModule) ImportAllEntities() error {
postTypeService := PostTypeService{}
filepath, err := dialogs.OpenFileDialog("Импорт данных")
if err != nil {
@@ -41,7 +41,7 @@ func ImportAllEntities() error {
return nil
}
func ExportAllEntities() error {
func (s *ExcelModule) ExportAllEntities() error {
postService := PostService{}
exporter := excel.Exporter[Post]{
SheetName: "Посты",