改造成api
This commit is contained in:
@@ -4,21 +4,18 @@ import (
|
||||
v1 "management/internal/erpserver/service/v1"
|
||||
"management/internal/pkg/config"
|
||||
"management/internal/pkg/gin/gu"
|
||||
"management/internal/pkg/render"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type app struct {
|
||||
config *config.Config
|
||||
render render.Renderer
|
||||
captchaService v1.CaptchaService
|
||||
}
|
||||
|
||||
func newApp(config *config.Config, render render.Renderer, captchaService v1.CaptchaService) *app {
|
||||
func newApp(config *config.Config, captchaService v1.CaptchaService) *app {
|
||||
return &app{
|
||||
config: config,
|
||||
render: render,
|
||||
captchaService: captchaService,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,18 +3,16 @@ package captcha
|
||||
import (
|
||||
v1 "management/internal/erpserver/service/v1"
|
||||
"management/internal/pkg/config"
|
||||
"management/internal/pkg/render"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Conf *config.Config
|
||||
Render render.Renderer
|
||||
CaptchaService v1.CaptchaService
|
||||
}
|
||||
|
||||
func Routes(r *gin.RouterGroup, cfg Config) {
|
||||
app := newApp(cfg.Conf, cfg.Render, cfg.CaptchaService)
|
||||
app := newApp(cfg.Conf, cfg.CaptchaService)
|
||||
r.GET("/captcha", app.captcha)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user