mirror of
https://gitee.com/goploy/goploy.git
synced 2024-12-02 20:20:32 +08:00
33 lines
764 B
Go
33 lines
764 B
Go
package ws
|
|
|
|
import (
|
|
"github.com/zhenorzz/goploy/model"
|
|
)
|
|
|
|
// ProjectMessage is publish project message struct
|
|
type ProjectMessage struct {
|
|
ProjectID int64 `json:"projectId"`
|
|
ProjectName string `json:"projectName"`
|
|
State uint8 `json:"state"`
|
|
Message string `json:"message"`
|
|
Ext interface{} `json:"ext"`
|
|
}
|
|
|
|
const (
|
|
ProjectFail = 0
|
|
GitCreate = 1
|
|
GitReset = 1
|
|
GitSwitchBranch = 2
|
|
GitClean = 3
|
|
GitCheckout = 4
|
|
GitPull = 5
|
|
AfterPullScript = 6
|
|
Rsync = 7
|
|
ProjectSuccess = 8
|
|
)
|
|
|
|
func (projectMessage ProjectMessage) canSendTo(client *Client) error {
|
|
_, err := model.Project{ID: projectMessage.ProjectID, UserID: client.UserInfo.ID}.GetUserProjectData()
|
|
return err
|
|
}
|