You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
527 B
25 lines
527 B
2 months ago
|
package controllers
|
||
|
|
||
|
import (
|
||
|
"main/logic"
|
||
|
"main/utils"
|
||
|
|
||
|
"github.com/gin-gonic/gin"
|
||
|
"go.uber.org/zap"
|
||
|
)
|
||
|
|
||
|
func ImportStudentInfoHandler(c *gin.Context) {
|
||
|
file, err := c.FormFile("file")
|
||
|
if err != nil {
|
||
|
zap.L().Error("upload file failed", zap.Error(err))
|
||
|
utils.ResponseError(c, utils.CodeUpLoadError)
|
||
|
return
|
||
|
}
|
||
|
if err = logic.ImportStudentInfoLogic(file); err != nil {
|
||
|
zap.L().Error("import file failed", zap.Error(err))
|
||
|
utils.ResponseError(c, utils.CodeUpLoadError)
|
||
|
return
|
||
|
}
|
||
|
utils.ResponseSuccess(c, nil)
|
||
|
}
|