go-common/app/admin/ep/melloi/service/order_admin.go
2019-04-22 02:59:20 +00:00

22 lines
582 B
Go

package service
import (
"go-common/app/admin/ep/melloi/model"
"go-common/library/ecode"
)
// QueryOrderAdmin get administrator for order by current username
func (s *Service) QueryOrderAdmin(userName string) (*model.OrderAdmin, error) {
return s.dao.QueryOrderAdmin(userName)
}
// AddOrderAdmin add administrator for order
func (s *Service) AddOrderAdmin(admin *model.OrderAdmin) (err error) {
var oa *model.OrderAdmin
oa, _ = s.dao.QueryOrderAdmin(admin.UserName)
if oa.UserName == admin.UserName {
return ecode.MelloiAdminExist
}
return s.dao.AddOrderAdmin(admin)
}