|
@@ -245,6 +245,7 @@ func (this *ArticleController) InterviewApply() {
|
|
|
item.InterviewTime = time.Now()
|
|
|
item.CreateTime = time.Now()
|
|
|
item.ModifyTime = time.Now()
|
|
|
+ item.ArticleIdMd5 = article.ArticleIdMd5
|
|
|
_, err = models.AddCygxInterviewApply(item)
|
|
|
if err != nil {
|
|
|
br.Msg = "申请失败"
|
|
@@ -270,7 +271,7 @@ func (this *ArticleController) InterviewApply() {
|
|
|
|
|
|
// @Title 获取报告详情
|
|
|
// @Description 获取报告详情接口
|
|
|
-// @Param ArticleId query int true "报告ID"
|
|
|
+// @Param ArticleIdMd5 query int true "报告ID"
|
|
|
// @Success 200 {object} models.ArticleDetailResp
|
|
|
// @router /look/detail [get]
|
|
|
func (this *ArticleCommonController) Detail() {
|
|
@@ -279,37 +280,26 @@ func (this *ArticleCommonController) Detail() {
|
|
|
this.Data["json"] = br
|
|
|
this.ServeJSON()
|
|
|
}()
|
|
|
- userName := this.GetString("UserName")
|
|
|
- if userName == "" {
|
|
|
+
|
|
|
+ articleIdMd5:= this.GetString("ArticleIdMd5")
|
|
|
+ if articleIdMd5 =="" {
|
|
|
br.Msg = "参数错误"
|
|
|
- br.ErrMsg = "参数错误,UserName Is Empty"
|
|
|
+ br.ErrMsg = "参数错误"
|
|
|
return
|
|
|
}
|
|
|
- sellerItem, err := models.GetSellerByName(userName)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取数据失败"
|
|
|
- br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
+ resp := new(models.ArticleDetailResp)
|
|
|
+ detail, err := models.GetArticleDetailByIdMd5(articleIdMd5)
|
|
|
+ if err != nil && err.Error()!=utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取信息失败,Err:"+err.Error()
|
|
|
return
|
|
|
}
|
|
|
- resp := new(models.ArticleDetailResp)
|
|
|
- if sellerItem.AdminId <= 0 {
|
|
|
+ if detail==nil {
|
|
|
resp.HasPermission = 2
|
|
|
- } else {
|
|
|
- articleId, _ := this.GetInt("ArticleId")
|
|
|
- if articleId <= 0 {
|
|
|
- br.Msg = "参数错误"
|
|
|
- br.ErrMsg = "参数错误"
|
|
|
- return
|
|
|
- }
|
|
|
- detail, err := models.GetArticleDetailById(articleId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取信息失败"
|
|
|
- br.ErrMsg = "获取信息失败"
|
|
|
- return
|
|
|
- }
|
|
|
- resp.Detail = detail
|
|
|
+ }else{
|
|
|
resp.HasPermission = 1
|
|
|
}
|
|
|
+ resp.Detail = detail
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
br.Msg = "获取成功"
|