d4bed3e5c7
* fix bug * updata UI * 0.3.2 ### Added - [Files] Files can now be selected multiple files and downloaded, deleted, moved, etc. - [Apps] Support to modify the application opening address.([#204](https://github.com/IceWhaleTech/CasaOS/issues/204)) ### Changed - [Apps] Hide the display of non-essential environment variables in the application. - [System] Network, disk, cpu, memory, etc. information is modified to be pushed via socket. - [System] Optimize opening speed.([#214](https://github.com/IceWhaleTech/CasaOS/issues/214)) ### Fixed - [System] Fixed the problem that sync data cannot submit the device ID ([#68](https://github.com/IceWhaleTech/CasaOS/issues/68)) - [Files] Fixed the code editor center alignment display problem.([#210](https://github.com/IceWhaleTech/CasaOS/issues/210)) - [Files] Fixed the problem of wrong name when downloading files.([#240](https://github.com/IceWhaleTech/CasaOS/issues/240)) - [System] Fixed the network display as a negative number problem.([#224](https://github.com/IceWhaleTech/CasaOS/issues/224)) * Modify log help class * Fix some bugs in 0.3.2 * Solve the operation file queue problem * Exclude web folders * update UI
48 lines
998 B
Go
48 lines
998 B
Go
/*
|
|
* @Author: LinkLeong link@icewhale.com
|
|
* @Date: 2021-09-30 18:18:14
|
|
* @LastEditors: LinkLeong
|
|
* @LastEditTime: 2022-06-02 18:00:57
|
|
* @FilePath: /CasaOS/service/rely.go
|
|
* @Description:
|
|
* @Website: https://www.casaos.io
|
|
* Copyright (c) 2022 by icewhale, All Rights Reserved.
|
|
*/
|
|
package service
|
|
|
|
import (
|
|
model2 "github.com/IceWhaleTech/CasaOS/service/model"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type RelyService interface {
|
|
Create(rely model2.RelyDBModel)
|
|
Delete(id string)
|
|
GetInfo(id string) model2.RelyDBModel
|
|
}
|
|
|
|
type relyService struct {
|
|
db *gorm.DB
|
|
}
|
|
|
|
func (r *relyService) Create(rely model2.RelyDBModel) {
|
|
|
|
r.db.Create(&rely)
|
|
|
|
}
|
|
|
|
//获取我的应用列表
|
|
func (r *relyService) GetInfo(id string) model2.RelyDBModel {
|
|
var m model2.RelyDBModel
|
|
r.db.Where("custom_id = ?", id).First(&m)
|
|
return m
|
|
}
|
|
|
|
func (r *relyService) Delete(id string) {
|
|
var c model2.RelyDBModel
|
|
r.db.Where("custom_id = ?", id).Delete(&c)
|
|
}
|
|
|
|
func NewRelyService(db *gorm.DB) RelyService {
|
|
return &relyService{db: db}
|
|
}
|