mirror of
https://github.com/ProudMuBai/GoFilm.git
synced 2026-05-20 21:47:29 +08:00
add BAM
This commit is contained in:
29
server/logic/FileLogic.go
Normal file
29
server/logic/FileLogic.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"server/config"
|
||||
"server/model/system"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type FileLogic struct {
|
||||
}
|
||||
|
||||
var FileL FileLogic
|
||||
|
||||
func (fl *FileLogic) SingleFileUpload(fileName string, uid int) string {
|
||||
// 生成图片信息
|
||||
var p = system.Picture{Link: fmt.Sprint(config.FilmPictureAccess, filepath.Base(fileName)), Uid: uid, PicType: 0}
|
||||
p.PicUid = strings.TrimSuffix(filepath.Base(fileName), filepath.Ext(fileName))
|
||||
// 记录图片信息到系统表中
|
||||
system.SaveGallery(p)
|
||||
return p.Link
|
||||
}
|
||||
|
||||
// GetPhotoPage 获取系统内的图片分页信息
|
||||
func (fl *FileLogic) GetPhotoPage(page *system.Page) []system.Picture {
|
||||
return system.GetPicturePage(page)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user