feat:新存储了meta信息,完善了记录逻辑

This commit is contained in:
songzhibin97
2021-07-13 17:30:30 +08:00
parent 07ec0841c9
commit 7fcdaa523c
5 changed files with 59 additions and 24 deletions

View File

@@ -23,7 +23,7 @@ import (
// @Produce application/json
// @Param data body request.SysAutoHistory true "查询回滚记录"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /autoCode/preview [post]
// @Router /autoCode/getSysHistory [post]
func GetSysHistory(c *gin.Context) {
var search request.SysAutoHistory
_ = c.ShouldBindJSON(&search)
@@ -48,7 +48,7 @@ func GetSysHistory(c *gin.Context) {
// @Produce application/json
// @Param data body request.AutoHistoryByID true "回滚自动生成代码"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"回滚成功"}"
// @Router /autoCode/preview [post]
// @Router /autoCode/rollback [post]
func RollBack(c *gin.Context) {
var id request.AutoHistoryByID
_ = c.ShouldBindJSON(&id)
@@ -59,6 +59,26 @@ func RollBack(c *gin.Context) {
response.OkWithMessage("回滚成功", c)
}
// @Tags AutoCode
// @Summary 回滚
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.AutoHistoryByID true "获取meta信息"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /autoCode/getMeta [post]
func GetMeta(c *gin.Context) {
var id request.AutoHistoryByID
_ = c.ShouldBindJSON(&id)
if v, err := service.GetMeta(id.ID); err != nil {
response.FailWithMessage(err.Error(), c)
return
} else {
response.OkWithDetailed(gin.H{"meta": v}, "获取成功", c)
}
}
// @Tags AutoCode
// @Summary 预览创建后的代码
// @Security ApiKeyAuth