代码拉取完成,页面将自动刷新
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
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。