...
|
...
|
@@ -175,3 +175,39 @@ func (this *BulletinController) BulletinFeedbacks() { |
|
|
rsp, err := bulletin.BulletinFeedbacks(companyId, request)
|
|
|
msg = protocol.NewPageDataResponse(rsp, err)
|
|
|
}
|
|
|
|
|
|
//ExportFeedBacks
|
|
|
//@router /exportFeedBacks [post]
|
|
|
func (this *BulletinController) ExportFeedBacks() {
|
|
|
var msg *protocol.ResponseMessage
|
|
|
defer func() {
|
|
|
this.ResposeJson(msg)
|
|
|
}()
|
|
|
var request *protocol.ExportFeedBacksRequest
|
|
|
if err := json.Unmarshal(this.Ctx.Input.RequestBody, &request); err != nil {
|
|
|
log.Error("json 解析失败", err)
|
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
|
|
}
|
|
|
if b, m := this.Valid(request); !b {
|
|
|
msg = m
|
|
|
return
|
|
|
}
|
|
|
companyId := this.GetCompanyId()
|
|
|
if companyId <= 0 {
|
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
|
|
}
|
|
|
excel, err := bulletin.ExportFeedBacks(companyId, request)
|
|
|
if err != nil {
|
|
|
log.Error(err.Error())
|
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
|
|
}
|
|
|
if err = this.ResponseExcelByFile(this.Ctx, excel); err != nil {
|
|
|
log.Error(err.Error())
|
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
|
|
}
|
|
|
msg = protocol.NewReturnResponse(nil, err)
|
|
|
} |
...
|
...
|
|