Browse Source

更新

master
huangjiajun 3 months ago
parent
commit
c37ec92bfc
4 changed files with 32 additions and 7 deletions
  1. +25
    -0
      cmd_master_db.bat
  2. +1
    -1
      cmd_super_db.bat
  3. +3
    -3
      src/model/agent.go
  4. +3
    -3
      src/model/medium.go

+ 25
- 0
cmd_master_db.bat View File

@@ -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

+ 1
- 1
cmd_super_db.bat View File

@@ -16,7 +16,7 @@ set DBNAME="super_advertisement"
set DBHOST="119.23.182.117"
set DBPORT="3306"

del "src\models\%Table%.go"
del "src\model\%Table%.go"

echo start reverse table %Table%



+ 3
- 3
src/model/agent.go View File

@@ -1,13 +1,13 @@
package model

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)"`
Username string `json:"username" 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)"`
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)"`
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"`
}

+ 3
- 3
src/model/medium.go View File

@@ -1,13 +1,13 @@
package model

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)"`
Username string `json:"username" 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)"`
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)"`
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"`
}

Loading…
Cancel
Save