Beego ?????? ???? ????? ???? ??
Jun 03, 2023 am 08:11 AM???? ??? ?? ????? ???? ?? ???? ????. ????? ??? ????? ???? ??? ?? ???? ???? ???? ?? ??? ?????. Beego ?????? ???? ???? ?? ?? ??? ?????. ??? Beego ?????? ???? ????? ???? ??? ?? ? ?? ??????.
1. Beego ? Bee ?? ??
?? Beego ? Bee ??? ???? ???. ??? ?? ??? Beego ?? ????(https://beego.me/docs/install/)? ?? ???? ? ????. ??? ?? go get ??? ???? ??? ?? Beego ? Bee ??? ??? ? ????.
go get github.com/astaxie/beego
go get github.com/beego/bee
2 ? Beego ???? ???
Bee ??? ???? ??? ?? ??? Beego ????? ?? ?? ? ????.
bee new myproject
??? ?? myproject?? ??? ??? Beego ????? ?????. ? ?????? ?? ????? ?? ??? ???? ????.
3. Beego ?? ??
?? ?? ??? ???? Beego ??? ???? ? ???? ??? ? ????.
cd myproject
bee run
??? ?? ??? ???? localhost :8080?? ? ???? ?????.
4. ???? ? ? ??
Beego ??????? ????? HTTP ??? ???? ?????. ????? ???? ????? ?????. ?? ??, ??? ??? ???????.
package Controllers
import (
"github.com/astaxie/beego"
)
type MainController struct {
beego.Controller
}
func (c *MainController) Get() {
c.TplName = "index.tpl"
}
?????? Get ???? ??? ?? ??? ?? index.tpl? ?? ??????. ??? ????? ???? ?????? ??? ??? ??? ? ????.
?? Beego ?????? HTML ??? ?????. Go? HTML ???? ???? Beego?? HTML ???? ??? ? ????. ?? ?? ??? ??? ??????.
<head> <title>Welcome to my website</title> </head> <body> <h1>Hello, Beego!</h1> </body>
5 ???
Beego ??????? ???? HTTP ??? ???? ? ?????. ?? ???? ? ????. ???? ?? ???, ?? ?? ? ??? ??? ???? ??? ?????. ?? ?? ??? ??? ?????.
package routers
import (
"myproject/controllers" "github.com/astaxie/beego"
)
func init() {
beego.Router("/", &controllers.MainController{})
}
? ???? ?? ??? MainController? Get ???? ?????. ?, ???? ? ???? ?? ??? ????? MainController? Get ???? ??? ???? ?? ?????.
6. ?? ??
?? ??????? CSS ? JavaScript ??? ?? ?? ??? ???? ???. Beego ???????? ?? ?? ????? ???? ?? ??? ??? ? ????. ??? ??? ?? ?? ???????.
beego.SetStaticPath("/static", "static")
??? ?? ?? ?? ?? ?? /static? ???? ?? ??? ?? ????? ?????.
7. ??????
?? ??????? ???? ???? ???? ?? ??????? ???? ???. Beego ???????? ORM(Object Relational Mapping) ?????? ???? ??????? ??? ? ????. ??? ORM ?????? ????.
package models
import (
"github.com/astaxie/beego/orm"
)
type User struct {
Id int Name string Email string
}
func init() {
orm.RegisterDataBase("default", "mysql", "root:password@tcp(127.0.0.1:3306)/myproject?charset=utf8") orm.RegisterModel(new(User))
}
? ???? ?? User?? ??? ???? ORM ?????? ???? MySQL? ??????? ??????. ??? ?? ??? ? ????.
??
Beego ?????? ???? ? ???? ????? ??? ??? ??? ? ??? ? ???? ???? ??? ???? ??? ?????. ?????? ?? ??? ???? ?? ???? ????, ??, ?? ? ?? ?? ???? ?????? ???? ? ???? ?? ??? ? ????. ??? ORM ?????? ???? ??????? ???? ??? ??? ?? ????? ????? ?? ? ????.
? ??? Beego ?????? ???? ????? ???? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

settings.json ??? ??? ?? ?? ?? ?? ?? ??? ??? VSCODE ??? ??? ???? ? ?????. 1. ??? ?? ?? : Windows? C : \ Users \\ AppData \ Roaming \ Code \ User \ Settings.json, MacOS IS /users//library/applicationsupport/code/user/settings.json, linux? /home//.config/code/user/settings.json; 2. Workspace ?? ?? : .vscode/settings project root ????

DateTime.strpTime ()? ???? ?? ???? DateTime ??? ??????. 1. ?? ?? : "%y-%m-%d"? ?? DateTime ???? "2023-10-05"; 2. ?? ??? "%m/%d/%y", "%d/%m/%y", ?? ??? ?? ???? ?? "%b%d,%y%i :%m%p"? ?? ?? ??? ?????. 3. dateUtil.parser.parse ()? ???? ? ??? ??? ???? ?????. 4. ?? .D

Go Generics? 1.18 ?? ???? ??-??? ?? ?? ??? ???? ? ?????. 1. ?? ?? printslice [tany] (s [] t)? [] int ?? [] String? ?? ?? ??? ????? ?? ? ? ????. 2. ?? ?? ?? ??? ?? int ? float? ?? ?? ???? ??? ?????. Sum [tnumber] (slice [] t) t ??? ??? ?????. 3. ?? ?? ?? ?? [tany] struct {valuet}? ?? ?? ?? ????? Newbox [tany]*box [t] ???? ?? ??? ? ????. 4. ?? (vt)? ???? () t ???? [t]?? [t]? ????

json.loads ()? JSON ???? Python ??? ??? ?? ???? ? ?????. 1. ??? ?? ????? ??? ???????? ?? ?? true/false???. 2. NULL → None, Object → Dict, Array → List ?? ?? ??? ?????. 3. ?? API? ?? ?? ? JSON ?? ???? ? ?????. ?? ??, JSON.LOADS ()? ?? ?? ?? ? response_string? ?? ??? ? ? ????. ??? ??? ?? JSON ??? ???? ???????. ??? ??? ??? ?????.

?, ?? CSS ?? ?? ??? JavaScript??? ??? HTML ? CSS? ?? ??? ? ????. 1. ?? UL? Li? ???? ?? ??? ??????. 2. ?? ?? ???? ???? ?????? ???? ??? ???? ???; 3. ?? ?? : ?? Li? ???, ?? ??? ??? ???? ?????. ??; 4. ?? ??? ???? ??? : ??, ????????? : ???? ??; 5. ?? ?? ???? ??? ?? ????, ??? ????, ??? ? ?????? ???? ??? ????? ??? ???? ??? ? ????. ?? ???? ???? JavaScript ??? ???? ???? ??? ?????.

@Property Decorator? ??? ??, ?? ? ?? ??? ???? ?? ???? ???? ???? ? ?????. 1. ?? ?? : @property? ?? ?? ?? ??? ????, ?? ?? ??? ???? ???? ?? ????? ??; 2. ?? ?? : @name.setter ? @name.deleter? ???? ?? ?? ?? ? ?? ??? ?????. 3. ?? ?? ???? : BankAccount? ?? ???? ??? ??? ???? ??? ??? ??? ??????. 4. ?? ?? ?? : ?? ??? ????? ?? ??? ??? ??? ???? ?? ??? ??? ?? ?? ? ?? ??? ?????.

itertools.combinations? ?? ??? ???? ??? ?? ??? ???? ?? ? ?? ?? (?? ???)? ???? ? ?????. ???? ??? ????. 1. ?? ??? ??? ?? ( 'a', 'b'), ( 'a', 'c') ? ???? 2 ?? ?? ??? ?????. 2. ?? ??? ??? "ABC"? "ABD"? ?? ???? 3 ? ??? ???; 3. ? ??? ?? 1 5 = 6? ?? ?? ?? ??? ??? ?????. ?? ?? ??? ???????. ??? ??? ??? ??? ???? ??????, ??? AB? BA? ???? ???? ??, ??? ?? ??? ????.

Python? ETL ????? ???? ???? ?????. 1. ??? ?? : ??????, API, ?? ? ?? ???? Pandas, Sqlalchemy, ?? ? ?? ?????? ?? ???? ?? ? ? ????. 2. ??? ?? : ??, ?? ??, ???, ?? ? ?? ??? ??? ???? ??? ??? ???? ??? ??????. 3. ??? ?? : Pandas 'To_SQL ??? ?? ???? ??? SDK? ???? ?? ???? ???? ???? ?? ?? ? ?? ?????? ?????. 4. ?? ?? ?? : ?? ??, Dagster, Prefect? ???? ???? ? ??? ???? ?? ?? ? ?? ??? ???? ???? ?? ??? ??????.
