1 Star 0 Fork 0

tomatomeatman/GolangRepository

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
WebConfigInfo.go 851 Bytes
一键复制 编辑 原始数据 按行查看 历史
laowei 提交于 2024-07-16 14:42 +08:00 . 1
package app
import (
"strings"
)
// web项目基本配置信息
type WebConfigInfo struct {
Root string //页面根路径
Port string //端口
Title string //程序标题
Name string //名称
}
// 取对应配置
func (wf WebConfigInfo) Get() WebConfigInfo {
me := AppUtil{}.ToEntity(wf, "system")
if !me.Gsuccess {
return wf
}
result := me.Gdata.(WebConfigInfo)
if result.Root == "" {
result.Root = "/webroot/"
}
if result.Port == "" {
result.Port = "8080"
}
return result
}
// 取开始运行提示信息
func (wf WebConfigInfo) RunStartStr() string {
var build strings.Builder
build.WriteString("================ ")
build.WriteString(wf.Title)
build.WriteString(wf.Name)
build.WriteString("启动完毕,使用端口:")
build.WriteString(wf.Port)
build.WriteString(" ================")
return build.String()
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/tomatomeatman/golang-repository.git
git@gitee.com:tomatomeatman/golang-repository.git
tomatomeatman
golang-repository
GolangRepository
011e27951845

搜索帮助