27 lines
528 B
Go
27 lines
528 B
Go
package controller
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"yumc.pw/cloud/nvwa/database"
|
|
"yumc.pw/cloud/nvwa/model"
|
|
"yumc.pw/cloud/nvwa/service"
|
|
)
|
|
|
|
//GitLogCongtoller 控制器
|
|
var GitLogCongtoller = &gitLogCongtoller{}
|
|
|
|
type gitLogCongtoller struct {
|
|
}
|
|
|
|
//List 列出记录
|
|
func (b *gitLogCongtoller) List(c *gin.Context) {
|
|
success(c, service.Git.List())
|
|
}
|
|
|
|
//Add 新增记录
|
|
func (b *gitLogCongtoller) Add(c *gin.Context) {
|
|
var log = model.GitLog{ProjectID: 1, Hash: "123456789"}
|
|
database.Create(&log)
|
|
success(c, nil)
|
|
}
|