Skip to content

Commit

Permalink
🐛 HttpResponse Message -> string
Browse files Browse the repository at this point in the history
  • Loading branch information
daijinru committed Aug 7, 2024
1 parent 1627989 commit 5f74fcf
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ type CiService struct {
}

type HttpResponse[T any] struct {
Status int `json:"status"`
Message *string `json:"message,omitempty"`
Data *T `json:"data,omitempty"`
Status int `json:"status"`
Message string `json:"message,omitempty"`
Data *T `json:"data,omitempty"`
}

// CreatePipeline Path parameter passing that service will switch to the path,
Expand Down Expand Up @@ -96,7 +96,8 @@ func (Cis *CiService) ReadPipeline(w http.ResponseWriter, r *http.Request) {

func (Cis *CiService) ReadServiceStatus(w http.ResponseWriter, r *http.Request) {
reply := &HttpResponse[any]{
Status: 200,
Status: 200,
Message: "success",
}
jsonData, err := json.Marshal(reply)
if err != nil {
Expand Down Expand Up @@ -154,10 +155,6 @@ func (Cis *CiService) ReadPipelines(w http.ResponseWriter, r *http.Request) {
w.Write(jsonData)
}

type GitClientReply struct {
message string `json:"message"`
}

func (cis *CiService) GitClone(w http.ResponseWriter, r *http.Request) {
gitClient, err := runner.NewGitClient(&runner.GitClientArgs{
Name: r.FormValue("name"),
Expand Down

0 comments on commit 5f74fcf

Please sign in to comment.