Ai
1 Star 1 Fork 0

water/goweb

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
code_dto.go 901 Bytes
一键复制 编辑 原始数据 按行查看 历史
leijmdas 提交于 2025-01-19 14:06 +08:00 . add
package metaentity
import (
"strings"
"time"
)
type CodeDto struct {
bodyEntity string
funcEntity string
FileName string
FileVar string
DateVar string
BodyVar string
StruNameVar string
FuncVar string
}
func (self *CodeDto) BuildCode() string {
var code = strings.ReplaceAll(self.BodyEntity(), "{{struName}}", self.StruNameVar)
code = strings.ReplaceAll(code, "{{file}}", self.FileVar)
code = strings.ReplaceAll(code, "{{date}}", time.Now().Format(time.DateTime))
code = strings.ReplaceAll(code, "{{buildStruBody}}", self.BodyVar)
return code + "\r\n" + self.FuncVar
}
func (e *CodeDto) BodyEntity() string {
return e.bodyEntity
}
func (e *CodeDto) SetBodyEntity(bodyEntity string) {
e.bodyEntity = bodyEntity
}
func (e *CodeDto) FuncEntity() string {
return e.funcEntity
}
func (e *CodeDto) SetFuncEntity(funcEntity string) {
e.funcEntity = funcEntity
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/leijmdas/goweb.git
git@gitee.com:leijmdas/goweb.git
leijmdas
goweb
goweb
v1.6.111

搜索帮助