package sysdb

import (
	"go-admin/app/admin/models/sysmodel"
	"log"

	"gorm.io/gorm"
)

func GetAllStatusCode(orm *gorm.DB) []sysmodel.StatusCode {
	// sql := `SELECT code, explain, zh_cn, zh_hk, en FROM sys_status_code`
	var statusCodeList []sysmodel.StatusCode
	if err := orm.Table("sys_status_code").Find(&statusCodeList).Error; err != nil {
		log.Println("InitStatusCodeLanguage GetAllStatusCode Error:", err)
		return statusCodeList
	}
	return statusCodeList
}
