This repository has been archived by the owner on May 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #167 from axiangcoding/develop
Develop
- Loading branch information
Showing
7 changed files
with
270 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
api-system/internal/controller/http/v1/mission_controller.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package v1 | ||
|
||
import ( | ||
"github.com/axiangcoding/antonstar-bot/internal/entity/app" | ||
"github.com/axiangcoding/antonstar-bot/internal/entity/e" | ||
"github.com/axiangcoding/antonstar-bot/internal/service" | ||
"github.com/gin-gonic/gin" | ||
) | ||
|
||
// GetMission | ||
// @Summary 获取执行任务状态 | ||
// @Tags Mission API | ||
// @Param id query string true "mission id" | ||
// @Success 200 {object} app.ApiJson "" | ||
// @Router /v1/mission [get] | ||
func GetMission(c *gin.Context) { | ||
id := c.Query("id") | ||
mission, err := service.FindMission(id) | ||
if err != nil { | ||
app.BizFailed(c, e.Error, err) | ||
return | ||
} | ||
app.Success(c, map[string]any{ | ||
"mission_id": mission.MissionId, | ||
"created_at": mission.CreatedAt, | ||
"updated_at": mission.UpdatedAt, | ||
"status": mission.Status, | ||
"process": mission.Process, | ||
"finished_time": mission.FinishedTime, | ||
}) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters