|
@@ -79,6 +79,8 @@ func (this *YanxuanSpecialController) Add() {
|
|
|
MobileInit: infoUser.Mobile,
|
|
|
CompanyName: infoUser.CompanyName,
|
|
|
CompanyId: infoUser.CompanyId,
|
|
|
+ InviteName: req.InviteName,
|
|
|
+ Remark: req.Remark,
|
|
|
CreateTime: time.Now(),
|
|
|
ModifyTime: time.Now(),
|
|
|
HeadImg: utils.CYGX_YANXUAN_SPECIAL_HEAD_IMG_URL + strconv.Itoa(rnd) + ".png",
|
|
@@ -157,6 +159,7 @@ func (this *YanxuanSpecialController) AuthorEnable() {
|
|
|
// @Param CurrentIndex query int true "当前页页码,从1开始"
|
|
|
// @Param Status query string true "状态: 1:启用 、 2:禁用 。传其他默认所有"
|
|
|
// @Param KeyWord query string false "搜索关键词"
|
|
|
+// @Param NickName query string false "昵称"
|
|
|
// @Param SortParam query string false "排序字段参数,用来排序的字段, 枚举值:'CreatTime':开通时间 、 'articleNum':已发布文章 、 'pv':总Pv/Uv "
|
|
|
// @Param SortType query string true "如何排序,是正序还是倒序,枚举值:`asc 正序`,`desc 倒叙`"
|
|
|
// @Success 200 {object} models.AddEnglishReportResp
|
|
@@ -182,6 +185,7 @@ func (this *YanxuanSpecialController) AuthorList() {
|
|
|
//排序参数
|
|
|
sortParam := this.GetString("SortParam")
|
|
|
sortType := this.GetString("SortType")
|
|
|
+ nickName := this.GetString("NickName")
|
|
|
|
|
|
var startSize int
|
|
|
if pageSize <= 0 {
|
|
@@ -206,6 +210,13 @@ func (this *YanxuanSpecialController) AuthorList() {
|
|
|
pars = append(pars, keyWord)
|
|
|
}
|
|
|
|
|
|
+ //关键词搜索
|
|
|
+ if nickName != "" {
|
|
|
+ nickName = "%" + nickName + "%"
|
|
|
+ condition += ` AND art.nick_name like ? `
|
|
|
+ pars = append(pars, nickName)
|
|
|
+ }
|
|
|
+
|
|
|
//排序字段以及排序方式处理
|
|
|
var sortStr string
|
|
|
if sortParam != "" && sortType != "" {
|
|
@@ -874,3 +885,42 @@ func init_928() {
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// @Title 修改作者信息
|
|
|
+// @Description 修改作者信息接口
|
|
|
+// @Param request body help_doc.AddHelpDocReq true "type json string"
|
|
|
+// @router /yanxuan_special/author/update [post]
|
|
|
+func (this *YanxuanSpecialController) AuthorUpdate() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+ sysUser := this.SysUser
|
|
|
+ if sysUser == nil {
|
|
|
+ br.Msg = "请登录"
|
|
|
+ br.ErrMsg = "请登录,SysUser Is Empty"
|
|
|
+ br.Ret = 408
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var req cygx.AddCygxYanxuanSpecialAuthorReq
|
|
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "参数解析异常!"
|
|
|
+ br.ErrMsg = "参数解析失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if req.UserId <= 0 {
|
|
|
+ br.Msg = "请输入用户信息"
|
|
|
+ return
|
|
|
+ }
|
|
|
+ err = cygx.UpdateYanxuanSpecialAuthorInviteName(req.InviteName, req.Remark, req.UserId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "新增失败"
|
|
|
+ br.ErrMsg = "新增失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "修改成功"
|
|
|
+}
|