@@ -757,4 +757,36 @@ func (this *YanxuanSpecialController) Cancel() {
br.Msg = "取消发布成功"
br.Ret = 200
br.Success = true
-}
+}
+
+// @Title 作者列表
+// @Description 作者列表
+// @Param request body help_doc.AddHelpDocReq true "type json string"
+// @Success 200 {object} models.AddEnglishReportResp
+// @router /author/list [get]
+func (this *YanxuanSpecialController) AuthorList() {
+ br := new(models.BaseResponse).Init()
+ defer func() {
+ this.Data["json"] = br
+ this.ServeJSON()
+ }()
+ sysUser := this.User
+ if sysUser == nil {
+ br.Msg = "请登录"
+ br.ErrMsg = "请登录,SysUser Is Empty"
+ br.Ret = 408
+ return
+ }
+ list, tmpErr := models.GetYanxuanSpecialAuthorList()
+ if tmpErr != nil {
+ br.Msg = "获取失败"
+ br.ErrMsg = "获取失败, Err:" + tmpErr.Error()
+ br.Data = list
+ br.Ret = 200
+ br.Success = true
+ br.Msg = "获取成功"
@@ -94,3 +94,17 @@ func UpdateYanxuanSpecialAuthor(item *CygxYanxuanSpecialAuthor) (err error) {
_, err = o.Raw(sql, item.SpecialName, item.Introduction, item.Label, item.NickName, item.UserId).Exec()
return
}
+func GetYanxuanSpecialAuthorList() (items []*CygxYanxuanSpecialAuthorItem, err error) {
+ o := orm.NewOrm()
+ sql := ``
+ sql = `SELECT
+ a.*,c.company_name
+FROM
+ cygx_yanxuan_special_author as a
+ INNER JOIN wx_user AS u ON u.user_id = a.user_id
+ INNER JOIN company AS c ON c.company_id = u.company_id ORDER BY create_time DESC `
+ _, err = o.Raw(sql).QueryRows(&items)
@@ -1699,6 +1699,15 @@ func init() {
Filters: nil,
Params: nil})
+ beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:YanxuanSpecialController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:YanxuanSpecialController"],
+ beego.ControllerComments{
+ Method: "AuthorList",
+ Router: `/author/list`,
+ AllowHTTPMethods: []string{"get"},
+ MethodParams: param.Make(),
+ Filters: nil,
+ Params: nil})
beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:YanxuanSpecialController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:YanxuanSpecialController"],
beego.ControllerComments{
Method: "AuthorSave",