@@ -0,0 +1,25 @@ | |||||
@echo off | |||||
set Table=* | |||||
set TName="" | |||||
set one=%1 | |||||
if "%one%" NEQ "" ( | |||||
set Table=%one% | |||||
set TName="^%one%$" | |||||
) | |||||
set BasePath="./" | |||||
set DBUSER="root" | |||||
set DBPSW="Fnuo123com@" | |||||
set DBNAME="advertisement" | |||||
set DBHOST="119.23.182.117" | |||||
set DBPORT="3306" | |||||
del "src\model\%Table%.go" | |||||
echo start reverse table %Table% | |||||
xorm reverse mysql "%DBUSER%:%DBPSW%@tcp(%DBHOST%:%DBPORT%)/%DBNAME%?charset=utf8" %BasePath%/etc/db_tpl %BasePath%/src/model/ %TName% | |||||
echo end |
@@ -16,7 +16,7 @@ set DBNAME="super_advertisement" | |||||
set DBHOST="119.23.182.117" | set DBHOST="119.23.182.117" | ||||
set DBPORT="3306" | set DBPORT="3306" | ||||
del "src\models\%Table%.go" | |||||
del "src\model\%Table%.go" | |||||
echo start reverse table %Table% | echo start reverse table %Table% | ||||
@@ -1,13 +1,13 @@ | |||||
package model | package model | ||||
type Agent struct { | type Agent struct { | ||||
Id int `json:"id" xorm:"not null pk default 0 INT(11)"` | |||||
Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | |||||
AgentId int `json:"agent_id" xorm:"not null default 0 comment('代理id') INT(11)"` | AgentId int `json:"agent_id" xorm:"not null default 0 comment('代理id') INT(11)"` | ||||
Username string `json:"username" xorm:"not null default '' comment('用户名') VARCHAR(255)"` | Username string `json:"username" xorm:"not null default '' comment('用户名') VARCHAR(255)"` | ||||
Password string `json:"password" xorm:"not null default '' comment('密码') VARCHAR(255)"` | Password string `json:"password" xorm:"not null default '' comment('密码') VARCHAR(255)"` | ||||
State int `json:"state" xorm:"not null default 1 comment('状态(1:正常 2:冻结)') TINYINT(1)"` | State int `json:"state" xorm:"not null default 1 comment('状态(1:正常 2:冻结)') TINYINT(1)"` | ||||
IsSuperAdministrator int `json:"is_super_administrator" xorm:"not null default 0 comment('是否为超级管理员(0:否 1:是)') TINYINT(1)"` | IsSuperAdministrator int `json:"is_super_administrator" xorm:"not null default 0 comment('是否为超级管理员(0:否 1:是)') TINYINT(1)"` | ||||
Memo string `json:"memo" xorm:"not null default '' comment('备注信息') VARCHAR(244)"` | Memo string `json:"memo" xorm:"not null default '' comment('备注信息') VARCHAR(244)"` | ||||
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
CreateAt string `json:"create_at" xorm:"not null default CURRENT_TIMESTAMP DATETIME"` | |||||
UpdateAt string `json:"update_at" xorm:"not null default CURRENT_TIMESTAMP DATETIME"` | |||||
} | } |
@@ -1,13 +1,13 @@ | |||||
package model | package model | ||||
type Medium struct { | type Medium struct { | ||||
Id int `json:"id" xorm:"not null pk default 0 INT(11)"` | |||||
Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | |||||
MediumId int `json:"medium_id" xorm:"not null default 0 comment('媒体id') INT(11)"` | MediumId int `json:"medium_id" xorm:"not null default 0 comment('媒体id') INT(11)"` | ||||
Username string `json:"username" xorm:"not null default '' comment('用户名') VARCHAR(255)"` | Username string `json:"username" xorm:"not null default '' comment('用户名') VARCHAR(255)"` | ||||
Password string `json:"password" xorm:"not null default '' comment('密码') VARCHAR(255)"` | Password string `json:"password" xorm:"not null default '' comment('密码') VARCHAR(255)"` | ||||
State int `json:"state" xorm:"not null default 1 comment('状态(1:正常 2:冻结)') TINYINT(1)"` | State int `json:"state" xorm:"not null default 1 comment('状态(1:正常 2:冻结)') TINYINT(1)"` | ||||
IsSuperAdministrator int `json:"is_super_administrator" xorm:"not null default 0 comment('是否为超级管理员(0:否 1:是)') TINYINT(1)"` | IsSuperAdministrator int `json:"is_super_administrator" xorm:"not null default 0 comment('是否为超级管理员(0:否 1:是)') TINYINT(1)"` | ||||
Memo string `json:"memo" xorm:"not null default '' comment('备注信息') VARCHAR(244)"` | Memo string `json:"memo" xorm:"not null default '' comment('备注信息') VARCHAR(244)"` | ||||
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | |||||
CreateAt string `json:"create_at" xorm:"not null default CURRENT_TIMESTAMP DATETIME"` | |||||
UpdateAt string `json:"update_at" xorm:"not null default CURRENT_TIMESTAMP DATETIME"` | |||||
} | } |