Files
ai-agent/internal/services/customer_identity_service.go
T
mlogclub 79614b2d07 Refactor import paths to use internal/pkg/httpx/params
- Updated multiple repository and service files to replace imports from "github.com/mlogclub/simple/web/params" with "cs-agent/internal/pkg/httpx/params".
- Adjusted context handling in auth_service and ws_service to use gin.Context instead of iris.Context.
- Ensured consistent usage of HTTP status responses across websocket handlers.
2026-05-23 22:10:20 +08:00

67 lines
2.3 KiB
Go

package services
import (
"cs-agent/internal/models"
"cs-agent/internal/repositories"
"cs-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)
}