Files
ai-agent/internal/services/user_role_service.go
T
mlogclub 5d7c10aeab refactor: rename agent widget references to AI agent for consistency
- Updated runtime configuration to use __CS_AI_AGENT_WIDGET_CONFIG__ instead of __CS_AGENT_WIDGET_CONFIG__.
- Changed message types in support host bridge from "cs-agent" to "cs-ai-agent".
- Minified SDK script updated to reflect new AI agent naming conventions.
- Adjusted scrollbar styles in main.scss to use .cs-ai-agent-scrollbar instead of .cs-agent-scrollbar.
2026-05-30 21:19:36 +08:00

67 lines
2.0 KiB
Go

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