business.go 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. package service
  2. import (
  3. "context"
  4. "go-common/app/admin/main/reply/model"
  5. )
  6. // ListBusiness return all business
  7. func (s *Service) ListBusiness(c context.Context, state int32) (business []*model.Business, err error) {
  8. return s.dao.ListBusiness(c, state)
  9. }
  10. // GetBusiness return a business by type
  11. func (s *Service) GetBusiness(c context.Context, tp int32) (business *model.Business, err error) {
  12. return s.dao.Business(c, tp)
  13. }
  14. // AddBusiness add a business
  15. func (s *Service) AddBusiness(c context.Context, tp int32, name, appkey, remark, alias string) (id int64, err error) {
  16. return s.dao.InBusiness(c, tp, name, appkey, remark, alias)
  17. }
  18. // UpBusiness update a business's name appkey and remark
  19. func (s *Service) UpBusiness(c context.Context, name, appkey, remark, alias string, tp int32) (id int64, err error) {
  20. return s.dao.UpBusiness(c, name, appkey, remark, alias, tp)
  21. }
  22. // UpBusinessState update a business's state
  23. func (s *Service) UpBusinessState(c context.Context, state, tp int32) (id int64, err error) {
  24. return s.dao.UpBusinessState(c, state, tp)
  25. }