From 63645d248c765244488cd34dbc1bb6528ca6b7c7 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期二, 05 九月 2023 09:58:13 +0800
Subject: [PATCH] 修复编译

---
 system-service/models/voice.go |  142 +++++++++++++++++++++++-----------------------
 1 files changed, 71 insertions(+), 71 deletions(-)

diff --git a/system-service/models/voice.go b/system-service/models/voice.go
index 2a45d22..5b7710d 100644
--- a/system-service/models/voice.go
+++ b/system-service/models/voice.go
@@ -1,71 +1,71 @@
-package models
-
-import "errors"
-
-//鎶ヨ澹伴煶琛�
-type Voice struct {
-	Id        string       `gorm:"column:id;primary_key;type:varchar(100);unique;" json:"id"`
-	Name 	  string 	   `gorm:"column:name" json:"name"`
-	Path 	  string  	   `gorm:"column:path" json:"path"`
-}
-
-func (Voice) TableName() string {
-	return "voice"
-}
-
-func (v *Voice) Insert() (bool,error) {
-	var tmp Voice
-	if tmp.Exist(v.Name) {
-		//return false, errors.New("鏂囦欢涓嶅厑璁搁噸鍚�")
-	}
-	result := db.Table(v.TableName()).Create(&v)
-	if result.Error != nil {
-		return false, result.Error
-	}
-	if result.RowsAffected > 0 {
-		return true, nil
-	}
-	return false, errors.New("鏂板澶辫触")
-}
-
-func (v *Voice) Update() (bool,error) {
-	var tmp Voice
-	if tmp.Exist(v.Name) && tmp.Id != v.Id {
-		return false, errors.New("鍚屽悕鏂囦欢宸插瓨鍦�")
-	}
-	result := db.Table(v.TableName()).Save(&v)
-	if result.Error != nil {
-		return false, result.Error
-	}
-	if result.RowsAffected > 0 {
-		return true, nil
-	}
-	return false, errors.New("鏇存柊澶辫触")
-}
-
-func (v *Voice) Exist(name string) bool {
-	dbSelect := db.Table(v.TableName()).Where("name=?", name).First(&v)
-	if dbSelect.Error != nil || dbSelect.RowsAffected ==0 {
-		return false
-	}
-	return true
-}
-
-func (v *Voice) FindAll() (list []Voice, err error) {
-	err = db.Table(v.TableName()).Find(&list).Order("id asc").Error
-	if err != nil {
-		return nil,err
-	}
-	return list,nil
-}
-
-func (v *Voice) DeleteById(id string) (bool, error) {
-	result := db.Exec("delete from "+v.TableName()+" where id=?", id)
-	if result.Error !=nil {
-		return false, result.Error
-	}
-	if result.RowsAffected > 0 {
-		return true, nil
-	}
-	return false, errors.New("鍒犻櫎澶辫触")
-}
+package models
+
+import "errors"
+
+//鎶ヨ澹伴煶琛�
+type Voice struct {
+	Id        string       `gorm:"column:id;primary_key;type:varchar(100);unique;" json:"id"`
+	Name 	  string 	   `gorm:"column:name" json:"name"`
+	Path 	  string  	   `gorm:"column:path" json:"path"`
+}
+
+func (Voice) TableName() string {
+	return "voice"
+}
+
+func (v *Voice) Insert() (bool,error) {
+	var tmp Voice
+	if tmp.Exist(v.Name) {
+		//return false, errors.New("鏂囦欢涓嶅厑璁搁噸鍚�")
+	}
+	result := db.Table(v.TableName()).Create(&v)
+	if result.Error != nil {
+		return false, result.Error
+	}
+	if result.RowsAffected > 0 {
+		return true, nil
+	}
+	return false, errors.New("鏂板澶辫触")
+}
+
+func (v *Voice) Update() (bool,error) {
+	var tmp Voice
+	if tmp.Exist(v.Name) && tmp.Id != v.Id {
+		return false, errors.New("鍚屽悕鏂囦欢宸插瓨鍦�")
+	}
+	result := db.Table(v.TableName()).Save(&v)
+	if result.Error != nil {
+		return false, result.Error
+	}
+	if result.RowsAffected > 0 {
+		return true, nil
+	}
+	return false, errors.New("鏇存柊澶辫触")
+}
+
+func (v *Voice) Exist(name string) bool {
+	dbSelect := db.Table(v.TableName()).Where("name=?", name).First(&v)
+	if dbSelect.Error != nil || dbSelect.RowsAffected ==0 {
+		return false
+	}
+	return true
+}
+
+func (v *Voice) FindAll() (list []Voice, err error) {
+	err = db.Table(v.TableName()).Find(&list).Order("id asc").Error
+	if err != nil {
+		return nil,err
+	}
+	return list,nil
+}
+
+func (v *Voice) DeleteById(id string) (bool, error) {
+	result := db.Exec("delete from "+v.TableName()+" where id=?", id)
+	if result.Error !=nil {
+		return false, result.Error
+	}
+	if result.RowsAffected > 0 {
+		return true, nil
+	}
+	return false, errors.New("鍒犻櫎澶辫触")
+}

--
Gitblit v1.8.0