Files
ai-agent/internal/services/user_identity_service.go
T
mlogclub 101577f163 Refactor internal services to use agent-desk package structure
- Updated import paths in multiple service files to reflect the new agent-desk module.
- Added a new configuration file for agent-desk in the Docker setup.
2026-05-31 18:43:48 +08:00

68 lines
2.1 KiB
Go

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