|
@@ -1,11 +1,11 @@
|
|
|
package duty
|
|
package duty
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
|
+ "dashoo.cn/micro_libary/response"
|
|
|
"dashoo.cn/modi_webapi/app/common"
|
|
"dashoo.cn/modi_webapi/app/common"
|
|
|
"dashoo.cn/modi_webapi/app/model/duty/detail"
|
|
"dashoo.cn/modi_webapi/app/model/duty/detail"
|
|
|
detailService "dashoo.cn/modi_webapi/app/service/duty"
|
|
detailService "dashoo.cn/modi_webapi/app/service/duty"
|
|
|
"dashoo.cn/modi_webapi/library/request"
|
|
"dashoo.cn/modi_webapi/library/request"
|
|
|
- "dashoo.cn/modi_webapi/library/response"
|
|
|
|
|
"github.com/gogf/gf/net/ghttp"
|
|
"github.com/gogf/gf/net/ghttp"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
@@ -154,3 +154,20 @@ func (c *DetailController) DeleteDetail(r *ghttp.Request) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+// 根据父级id查询
|
|
|
|
|
+func (c *DetailController) GetDetailByDutyId(r *ghttp.Request) {
|
|
|
|
|
+ // tenant 租户模式
|
|
|
|
|
+ tenant := r.Header.Get("Tenant")
|
|
|
|
|
+ // 初始化service
|
|
|
|
|
+ service, err := detailService.NewDetailService(tenant)
|
|
|
|
|
+ if err != nil {
|
|
|
|
|
+ response.Json(r, -1, err.Error())
|
|
|
|
|
+ }
|
|
|
|
|
+ DutyId := r.GetInt("DutyId")
|
|
|
|
|
+ if result, err := service.GetDetailByDutyId(DutyId); err != nil {
|
|
|
|
|
+ response.Json(r, 1, err.Error())
|
|
|
|
|
+ } else {
|
|
|
|
|
+ response.Json(r, 0, "ok", result)
|
|
|
|
|
+ }
|
|
|
|
|
+}
|