init project
This commit is contained in:
27
modules/system/controller/controller.go
Normal file
27
modules/system/controller/controller.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"app/modules/system/dao"
|
||||
"app/modules/system/dto"
|
||||
"app/modules/system/service"
|
||||
"app/providers/config"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type Controller interface {
|
||||
GetName(*gin.Context) (dto.Name, error)
|
||||
}
|
||||
|
||||
type ControllerImpl struct {
|
||||
Conf *config.Config
|
||||
svc service.SystemService
|
||||
}
|
||||
|
||||
func NewController(Conf *config.Config, dao dao.Dao, svc service.SystemService) Controller {
|
||||
return &ControllerImpl{Conf: Conf, svc: svc}
|
||||
}
|
||||
|
||||
func (c *ControllerImpl) GetName(ctx *gin.Context) (dto.Name, error) {
|
||||
return c.svc.GetName(ctx)
|
||||
}
|
||||
Reference in New Issue
Block a user