Files
bl/modules/base/controller/app/base_comm.go

50 lines
1.0 KiB
Go
Raw Normal View History

2025-06-20 17:13:51 +08:00
package admin
import (
"context"
"blazing/cool"
"blazing/modules/base/service"
2025-06-20 17:13:51 +08:00
"github.com/gogf/gf/v2/frame/g"
)
type BaseCommController struct {
*cool.ControllerSimple
}
func init() {
var base_comm_controller = &BaseCommController{
&cool.ControllerSimple{
Prefix: "/app/base/comm",
// Api: []string{"Add", "Delete", "Update", "Info", "List", "Page"},
// Service: service.NewBaseCommService(),
},
}
// 注册路由
cool.RegisterControllerSimple(base_comm_controller)
}
// eps 接口请求
type BaseCommControllerEpsReq struct {
g.Meta `path:"/eps" method:"GET"`
}
// eps 接口
func (c *BaseCommController) Eps(ctx context.Context, req *BaseCommControllerEpsReq) (res *cool.BaseRes, err error) {
if !cool.Config.Eps {
cool.Loger.Error(ctx, "eps is not open")
2025-06-20 17:13:51 +08:00
res = cool.Ok(nil)
return
}
baseOpenService := service.NewBaseOpenService()
data, err := baseOpenService.AppEPS(ctx)
if err != nil {
cool.Loger.Error(ctx, "eps error", err)
2025-06-20 17:13:51 +08:00
return cool.Fail(err.Error()), err
}
res = cool.Ok(data)
return
}