package domain import ( "fmt" "time" ) type Folder struct { Title string // k PathTo string // /temp/k PrivateURL string // http://domain/apps/files/?dir=/temp/k OR http://domain/f/3333 } type CodaApplication struct { ID string `json:"id"` Summary string `json:"summary"` URL string `json:"url"` Git string `json:"git"` GitBuild string `json:"git-build"` Folder string `json:"folder"` } type Insert struct { Rows []Row `json:"rows"` } func NewTaskRequest() *Insert { return &Insert{} } type Row struct { Cells []Cell `json:"cells"` } func (req *Insert) NewRow() *Row { row := Row{} i := len(req.Rows) req.Rows = append(req.Rows, row) return &req.Rows[i] } type Cell struct { Column string `json:"column"` Value string `json:"value"` } func (r *Row) NewCell(col string, value string) *Row { cell := Cell{ Column: col, Value: value, } r.Cells = append(r.Cells, cell) return r } type Task struct { ID int32 Summary string Description string Creator string CreatorLink string Assignee string CreatedAt time.Time DeletedAt time.Time UpdatedAt time.Time URL string } func (t *Task) NotStartedMessage() string { return fmt.Sprintf( "## TaskID: %d\nCreated by: %s\n>>> %s\n", t.ID, t.Creator, t.Description, ) } func (t *Task) StartedMessage() string { return fmt.Sprintf( "## TaskID: %d\nCreated by: %s\n Assignee: %s\nšŸš€ Started at: %s\n>>> %s\n", t.ID, t.Creator, t.Assignee, t.UpdatedAt, t.Description, ) } func (t *Task) ClosedMessage() string { return fmt.Sprintf( "## TaskID: %d\nCreated by: %s\n Assignee: %s\nāœ… Closed at: %s\n>>> %s\n", t.ID, t.Creator, t.Assignee, t.DeletedAt, t.Description, ) } func NewTask(summ, desc, c, cLink string) *Task { return &Task{ Summary: summ, Description: desc, Creator: c, CreatorLink: cLink, } } type Git struct { Name string `json:"name"` // "poop" FullName string `json:"full_name"` // "developer/poop" Private bool `json:"private"` Url string `json:"url"` // "http://localhost:8081/api/v3/repos/developer/poop" CloneUrl string `json:"clone_url"` // "http://localhost:8081/git/developer/poop.git" HtmlUrl string `json:"Html_url"` // "http://localhost:8081/developer/poop" SshUrl string `json:"ssh_url"` // ?! } type Project struct { ID string `json:"id"` //15 ShortName string `json:"shortName"` //key-15 Name string `json:"name"` //default project name ChannelID string `json:"channel_id"` //123412341234 ProjectGit string `json:"project_git"` //https://github.com/mobilerino/dap-108 BuildGit string `json:"build_git"` //https://github.com/mobilerino/dap-108-build Cloud string `json:"cloud"` //http://82.151.222.22:7000/f/86658 } func (p *Project) DiscordString() string { return fmt.Sprintf( "## Project info:\n> šŸ”‘ key: %s\n> šŸ“‚ folder: %s\n> šŸ‘¾ project git: %s\n> šŸš€ build git: %s\n", p.ShortName, p.Cloud, p.ProjectGit, p.BuildGit, ) }