处理修改规则详情接口
This commit is contained in:
@@ -242,6 +242,8 @@ func (r *PeakValley) PeakValleyRuleDetail(req *form.PeakValleyRuleDetailReq) map
|
||||
|
||||
// PeakValleyRuleEditDetail 获取规则详情-编辑使用
|
||||
func (r *PeakValley) PeakValleyRuleEditDetail(req *form.PeakValleyRuleEditDetailReq) map[string]interface{} {
|
||||
pvr, err := repository.GroupRepositorys.PeakValley.GetOnePeakValleyRule(map[string]interface{}{"rule_id": req.RuleId})
|
||||
exception.PanicMsgBool(err != nil, "获取规则详情失败")
|
||||
// 获取分了多少个时间段 以及每个时间段的自定义名称 峰谷类型
|
||||
customNames, err := repository.GroupRepositorys.PeakValley.GetPeakValleyRuleCustomName(req.RuleId)
|
||||
exception.PanicMsgBool(err != nil, "获取规则区块类型失败1")
|
||||
@@ -270,7 +272,9 @@ func (r *PeakValley) PeakValleyRuleEditDetail(req *form.PeakValleyRuleEditDetail
|
||||
sort.Sort(peak_valley_model.ByCustomNameNumber(customNames))
|
||||
|
||||
DetailRsp := make(map[string]interface{})
|
||||
DetailRsp["rule_id"] = req.RuleId
|
||||
DetailRsp["rule_id"] = pvr.RuleId
|
||||
DetailRsp["rule_name"] = pvr.RuleName
|
||||
DetailRsp["description"] = pvr.Description
|
||||
DetailRsp["detail"] = customNames
|
||||
return DetailRsp
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user