fixed: unnecessary information in project response
This commit is contained in:
parent
86b00e03b6
commit
e5feb56360
|
|
@ -2,6 +2,7 @@ package domain
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -143,22 +144,31 @@ type Git struct {
|
||||||
|
|
||||||
type Project struct {
|
type Project struct {
|
||||||
ID string `json:"id"` //15
|
ID string `json:"id"` //15
|
||||||
ShortName string `json:"shortName"` //key-15
|
Key string `json:"shortName"` //key-15
|
||||||
Name string `json:"name"` //default project name
|
Name string `json:"name"` //default project name
|
||||||
ChannelID string `json:"channel_id"` //123412341234
|
ChannelID string `json:"channel_id"` //123412341234
|
||||||
|
|
||||||
ProjectGit string `json:"project_git"` //https://github.com/mobilerino/dap-108
|
ProjectGit string `json:"project_git"` //https://github.com/mobilerino/dap-108
|
||||||
BuildGit string `json:"build_git"` //https://github.com/mobilerino/dap-108-build
|
BuildGit string `json:"build_git"` //https://github.com/mobilerino/dap-108-build
|
||||||
Cloud string `json:"cloud"` //http://82.151.222.22:7000/f/86658
|
Folder string `json:"cloud"` //http://82.151.222.22:7000/f/86658
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Project) DiscordString() string {
|
func (p *Project) DiscordString() string {
|
||||||
|
|
||||||
return fmt.Sprintf(
|
var builder strings.Builder
|
||||||
"## Project info:\n> 🔑 key: %s\n> 📂 folder: %s\n> 👾 project git: %s\n> 🚀 build git: %s\n",
|
builder.WriteString(fmt.Sprintf("## Project `%s`:\n> 🔑 key: %s", p.Name, p.Key))
|
||||||
p.ShortName,
|
|
||||||
p.Cloud,
|
if p.Folder != "" {
|
||||||
p.ProjectGit,
|
builder.WriteString(fmt.Sprintf("\n> 📂 folder: %s", p.Folder))
|
||||||
p.BuildGit,
|
}
|
||||||
)
|
|
||||||
|
if p.ProjectGit != "" {
|
||||||
|
builder.WriteString(fmt.Sprintf("\n> 👾 project git: %s", p.ProjectGit))
|
||||||
|
}
|
||||||
|
|
||||||
|
if p.BuildGit != "" {
|
||||||
|
builder.WriteString(fmt.Sprintf("\n> 🚀 build git: %s", p.BuildGit))
|
||||||
|
}
|
||||||
|
|
||||||
|
return builder.String()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue