From 888d0800bb511eac4f7b0aee94fdf4929fd17c75 Mon Sep 17 00:00:00 2001 From: ctengiz Date: Mon, 25 Mar 2024 23:09:30 +0300 Subject: [PATCH] compnay select --- app/Inter Font License.txt | 93 ------------------- app/frontend/bindings/lib/company/Company.js | 13 +++ app/frontend/bindings/lib/dbsrv/Srv.js | 25 +++++ app/frontend/bindings/main/BotService.js | 13 --- app/frontend/bindings/main/LoginService.js | 18 ---- app/frontend/bindings/main/models.js | 33 ------- app/frontend/bindings/models.ts | 33 ------- app/frontend/src/components/EssentialLink.vue | 47 ---------- .../dlg/{DbConnect.vue => Company.vue} | 22 ++--- app/frontend/src/layouts/MainLayout.vue | 24 ++--- app/frontend/src/pages/IndexPage.vue | 69 ++++++++++++-- app/go.mod | 19 +++- app/go.sum | 48 ++++++++++ app/lib/company/company.go | 21 +++++ app/lib/company/company_test.go | 27 ++++++ app/lib/db/db.go | 50 ++++++++++ app/lib/dbsrv/dbsrv.go | 25 +++++ app/main.go | 15 ++- 18 files changed, 315 insertions(+), 280 deletions(-) delete mode 100644 app/Inter Font License.txt create mode 100644 app/frontend/bindings/lib/company/Company.js create mode 100644 app/frontend/bindings/lib/dbsrv/Srv.js delete mode 100644 app/frontend/bindings/main/BotService.js delete mode 100644 app/frontend/bindings/main/LoginService.js delete mode 100644 app/frontend/bindings/main/models.js delete mode 100644 app/frontend/bindings/models.ts delete mode 100644 app/frontend/src/components/EssentialLink.vue rename app/frontend/src/components/dlg/{DbConnect.vue => Company.vue} (66%) create mode 100644 app/lib/company/company.go create mode 100644 app/lib/company/company_test.go create mode 100644 app/lib/db/db.go create mode 100644 app/lib/dbsrv/dbsrv.go diff --git a/app/Inter Font License.txt b/app/Inter Font License.txt deleted file mode 100644 index b525cbf..0000000 --- a/app/Inter Font License.txt +++ /dev/null @@ -1,93 +0,0 @@ -Copyright 2020 The Inter Project Authors (https://github.com/rsms/inter) - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/app/frontend/bindings/lib/company/Company.js b/app/frontend/bindings/lib/company/Company.js new file mode 100644 index 0000000..e117ea8 --- /dev/null +++ b/app/frontend/bindings/lib/company/Company.js @@ -0,0 +1,13 @@ +// @ts-check +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Call} from '@wailsio/runtime'; + +/** + * @function Create + * @returns {Promise} + **/ +export async function Create() { + return Call.ByName("company.Company.Create", ...Array.prototype.slice.call(arguments, 0)); +} diff --git a/app/frontend/bindings/lib/dbsrv/Srv.js b/app/frontend/bindings/lib/dbsrv/Srv.js new file mode 100644 index 0000000..b5868a5 --- /dev/null +++ b/app/frontend/bindings/lib/dbsrv/Srv.js @@ -0,0 +1,25 @@ +// @ts-check +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +import {Call} from '@wailsio/runtime'; + +/** + * @function Companies + * @returns {Promise} + **/ +export async function Companies() { + return Call.ByName("dbsrv.Srv.Companies", ...Array.prototype.slice.call(arguments, 0)); +} + +/** + * @function CreateCompany + * @param name {string} + * @param memberNumber {string} + * @param username {string} + * @param password {string} + * @returns {Promise} + **/ +export async function CreateCompany(name, memberNumber, username, password) { + return Call.ByName("dbsrv.Srv.CreateCompany", ...Array.prototype.slice.call(arguments, 0)); +} diff --git a/app/frontend/bindings/main/BotService.js b/app/frontend/bindings/main/BotService.js deleted file mode 100644 index 299b723..0000000 --- a/app/frontend/bindings/main/BotService.js +++ /dev/null @@ -1,13 +0,0 @@ -// @ts-check -// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL -// This file is automatically generated. DO NOT EDIT - -import {Call} from '@wailsio/runtime'; - -/** - * @function ClaimFile - * @returns {Promise} - **/ -export async function ClaimFile() { - return Call.ByName("main.BotService.ClaimFile", ...Array.prototype.slice.call(arguments, 0)); -} diff --git a/app/frontend/bindings/main/LoginService.js b/app/frontend/bindings/main/LoginService.js deleted file mode 100644 index c1a1c46..0000000 --- a/app/frontend/bindings/main/LoginService.js +++ /dev/null @@ -1,18 +0,0 @@ -// @ts-check -// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL -// This file is automatically generated. DO NOT EDIT - -import {Call} from '@wailsio/runtime'; -/** - * @typedef {import('./models').LoginUser} LoginUser - */ - -/** - * @function Login - * @param userName {string} - * @param password {string} - * @returns {Promise} - **/ -export async function Login(userName, password) { - return Call.ByName("main.LoginService.Login", ...Array.prototype.slice.call(arguments, 0)); -} diff --git a/app/frontend/bindings/main/models.js b/app/frontend/bindings/main/models.js deleted file mode 100644 index f21a080..0000000 --- a/app/frontend/bindings/main/models.js +++ /dev/null @@ -1,33 +0,0 @@ -// @ts-check -// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL -// This file is automatically generated. DO NOT EDIT - -export const LoginUser = class { - /** - * Creates a new LoginUser instance. - * @constructor - * @param {Object} source - The source object to create the LoginUser. - * @param {string} source.UserName - * @param {string} source.password - * @param {string} source.Token - * @param {boolean} source.LoggedIn - */ - constructor(source = {}) { - const { userName = "", password = "", token = "", loggedIn = false } = source; - this.userName = userName; - this.password = password; - this.token = token; - this.loggedIn = loggedIn; - } - - /** - * Creates a new LoginUser instance from a string or object. - * @param {string|object} source - The source data to create a LoginUser instance from. - * @returns {LoginUser} A new LoginUser instance. - */ - static createFrom(source) { - let parsedSource = typeof source === 'string' ? JSON.parse(source) : source; - return new LoginUser(parsedSource); - } -}; - diff --git a/app/frontend/bindings/models.ts b/app/frontend/bindings/models.ts deleted file mode 100644 index f21a080..0000000 --- a/app/frontend/bindings/models.ts +++ /dev/null @@ -1,33 +0,0 @@ -// @ts-check -// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL -// This file is automatically generated. DO NOT EDIT - -export const LoginUser = class { - /** - * Creates a new LoginUser instance. - * @constructor - * @param {Object} source - The source object to create the LoginUser. - * @param {string} source.UserName - * @param {string} source.password - * @param {string} source.Token - * @param {boolean} source.LoggedIn - */ - constructor(source = {}) { - const { userName = "", password = "", token = "", loggedIn = false } = source; - this.userName = userName; - this.password = password; - this.token = token; - this.loggedIn = loggedIn; - } - - /** - * Creates a new LoginUser instance from a string or object. - * @param {string|object} source - The source data to create a LoginUser instance from. - * @returns {LoginUser} A new LoginUser instance. - */ - static createFrom(source) { - let parsedSource = typeof source === 'string' ? JSON.parse(source) : source; - return new LoginUser(parsedSource); - } -}; - diff --git a/app/frontend/src/components/EssentialLink.vue b/app/frontend/src/components/EssentialLink.vue deleted file mode 100644 index a9f649f..0000000 --- a/app/frontend/src/components/EssentialLink.vue +++ /dev/null @@ -1,47 +0,0 @@ - - - diff --git a/app/frontend/src/components/dlg/DbConnect.vue b/app/frontend/src/components/dlg/Company.vue similarity index 66% rename from app/frontend/src/components/dlg/DbConnect.vue rename to app/frontend/src/components/dlg/Company.vue index 8486fc2..2e73f85 100644 --- a/app/frontend/src/components/dlg/DbConnect.vue +++ b/app/frontend/src/components/dlg/Company.vue @@ -1,14 +1,14 @@