ei...
This commit is contained in:
parent
e5a4ce746d
commit
738babf6c2
32
main.go
32
main.go
|
@ -2,7 +2,6 @@ package main
|
||||||
|
|
||||||
// init函数执行顺序自上而下, 最后执行main包里面的init函数
|
// init函数执行顺序自上而下, 最后执行main包里面的init函数
|
||||||
import (
|
import (
|
||||||
"cutego/modules/core/dataobject"
|
|
||||||
"cutego/pkg/config"
|
"cutego/pkg/config"
|
||||||
_ "cutego/pkg/cronjob"
|
_ "cutego/pkg/cronjob"
|
||||||
_ "cutego/pkg/gin"
|
_ "cutego/pkg/gin"
|
||||||
|
@ -11,26 +10,25 @@ import (
|
||||||
"cutego/refs"
|
"cutego/refs"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
//go testChangeJob()
|
//go testChangeJob()
|
||||||
//starter()
|
starter()
|
||||||
user := dataobject.SysUser{}
|
//user := dataobject.SysUser{}
|
||||||
user.UserId = 1
|
//user.UserId = 1
|
||||||
user.UserName = "test"
|
//user.UserName = "test"
|
||||||
user.Password = "123456"
|
//user.Password = "123456"
|
||||||
user.LoginDate = time.Now()
|
//user.LoginDate = time.Now()
|
||||||
jsonString := util.ToJSONString(user)
|
//jsonString := util.ToJSONString(user)
|
||||||
fmt.Println(jsonString)
|
//fmt.Println(jsonString)
|
||||||
fmt.Println(util.FormatDateTime(user.LoginDate))
|
//fmt.Println(util.FormatDateTime(user.LoginDate))
|
||||||
fmt.Println(util.FormatDate(user.LoginDate))
|
//fmt.Println(util.FormatDate(user.LoginDate))
|
||||||
fmt.Println(util.FormatTime(user.LoginDate))
|
//fmt.Println(util.FormatTime(user.LoginDate))
|
||||||
|
//
|
||||||
sysUser := dataobject.SysUser{}
|
//sysUser := dataobject.SysUser{}
|
||||||
util.ParseJSONStruct(jsonString, &sysUser)
|
//util.ParseJSONStruct(jsonString, &sysUser)
|
||||||
fmt.Println(sysUser)
|
//fmt.Println(sysUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
func starter() {
|
func starter() {
|
||||||
|
|
Loading…
Reference in New Issue