22 lines
408 B
Go
22 lines
408 B
Go
package authentication
|
|
|
|
import (
|
|
dg "github.com/karincake/apem/db-gorm-pg"
|
|
)
|
|
|
|
// just return the error code
|
|
func GetAndCheck(input, condition any) (eCode string) {
|
|
result := dg.I.Where(condition).Find(&input)
|
|
if result.Error != nil {
|
|
return "fetch-fail"
|
|
} else if result.RowsAffected == 0 {
|
|
return "auth-login-incorrect"
|
|
}
|
|
|
|
return ""
|
|
}
|
|
|
|
func GetDocName(id uint) string {
|
|
return "authentication"
|
|
}
|