添加 fsfont 的注释

This commit is contained in:
eson 2023-06-06 17:31:00 +08:00
parent 54cbe017b9
commit 50b7afd25a
2 changed files with 2 additions and 4 deletions

View File

@ -30,13 +30,14 @@ func NewFsCanteenTypeModel(conn sqlx.SqlConn) FsCanteenTypeModel {
}
}
// FsGetTypeCanteenType GetType返回前端的结构
type FsGetTypeCanteenType struct {
Id int64 `db:"id" json:"key"` // ID
Name string `db:"name" json:"name"` // 餐厅名字
}
// FindGetType 根据status = 1查询出所有,fs_canteen_type 的类型,并排序desc
func (m *defaultFsCanteenTypeModel) FindGetType(ctx context.Context) ([]*FsGetTypeCanteenType, error) {
query := fmt.Sprintf("select X.id,X.name from (select %s from %s where status = 1 order by sort desc) X", fsCanteenTypeRows, m.table)
var resp []*FsGetTypeCanteenType
err := m.conn.QueryRows(&resp, query)

View File

@ -27,7 +27,6 @@ type (
FindOne(ctx context.Context, id int64) (*FsFont, error)
Update(ctx context.Context, data *FsFont) error
Delete(ctx context.Context, id int64) error
}
defaultFsFontModel struct {
@ -71,8 +70,6 @@ func (m *defaultFsFontModel) FindOne(ctx context.Context, id int64) (*FsFont, er
}
}
func (m *defaultFsFontModel) Insert(ctx context.Context, data *FsFont) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?)", m.table, fsFontRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.Title, data.LinuxFontname, data.FilePath, data.Sort)