瀏覽代碼

Add CompleteName helper

Andrea Fazzi 6 年之前
父節點
當前提交
25ed2837f5
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      orm/teacher.go

+ 5 - 0
orm/teacher.go

@@ -1,6 +1,7 @@
 package orm
 
 import (
+	"fmt"
 	"net/http"
 
 	"github.com/jinzhu/gorm"
@@ -242,3 +243,7 @@ func (t Teacher) IsCoordinatorInClass(className string) bool {
 	return false
 
 }
+
+func (t *Teacher) CompleteName() string {
+	return fmt.Sprintf("%s %s", t.Name, t.Surname)
+}