mirror of
https://github.com/ProudMuBai/GoFilm.git
synced 2026-02-22 10:34:41 +08:00
add new features
This commit is contained in:
@@ -16,18 +16,22 @@ func (ml *ManageLogic) GetFilmSourceList() []system.FilmSource {
|
||||
return system.GetCollectSourceList()
|
||||
}
|
||||
|
||||
// GetFilmSource 获取ID对应的采集源信息
|
||||
func (ml *ManageLogic) GetFilmSource(id string) *system.FilmSource {
|
||||
return system.FindCollectSourceById(id)
|
||||
}
|
||||
|
||||
// UpdateFilmSource 更新采集源信息
|
||||
func (ml *ManageLogic) UpdateFilmSource(s system.FilmSource) error {
|
||||
return system.UpdateCollectSource(s)
|
||||
}
|
||||
|
||||
// SaveFilmSource 保存采集源信息
|
||||
func (ml *ManageLogic) SaveFilmSource(s system.FilmSource) error {
|
||||
return system.AddCollectSource(s)
|
||||
}
|
||||
|
||||
// DelFilmSource 删除采集源信息
|
||||
func (ml *ManageLogic) DelFilmSource(id string) error {
|
||||
// 先查找是否存在对应ID的站点信息
|
||||
s := system.FindCollectSourceById(id)
|
||||
@@ -51,3 +55,13 @@ func (ml *ManageLogic) GetSiteBasicConfig() system.BasicConfig {
|
||||
func (ml *ManageLogic) UpdateSiteBasic(c system.BasicConfig) error {
|
||||
return system.SaveSiteBasic(c)
|
||||
}
|
||||
|
||||
// GetBanners 获取轮播组件信息
|
||||
func (ml *ManageLogic) GetBanners() system.Banners {
|
||||
return system.GetBanners()
|
||||
}
|
||||
|
||||
// SaveBanners 保存轮播信息
|
||||
func (ml *ManageLogic) SaveBanners(bl system.Banners) error {
|
||||
return system.SaveBanners(bl)
|
||||
}
|
||||
|
||||
@@ -38,6 +38,11 @@ func (sl *SpiderLogic) AutoCollect(time int) {
|
||||
go spider.AutoCollect(time)
|
||||
}
|
||||
|
||||
// ClearFilms 删除采集的数据信息
|
||||
func (sl *SpiderLogic) ClearFilms() {
|
||||
go spider.ClearSpider()
|
||||
}
|
||||
|
||||
// ZeroCollect 数据清除从零开始采集
|
||||
func (sl *SpiderLogic) ZeroCollect(time int) {
|
||||
go spider.StarZero(time)
|
||||
|
||||
@@ -57,6 +57,7 @@ func (ul *UserLogic) ChangePassword(account, password, newPassword string) error
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetUserInfo 获取用户基本信息
|
||||
func (ul *UserLogic) GetUserInfo(id uint) system.UserInfoVo {
|
||||
// 通过用户ID查询对应的用户信息
|
||||
u := system.GetUserById(id)
|
||||
@@ -64,3 +65,11 @@ func (ul *UserLogic) GetUserInfo(id uint) system.UserInfoVo {
|
||||
var vo = system.UserInfoVo{Id: u.ID, UserName: u.UserName, Email: u.Email, Gender: u.Gender, NickName: u.NickName, Avatar: u.Avatar, Status: u.Status}
|
||||
return vo
|
||||
}
|
||||
|
||||
// VerifyUserPassword 校验密码
|
||||
func (ul *UserLogic) VerifyUserPassword(id uint, password string) bool {
|
||||
// 获取当前登录的用户全部信息
|
||||
u := system.GetUserById(id)
|
||||
// 校验密码是否正确
|
||||
return util.PasswordEncrypt(password, u.Salt) == u.Password
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user