1
This commit is contained in:
@ -61,6 +61,25 @@ func (e *LineDirection) Get(d *dto.LineDirectionGetReq, p *actions.DataPermissio
|
||||
return nil
|
||||
}
|
||||
|
||||
// Get 获取LineDirection对象
|
||||
func (e *LineDirection) GetBySymbol(d *dto.LineDirectionGetReq, p *actions.DataPermission, model *models.LineDirection) error {
|
||||
var data models.LineDirection
|
||||
|
||||
err := e.Orm.Model(&data).
|
||||
Where("symbol =? AND type =?", d.Symbol, d.SymbolType).
|
||||
First(model).Error
|
||||
if err != nil && errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
err = errors.New("查看对象不存在")
|
||||
e.Log.Errorf("Service GetLineDirection error:%s \r\n", err)
|
||||
return err
|
||||
}
|
||||
if err != nil {
|
||||
e.Log.Errorf("db error:%s", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Insert 创建LineDirection对象
|
||||
func (e *LineDirection) Insert(c *dto.LineDirectionInsertReq) error {
|
||||
var err error
|
||||
|
||||
Reference in New Issue
Block a user