model

package
v0.0.0-...-f210498 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DATAPATH string = "data/db.db"

DATAPATH define

View Source
const URL string = "http://localhost:8545"

Variables

This section is empty.

Functions

func AddAccount

func AddAccount(account Account) bool

AddAccount method

func AddCompany

func AddCompany(company Company) bool

AddCompany method

func DeleteAccount

func DeleteAccount(id int32) bool

DeleteAccount method

func DeleteAccountVip

func DeleteAccountVip(id int32) bool

DeleteAccountVip method

func Financing

func Financing(accountID int32, companyID int32) bool

Financing method

func SetCompany

func SetCompany(id int32, company Company) bool

SetCompany method

func TransferAccount

func TransferAccount(id int32, account Account) bool

TransferAccount method

Types

type Account

type Account struct {
	ID       int32   `json:"id,omitempty"`
	Money    int32   `json:"money,omitempty"`
	ACompany Company `json:"ACompany,omitempty"`
	BCompany Company `json:"BCompany,omitempty"`
}

Account define

func GetAccountByCompanyID

func GetAccountByCompanyID(id int32) []Account

GetAccountByCompanyID method

func GetAccountByID

func GetAccountByID(id int32) Account

GetAccountByID method

func GetAllAccounts

func GetAllAccounts() []Account

GetAllAccounts method

type AccountReturn

type AccountReturn struct {
	ID       int32 `json:"a,omitempty"`
	ACompany int32 `json:"b,omitempty"`
	BCompany int32 `json:"c,omitempty"`
	Money    int32 `json:"d,omitempty"`
}

AccountReturn define

type Admin

type Admin struct {
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
}

Admin define

type Company

type Company struct {
	ID     int32  `json:"id,omitempty"`
	Name   string `json:"name,omitempty"`
	Trusty int32  `json:"trusty,omitempty"`
	Money  int32  `json:"money,omitempty"`
}

Company define

func GetAllCompanys

func GetAllCompanys() []Company

GetAllCompanys method

type CompanyReturn

type CompanyReturn struct {
	ID     int32  `json:"a,omitempty"`
	Name   string `json:"b,omitempty"`
	Trusty int32  `json:"c,omitempty"`
	Money  int32  `json:"d,omitempty"`
}

CompanyReturn define

type User

type User struct {
	Username string  `json:"username,omitempty"`
	Password string  `json:"password,omitempty"`
	Company  Company `json:"company,omitempty"`
}

User define

func CreateUser

func CreateUser(user User) User

CreateUser mothed

func QueryUserLogin

func QueryUserLogin(username string, password string) User

QueryUserLogin Method

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL