api.go 383 B

1234567891011121314151617181920212223
  1. package service
  2. import (
  3. "context"
  4. "jylua-api/internal/dao"
  5. "jylua-api/internal/model"
  6. )
  7. type luaApi struct {
  8. }
  9. var (
  10. JyLuaGoApi *luaApi
  11. )
  12. // GetAllApi 获取所有api接口
  13. func (a *luaApi) GetAllApi(ctx context.Context) []*model.JyapiApi {
  14. var res []*model.JyapiApi
  15. if err := dao.JyapiApi.Ctx(ctx).Where("status=1").Scan(&res); err != nil {
  16. return nil
  17. }
  18. return res
  19. }