feat: basic ui
This commit is contained in:
4
frontend/bindings/app/internal/models/index.ts
Normal file
4
frontend/bindings/app/internal/models/index.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||||
|
// This file is automatically generated. DO NOT EDIT
|
||||||
|
|
||||||
|
export * from "./models.js";
|
||||||
190
frontend/bindings/app/internal/models/models.ts
Normal file
190
frontend/bindings/app/internal/models/models.ts
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
// 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 {Create as $Create} from "@wailsio/runtime";
|
||||||
|
|
||||||
|
export class Author {
|
||||||
|
"Id": number;
|
||||||
|
"Name": string;
|
||||||
|
"Posts": Post[];
|
||||||
|
"Comments": Comment[];
|
||||||
|
|
||||||
|
/** Creates a new Author instance. */
|
||||||
|
constructor($$source: Partial<Author> = {}) {
|
||||||
|
if (!("Id" in $$source)) {
|
||||||
|
this["Id"] = 0;
|
||||||
|
}
|
||||||
|
if (!("Name" in $$source)) {
|
||||||
|
this["Name"] = "";
|
||||||
|
}
|
||||||
|
if (!("Posts" in $$source)) {
|
||||||
|
this["Posts"] = [];
|
||||||
|
}
|
||||||
|
if (!("Comments" in $$source)) {
|
||||||
|
this["Comments"] = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.assign(this, $$source);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new Author instance from a string or object.
|
||||||
|
*/
|
||||||
|
static createFrom($$source: any = {}): Author {
|
||||||
|
const $$createField2_0 = $$createType1;
|
||||||
|
const $$createField3_0 = $$createType3;
|
||||||
|
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||||
|
if ("Posts" in $$parsedSource) {
|
||||||
|
$$parsedSource["Posts"] = $$createField2_0($$parsedSource["Posts"]);
|
||||||
|
}
|
||||||
|
if ("Comments" in $$parsedSource) {
|
||||||
|
$$parsedSource["Comments"] = $$createField3_0($$parsedSource["Comments"]);
|
||||||
|
}
|
||||||
|
return new Author($$parsedSource as Partial<Author>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Comment {
|
||||||
|
"Id": number;
|
||||||
|
"Text": string;
|
||||||
|
"AuthorId": number;
|
||||||
|
"Author": Author;
|
||||||
|
"Posts": Post[];
|
||||||
|
|
||||||
|
/** Creates a new Comment instance. */
|
||||||
|
constructor($$source: Partial<Comment> = {}) {
|
||||||
|
if (!("Id" in $$source)) {
|
||||||
|
this["Id"] = 0;
|
||||||
|
}
|
||||||
|
if (!("Text" in $$source)) {
|
||||||
|
this["Text"] = "";
|
||||||
|
}
|
||||||
|
if (!("AuthorId" in $$source)) {
|
||||||
|
this["AuthorId"] = 0;
|
||||||
|
}
|
||||||
|
if (!("Author" in $$source)) {
|
||||||
|
this["Author"] = (new Author());
|
||||||
|
}
|
||||||
|
if (!("Posts" in $$source)) {
|
||||||
|
this["Posts"] = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.assign(this, $$source);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new Comment instance from a string or object.
|
||||||
|
*/
|
||||||
|
static createFrom($$source: any = {}): Comment {
|
||||||
|
const $$createField3_0 = $$createType4;
|
||||||
|
const $$createField4_0 = $$createType1;
|
||||||
|
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||||
|
if ("Author" in $$parsedSource) {
|
||||||
|
$$parsedSource["Author"] = $$createField3_0($$parsedSource["Author"]);
|
||||||
|
}
|
||||||
|
if ("Posts" in $$parsedSource) {
|
||||||
|
$$parsedSource["Posts"] = $$createField4_0($$parsedSource["Posts"]);
|
||||||
|
}
|
||||||
|
return new Comment($$parsedSource as Partial<Comment>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Post {
|
||||||
|
"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)) {
|
||||||
|
this["Id"] = 0;
|
||||||
|
}
|
||||||
|
if (!("Text" in $$source)) {
|
||||||
|
this["Text"] = "";
|
||||||
|
}
|
||||||
|
if (!("Deadline" in $$source)) {
|
||||||
|
this["Deadline"] = 0;
|
||||||
|
}
|
||||||
|
if (!("CreatedAt" in $$source)) {
|
||||||
|
this["CreatedAt"] = 0;
|
||||||
|
}
|
||||||
|
if (!("AuthorId" in $$source)) {
|
||||||
|
this["AuthorId"] = 0;
|
||||||
|
}
|
||||||
|
if (!("Author" in $$source)) {
|
||||||
|
this["Author"] = (new Author());
|
||||||
|
}
|
||||||
|
if (!("PostTypeId" in $$source)) {
|
||||||
|
this["PostTypeId"] = 0;
|
||||||
|
}
|
||||||
|
if (!("PostType" in $$source)) {
|
||||||
|
this["PostType"] = (new PostType());
|
||||||
|
}
|
||||||
|
if (!("Comments" in $$source)) {
|
||||||
|
this["Comments"] = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.assign(this, $$source);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new Post instance from a string or object.
|
||||||
|
*/
|
||||||
|
static createFrom($$source: any = {}): Post {
|
||||||
|
const $$createField5_0 = $$createType4;
|
||||||
|
const $$createField7_0 = $$createType5;
|
||||||
|
const $$createField8_0 = $$createType3;
|
||||||
|
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||||
|
if ("Author" in $$parsedSource) {
|
||||||
|
$$parsedSource["Author"] = $$createField5_0($$parsedSource["Author"]);
|
||||||
|
}
|
||||||
|
if ("PostType" in $$parsedSource) {
|
||||||
|
$$parsedSource["PostType"] = $$createField7_0($$parsedSource["PostType"]);
|
||||||
|
}
|
||||||
|
if ("Comments" in $$parsedSource) {
|
||||||
|
$$parsedSource["Comments"] = $$createField8_0($$parsedSource["Comments"]);
|
||||||
|
}
|
||||||
|
return new Post($$parsedSource as Partial<Post>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class PostType {
|
||||||
|
"Id": number;
|
||||||
|
"Name": string;
|
||||||
|
|
||||||
|
/** Creates a new PostType instance. */
|
||||||
|
constructor($$source: Partial<PostType> = {}) {
|
||||||
|
if (!("Id" in $$source)) {
|
||||||
|
this["Id"] = 0;
|
||||||
|
}
|
||||||
|
if (!("Name" in $$source)) {
|
||||||
|
this["Name"] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.assign(this, $$source);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new PostType instance from a string or object.
|
||||||
|
*/
|
||||||
|
static createFrom($$source: any = {}): PostType {
|
||||||
|
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||||
|
return new PostType($$parsedSource as Partial<PostType>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private type creation functions
|
||||||
|
const $$createType0 = Post.createFrom;
|
||||||
|
const $$createType1 = $Create.Array($$createType0);
|
||||||
|
const $$createType2 = Comment.createFrom;
|
||||||
|
const $$createType3 = $Create.Array($$createType2);
|
||||||
|
const $$createType4 = Author.createFrom;
|
||||||
|
const $$createType5 = PostType.createFrom;
|
||||||
74
frontend/bindings/app/internal/services/authorservice.ts
Normal file
74
frontend/bindings/app/internal/services/authorservice.ts
Normal 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);
|
||||||
74
frontend/bindings/app/internal/services/commentservice.ts
Normal file
74
frontend/bindings/app/internal/services/commentservice.ts
Normal 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);
|
||||||
15
frontend/bindings/app/internal/services/index.ts
Normal file
15
frontend/bindings/app/internal/services/index.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
// 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 PostService from "./postservice.js";
|
||||||
|
import * as PostTypeService from "./posttypeservice.js";
|
||||||
|
export {
|
||||||
|
AuthorService,
|
||||||
|
CommentService,
|
||||||
|
PostService,
|
||||||
|
PostTypeService
|
||||||
|
};
|
||||||
|
|
||||||
|
export * from "./models.js";
|
||||||
22
frontend/bindings/app/internal/services/models.ts
Normal file
22
frontend/bindings/app/internal/services/models.ts
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
// 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 {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";
|
||||||
|
|
||||||
|
export const Author = models$0.Author;
|
||||||
|
export type Author = models$0.Author;
|
||||||
|
|
||||||
|
export const Comment = models$0.Comment;
|
||||||
|
export type Comment = models$0.Comment;
|
||||||
|
|
||||||
|
export const Post = models$0.Post;
|
||||||
|
export type Post = models$0.Post;
|
||||||
|
|
||||||
|
export const PostType = models$0.PostType;
|
||||||
|
export type PostType = models$0.PostType;
|
||||||
79
frontend/bindings/app/internal/services/postservice.ts
Normal file
79
frontend/bindings/app/internal/services/postservice.ts
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
// 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 ExportToExcel(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(75322242) 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);
|
||||||
79
frontend/bindings/app/internal/services/posttypeservice.ts
Normal file
79
frontend/bindings/app/internal/services/posttypeservice.ts
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
// 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 ImportFromExcel(): Promise<void> & { cancel(): void } {
|
||||||
|
let $resultPromise = $Call.ByID(1671814244) as any;
|
||||||
|
return $resultPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
@@ -2,8 +2,7 @@
|
|||||||
import { Dialog } from "primevue";
|
import { Dialog } from "primevue";
|
||||||
import { useErrorStore } from "./stores/error.store";
|
import { useErrorStore } from "./stores/error.store";
|
||||||
import { RouterView } from "vue-router";
|
import { RouterView } from "vue-router";
|
||||||
import AuthorScheme from "./author/AuthorScheme.vue";
|
import VHeader from "./components/headers/VHeader.vue";
|
||||||
import PostScheme from "./post/PostScheme.vue";
|
|
||||||
|
|
||||||
const errorStore = useErrorStore();
|
const errorStore = useErrorStore();
|
||||||
</script>
|
</script>
|
||||||
@@ -17,8 +16,8 @@ const errorStore = useErrorStore();
|
|||||||
<template #header> Ошибка </template>
|
<template #header> Ошибка </template>
|
||||||
<h1 class="text-red-500 text-2xl">{{ errorStore.message }}</h1>
|
<h1 class="text-red-500 text-2xl">{{ errorStore.message }}</h1>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
<main class="w-screen h-screen">
|
<VHeader v-if="$route?.matched?.length > 1" />
|
||||||
|
<main>
|
||||||
<RouterView />
|
<RouterView />
|
||||||
<PostScheme />
|
|
||||||
</main>
|
</main>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
31
frontend/src/components/cards/NavCard.vue
Normal file
31
frontend/src/components/cards/NavCard.vue
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { Button, Card } from 'primevue';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
|
const navigateTo = (path: string) => {
|
||||||
|
localStorage.setItem('app-selection', path)
|
||||||
|
router.push(path)
|
||||||
|
}
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
to: string
|
||||||
|
title: string
|
||||||
|
content?: string
|
||||||
|
}>()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Card>
|
||||||
|
<template #title>
|
||||||
|
<h1 class="text-md">{{ title }}</h1>
|
||||||
|
</template>
|
||||||
|
<template #content v-if="content">
|
||||||
|
<p class="w-56">{{ content }}</p>
|
||||||
|
</template>
|
||||||
|
<template #footer>
|
||||||
|
<Button @click="navigateTo(to)" severity="contrast" size="small">Перейти</Button>
|
||||||
|
</template>
|
||||||
|
</Card>
|
||||||
|
</template>
|
||||||
26
frontend/src/components/headers/VHeader.vue
Normal file
26
frontend/src/components/headers/VHeader.vue
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import { Button, Toolbar } from 'primevue';
|
||||||
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
|
const logout = () => {
|
||||||
|
localStorage.removeItem('app-selection')
|
||||||
|
router.replace('/')
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<header >
|
||||||
|
<Toolbar>
|
||||||
|
<template #start>
|
||||||
|
<p class="font-bold">{{ $route.matched?.[$route.matched.length - 2]?.name }} / {{ route.name }}</p>
|
||||||
|
</template>
|
||||||
|
<template #end>
|
||||||
|
<Button severity="danger" :size="'small'" @click="logout">Выйти</Button>
|
||||||
|
</template>
|
||||||
|
</Toolbar>
|
||||||
|
</header>
|
||||||
|
</template>
|
||||||
@@ -7,8 +7,9 @@ import 'primeicons/primeicons.css'
|
|||||||
import { ru } from 'primelocale/js/ru.js'
|
import { ru } from 'primelocale/js/ru.js'
|
||||||
import { createPinia } from 'pinia'
|
import { createPinia } from 'pinia'
|
||||||
import { router } from './router/router'
|
import { router } from './router/router'
|
||||||
|
import Tooltip from 'primevue/tooltip'
|
||||||
|
|
||||||
createApp(App).use(router).use(createPinia()).use(Config, {
|
createApp(App).directive('tooltip', Tooltip).use(router).use(createPinia()).use(Config, {
|
||||||
theme: {
|
theme: {
|
||||||
preset: Aura,
|
preset: Aura,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,22 +1,15 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Calendar from '../components/calendar/Calendar.vue';
|
import { Button } from 'primevue';
|
||||||
import { CalendarEvent } from '../components/calendar/event.class';
|
import NavCard from '../components/cards/NavCard.vue';
|
||||||
|
|
||||||
const events: CalendarEvent[] = []
|
|
||||||
|
|
||||||
const newEvent = new CalendarEvent(
|
|
||||||
"Advanced algebra",
|
|
||||||
"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores assumenda corporis doloremque et expedita molestias necessitatibus quam quas temporibus veritatis. Deserunt excepturi illum nobis perferendis praesentium repudiandae saepe sapiente voluptatem!",
|
|
||||||
new Date("2025-03-11T12:05:00"),
|
|
||||||
new Date("2025-03-12T13:35:00"),
|
|
||||||
{
|
|
||||||
color: 'pink',
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
events.push(newEvent)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Calendar :events="events" />
|
<div class="flex w-screen h-screen items-center gap-5 justify-center">
|
||||||
|
<NavCard :title="'Пользователь'" :to="'/user'" :content="'Может кидать зигу и не может пользоваться туалетной бумагой'" />
|
||||||
|
</div>
|
||||||
|
<footer class="fixed w-full bottom-10 flex items-center justify-center gap-2">
|
||||||
|
<Button severity="secondary">Импортировать данные</Button>
|
||||||
|
<Button severity="secondary">Экспортировать данные</Button>
|
||||||
|
</footer>
|
||||||
</template>
|
</template>
|
||||||
7
frontend/src/pages/tables/PostTablePage.vue
Normal file
7
frontend/src/pages/tables/PostTablePage.vue
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import PostScheme from '../../post/PostScheme.vue';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<PostScheme />
|
||||||
|
</template>
|
||||||
9
frontend/src/pages/user/UserPage.vue
Normal file
9
frontend/src/pages/user/UserPage.vue
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { RouterView } from 'vue-router';
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<RouterView />
|
||||||
|
</template>
|
||||||
@@ -15,7 +15,7 @@ import PosttypeService from "../posttype/posttype.service.ts";
|
|||||||
const posttypeService = new PosttypeService();
|
const posttypeService = new PosttypeService();
|
||||||
|
|
||||||
import CommentService from "../comment/comment.service.ts";
|
import CommentService from "../comment/comment.service.ts";
|
||||||
import {SortedByOrder} from "../../bindings/app/internal/services/postservice.ts";
|
import { SortedByOrder } from "../../bindings/app/internal/services/postservice.ts";
|
||||||
|
|
||||||
const commentService = new CommentService();
|
const commentService = new CommentService();
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ const load = async () => {
|
|||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await load();
|
await load();
|
||||||
console.log(await SortedByOrder({"Author": "DESC", "Text": "ASC"}));
|
console.log(await SortedByOrder({ "Author": "DESC", "Text": "ASC" }));
|
||||||
});
|
});
|
||||||
|
|
||||||
const scheme: Scheme<Post> = reactive({
|
const scheme: Scheme<Post> = reactive({
|
||||||
@@ -124,7 +124,7 @@ const scheme: Scheme<Post> = reactive({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const getDefaults = () => {
|
const getDefaults = () => {
|
||||||
return ({...getDefaultValues(scheme), AuthorId: 1, PostTypeId: 1});
|
return ({ ...getDefaultValues(scheme), AuthorId: 1, PostTypeId: 1 });
|
||||||
};
|
};
|
||||||
|
|
||||||
const validate: Validate<Post> = (entity) => {
|
const validate: Validate<Post> = (entity) => {
|
||||||
@@ -135,11 +135,9 @@ const validate: Validate<Post> = (entity) => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<main class="w-screen h-screen">
|
|
||||||
<Table :scheme :service :get-defaults :load :items :validate>
|
<Table :scheme :service :get-defaults :load :items :validate>
|
||||||
<template #CommentsCreate="{ data }">
|
<template #CommentsCreate="{ data }">
|
||||||
<p>{{ data.Comments }}</p>
|
<p>{{ data.Comments }}</p>
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
</main>
|
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,10 +1,24 @@
|
|||||||
import { createRouter, createWebHistory, type RouteRecordRaw } from "vue-router";
|
import { createRouter, createWebHistory, type RouteRecordRaw } from "vue-router";
|
||||||
import Index from "../pages/Index.vue";
|
import Index from "../pages/Index.vue";
|
||||||
|
import UserPage from "../pages/user/UserPage.vue";
|
||||||
|
import PostTablePage from "../pages/tables/PostTablePage.vue";
|
||||||
|
|
||||||
export const routes: RouteRecordRaw[] = [{
|
export const routes: RouteRecordRaw[] = [{
|
||||||
path: "/",
|
path: "/",
|
||||||
component: Index,
|
component: Index,
|
||||||
name: 'Главная',
|
name: 'Главная'
|
||||||
|
}, {
|
||||||
|
path: '/user',
|
||||||
|
name: 'Пользователь',
|
||||||
|
component: UserPage,
|
||||||
|
redirect: '/user/post',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
component: PostTablePage,
|
||||||
|
path: '/user/post',
|
||||||
|
name: 'Новости'
|
||||||
|
}
|
||||||
|
]
|
||||||
}]
|
}]
|
||||||
|
|
||||||
export const router = createRouter({
|
export const router = createRouter({
|
||||||
|
|||||||
@@ -100,14 +100,17 @@ watch(() => props.items, () => {
|
|||||||
</template>
|
</template>
|
||||||
</DialogWindow>
|
</DialogWindow>
|
||||||
<div>
|
<div>
|
||||||
<DataTable :value="<[]>items">
|
<DataTable :value="<[]>items" paginator :rows="10">
|
||||||
<template #header v-if="props.name">
|
<template #header v-if="props.name">
|
||||||
<p>{{ props.name }}</p>
|
<p>{{ props.name }}</p>
|
||||||
</template>
|
</template>
|
||||||
<template v-for="key in keys">
|
<template v-for="key in keys">
|
||||||
<Column :header="props.scheme[key]?.russian" v-if="!props.scheme[key].hidden">
|
<Column :header="props.scheme[key]?.russian" v-if="!props.scheme[key].hidden">
|
||||||
<template #body="{ data }">
|
<template #body="{ data }">
|
||||||
<p class="">
|
<p class="truncate max-w-56" v-tooltip="viewDate(manyStructsView(
|
||||||
|
data[key],
|
||||||
|
props.scheme[key]?.type?.nested?.field,
|
||||||
|
), scheme[key]?.type?.primitive)">
|
||||||
{{
|
{{
|
||||||
viewDate(manyStructsView(
|
viewDate(manyStructsView(
|
||||||
data[key],
|
data[key],
|
||||||
|
|||||||
Reference in New Issue
Block a user