types

package
v0.0.0-...-ddd8613 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: MIT Imports: 2 Imported by: 0

README

model

Model_`DATA_NAME` => 数据库模型
Svc_`DATA_NAME` => 响应模型
Form_`DATA_NAME` => 表单模型

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnv

func GetEnv() types2.Envrion

GetEnv .

func SetConfig

func SetConfig(cfg *Config)

SetConfig .

func SetEnv

func SetEnv(env types2.Envrion)

SetEnv .

Types

type Config

type Config struct {
	Mysql   *types2.MysqlC        `json:"mysql"`
	Sqlite3 *types2.SQLite3Config `json:"sqlite3"`
}

Config .

func GetConfig

func GetConfig() *Config

GetConfig .

type FooCreateForm

type FooCreateForm struct {
	Bar string `form:"bar" binding:"required"` // binding tag for HTTP frame (like: Gin)
}

FooCreateForm is struct which provided to service layer and handle layer

type FooModel

type FooModel struct {
	gorm.Model
	Bar string
}

FooModel is an go struct to related to SQL-DB table

func (FooModel) TableName

func (m FooModel) TableName() string

TableName .

type FooSvc

type FooSvc struct {
	ID        uint   `json:"id"`
	CreatedAt int64  `json:"created_at"`
	UpdatedAt int64  `json:"updated_at"`
	Bar       string `json:"bar"`
}

FooSvc is struct which provided to service layer and handle layer

Jump to

Keyboard shortcuts

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