Files
ai-agent/internal/services/customer_identity_service.go
T
t 2bbf42b741 refactor(auth): delegate access control to be-system
Remove Agent Desk users, roles, login sessions, tokens, and local permission persistence. Expose the backend as an embeddable ai-agent module with host-provided subject lookup and operation authorization callbacks, and complete the frontend/backend repository split.
2026-08-21 00:41:07 +08:00

68 lines
2.3 KiB
Go

package services
import (
"code.tczkiot.com/wlw/ai-agent/internal/models"
"code.tczkiot.com/wlw/ai-agent/internal/repositories"
"code.tczkiot.com/wlw/ai-agent/internal/pkg/httpx/params"
"github.com/mlogclub/simple/sqls"
)
var CustomerIdentityService = newCustomerIdentityService()
func newCustomerIdentityService() *customerIdentityService {
return &customerIdentityService{}
}
type customerIdentityService struct {
}
func (s *customerIdentityService) Get(id int64) *models.CustomerIdentity {
return repositories.CustomerIdentityRepository.Get(sqls.DB(), id)
}
func (s *customerIdentityService) Take(where ...interface{}) *models.CustomerIdentity {
return repositories.CustomerIdentityRepository.Take(sqls.DB(), where...)
}
func (s *customerIdentityService) Find(cnd *sqls.Cnd) []models.CustomerIdentity {
return repositories.CustomerIdentityRepository.Find(sqls.DB(), cnd)
}
func (s *customerIdentityService) FindOne(cnd *sqls.Cnd) *models.CustomerIdentity {
return repositories.CustomerIdentityRepository.FindOne(sqls.DB(), cnd)
}
func (s *customerIdentityService) FindPageByParams(params *params.QueryParams) (list []models.CustomerIdentity, paging *sqls.Paging) {
return repositories.CustomerIdentityRepository.FindPageByParams(sqls.DB(), params)
}
func (s *customerIdentityService) FindPageByCnd(cnd *sqls.Cnd) (list []models.CustomerIdentity, paging *sqls.Paging) {
return repositories.CustomerIdentityRepository.FindPageByCnd(sqls.DB(), cnd)
}
func (s *customerIdentityService) Count(cnd *sqls.Cnd) int64 {
return repositories.CustomerIdentityRepository.Count(sqls.DB(), cnd)
}
func (s *customerIdentityService) Create(t *models.CustomerIdentity) error {
return repositories.CustomerIdentityRepository.Create(sqls.DB(), t)
}
func (s *customerIdentityService) Update(t *models.CustomerIdentity) error {
return repositories.CustomerIdentityRepository.Update(sqls.DB(), t)
}
func (s *customerIdentityService) Updates(id int64, columns map[string]interface{}) error {
return repositories.CustomerIdentityRepository.Updates(sqls.DB(), id, columns)
}
func (s *customerIdentityService) UpdateColumn(id int64, name string, value interface{}) error {
return repositories.CustomerIdentityRepository.UpdateColumn(sqls.DB(), id, name, value)
}
func (s *customerIdentityService) Delete(id int64) {
repositories.CustomerIdentityRepository.Delete(sqls.DB(), id)
}